diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 85fb2f28a4ca..250bfe6c056c 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1084,6 +1084,24 @@ # ServiceLabel: %Spring App Discovery %Mgmt # ServiceOwners: @sunkun99 +# PRLabel: %Compute - Fleet +/sdk/computefleet/Azure.ResourceManager.*/ @sahilarora92 @dhruvil009 @rahuls-microsoft + +# ServiceLabel: %Compute - Fleet %Mgmt +# ServiceOwners: @sahilarora92 @dhruvil009 @rahuls-microsoft + +# PRLabel: %HybridConnectivity +/sdk/hybridconnectivity/Azure.ResourceManager.*/ @alexmahonic @PriyankaHariharan @apmehrotra + +# ServiceLabel: %%HybridConnectivity %Mgmt +# ServiceOwners: @alexmahonic @PriyankaHariharan @apmehrotra + +# PRLabel: %Migration Assessment +/sdk/migrationassessment/Azure.ResourceManager.*/ @srilipta-swain + +# ServiceLabel: %%Migration Assessment %Mgmt +# ServiceOwners: @srilipta-swain + # ######## Eng Sys ######## /eng/ @hallipr @weshaggard @benbp /eng/common/ @Azure/azure-sdk-eng diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/Azure.ResourceManager.Migration.Assessment.sln b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/Azure.ResourceManager.Migration.Assessment.sln new file mode 100644 index 000000000000..a9488d40ab94 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/Azure.ResourceManager.Migration.Assessment.sln @@ -0,0 +1,65 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30309.148 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{C09336C8-1E2E-450A-B3EE-E0338E581E64}") = "Azure.ResourceManager.Migration.Assessment", "src\Azure.ResourceManager.Migration.Assessment.csproj", "{F48214C6-75D3-4E6C-9EA0-CCB33D9C5193}" +EndProject +Project("{C09336C8-1E2E-450A-B3EE-E0338E581E64}") = "Azure.ResourceManager.Migration.Assessment.Tests", "tests\Azure.ResourceManager.Migration.Assessment.Tests.csproj", "{2AB4150A-8F83-4CA5-9C49-99745E30B5F7}" +EndProject +Project("{C09336C8-1E2E-450A-B3EE-E0338E581E64}") = "Azure.ResourceManager.Migration.Assessment.Samples", "samples\Azure.ResourceManager.Migration.Assessment.Samples.csproj", "{77AFBF28-89E5-4660-8A47-2784FCB1BDF4}" +EndProject +Global + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {8A1DC930-9FB3-4CD8-BF04-0BCB3CCD014F} + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F48214C6-75D3-4E6C-9EA0-CCB33D9C5193}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F48214C6-75D3-4E6C-9EA0-CCB33D9C5193}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F48214C6-75D3-4E6C-9EA0-CCB33D9C5193}.Debug|x64.ActiveCfg = Debug|Any CPU + {F48214C6-75D3-4E6C-9EA0-CCB33D9C5193}.Debug|x64.Build.0 = Debug|Any CPU + {F48214C6-75D3-4E6C-9EA0-CCB33D9C5193}.Debug|x86.ActiveCfg = Debug|Any CPU + {F48214C6-75D3-4E6C-9EA0-CCB33D9C5193}.Debug|x86.Build.0 = Debug|Any CPU + {F48214C6-75D3-4E6C-9EA0-CCB33D9C5193}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F48214C6-75D3-4E6C-9EA0-CCB33D9C5193}.Release|Any CPU.Build.0 = Release|Any CPU + {F48214C6-75D3-4E6C-9EA0-CCB33D9C5193}.Release|x64.ActiveCfg = Release|Any CPU + {F48214C6-75D3-4E6C-9EA0-CCB33D9C5193}.Release|x64.Build.0 = Release|Any CPU + {F48214C6-75D3-4E6C-9EA0-CCB33D9C5193}.Release|x86.ActiveCfg = Release|Any CPU + {F48214C6-75D3-4E6C-9EA0-CCB33D9C5193}.Release|x86.Build.0 = Release|Any CPU + {2AB4150A-8F83-4CA5-9C49-99745E30B5F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2AB4150A-8F83-4CA5-9C49-99745E30B5F7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2AB4150A-8F83-4CA5-9C49-99745E30B5F7}.Debug|x64.ActiveCfg = Debug|Any CPU + {2AB4150A-8F83-4CA5-9C49-99745E30B5F7}.Debug|x64.Build.0 = Debug|Any CPU + {2AB4150A-8F83-4CA5-9C49-99745E30B5F7}.Debug|x86.ActiveCfg = Debug|Any CPU + {2AB4150A-8F83-4CA5-9C49-99745E30B5F7}.Debug|x86.Build.0 = Debug|Any CPU + {2AB4150A-8F83-4CA5-9C49-99745E30B5F7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2AB4150A-8F83-4CA5-9C49-99745E30B5F7}.Release|Any CPU.Build.0 = Release|Any CPU + {2AB4150A-8F83-4CA5-9C49-99745E30B5F7}.Release|x64.ActiveCfg = Release|Any CPU + {2AB4150A-8F83-4CA5-9C49-99745E30B5F7}.Release|x64.Build.0 = Release|Any CPU + {2AB4150A-8F83-4CA5-9C49-99745E30B5F7}.Release|x86.ActiveCfg = Release|Any CPU + {2AB4150A-8F83-4CA5-9C49-99745E30B5F7}.Release|x86.Build.0 = Release|Any CPU + {77AFBF28-89E5-4660-8A47-2784FCB1BDF4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {77AFBF28-89E5-4660-8A47-2784FCB1BDF4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {77AFBF28-89E5-4660-8A47-2784FCB1BDF4}.Debug|x64.ActiveCfg = Debug|Any CPU + {77AFBF28-89E5-4660-8A47-2784FCB1BDF4}.Debug|x64.Build.0 = Debug|Any CPU + {77AFBF28-89E5-4660-8A47-2784FCB1BDF4}.Debug|x86.ActiveCfg = Debug|Any CPU + {77AFBF28-89E5-4660-8A47-2784FCB1BDF4}.Debug|x86.Build.0 = Debug|Any CPU + {77AFBF28-89E5-4660-8A47-2784FCB1BDF4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {77AFBF28-89E5-4660-8A47-2784FCB1BDF4}.Release|Any CPU.Build.0 = Release|Any CPU + {77AFBF28-89E5-4660-8A47-2784FCB1BDF4}.Release|x64.ActiveCfg = Release|Any CPU + {77AFBF28-89E5-4660-8A47-2784FCB1BDF4}.Release|x64.Build.0 = Release|Any CPU + {77AFBF28-89E5-4660-8A47-2784FCB1BDF4}.Release|x86.ActiveCfg = Release|Any CPU + {77AFBF28-89E5-4660-8A47-2784FCB1BDF4}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/CHANGELOG.md b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/CHANGELOG.md new file mode 100644 index 000000000000..d9488ee922fc --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/CHANGELOG.md @@ -0,0 +1,17 @@ +# Release History + +## 1.0.0-beta.1 (2025-02-27) + +### Features Added + +This package follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: + + - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET. + - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing. + - HTTP pipeline with custom policies. + - Better error-handling. + - Support uniform telemetry across all languages. + +This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). + +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). \ No newline at end of file diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/Directory.Build.props b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/Directory.Build.props new file mode 100644 index 000000000000..1a9611bd4924 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/README.md b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/README.md new file mode 100644 index 000000000000..d74e637e7d4a --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure Migration.Assessment management client library for .NET + +**[Describe the service briefly first.]** + +This library follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: + + - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET. + - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing. + - HTTP pipeline with custom policies. + - Better error-handling. + - Support uniform telemetry across all languages. + +## Getting started + +### Install the package + +Install the Microsoft Azure Migration.Assessment management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.Migration.Assessment --prerelease +``` + +### Prerequisites + +* You must have an [Microsoft Azure subscription](https://azure.microsoft.com/free/dotnet/). + +### Authenticate the Client + +To create an authenticated client and start interacting with Microsoft Azure resources, see the [quickstart guide here](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). + +## Key concepts + +Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html) + +## Documentation + +Documentation is available to help you learn how to use this package: + +- [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). +- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). + +## Examples + +Code samples for using the management library for .NET can be found in the following locations +- [.NET Management Library Code Samples](https://aka.ms/azuresdk-net-mgmt-samples) + +## Troubleshooting + +- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues). +- Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags. + +## Next steps + +For more information about Microsoft Azure SDK, see [this website](https://azure.github.io/azure-sdk/). + +## Contributing + +For details on contributing to this repository, see the [contributing +guide][cg]. + +This project welcomes contributions and suggestions. Most contributions +require you to agree to a Contributor License Agreement (CLA) declaring +that you have the right to, and actually do, grant us the rights to use +your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine +whether you need to provide a CLA and decorate the PR appropriately +(for example, label, comment). Follow the instructions provided by the +bot. You'll only need to do this action once across all repositories +using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For +more information, see the [Code of Conduct FAQ][coc_faq] or contact + with any other questions or comments. + + +[cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/api/Azure.ResourceManager.Migration.Assessment.net8.0.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/api/Azure.ResourceManager.Migration.Assessment.net8.0.cs new file mode 100644 index 000000000000..10538b54994c --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/api/Azure.ResourceManager.Migration.Assessment.net8.0.cs @@ -0,0 +1,4395 @@ +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class AssessedMachineCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AssessedMachineCollection() { } + public virtual Azure.Response Exists(string assessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string assessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string assessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string assessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string assessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string assessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class AssessedMachineData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AssessedMachineData() { } + public Azure.ResourceManager.Migration.Assessment.Models.MachineBootType? BootType { get { throw null; } } + public double? ConfidenceRatingInPercentage { get { throw null; } } + public System.Collections.Generic.IList CostComponents { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.Core.ResourceIdentifier DatacenterMachineArmId { get { throw null; } } + public Azure.Core.ResourceIdentifier DatacenterManagementServerArmId { get { throw null; } } + public string DatacenterManagementServerName { get { throw null; } } + public string Description { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Disks { get { throw null; } } + public string DisplayName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.ProcessorInfo HostProcessor { get { throw null; } set { } } + public double? MegabytesOfMemory { get { throw null; } } + public double? MegabytesOfMemoryForRecommendedSize { get { throw null; } } + public double? MonthlyBandwidthCost { get { throw null; } } + public double? MonthlyComputeCostForRecommendedSize { get { throw null; } } + public double? MonthlyPremiumStorageCost { get { throw null; } } + public double? MonthlyStandardSsdStorageCost { get { throw null; } } + public double? MonthlyStorageCost { get { throw null; } } + public double? MonthlyUltraStorageCost { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary NetworkAdapters { get { throw null; } } + public int? NumberOfCores { get { throw null; } } + public int? NumberOfCoresForRecommendedSize { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture? OperatingSystemArchitecture { get { throw null; } } + public string OperatingSystemName { get { throw null; } } + public string OperatingSystemType { get { throw null; } } + public string OperatingSystemVersion { get { throw null; } } + public double? PercentageCoresUtilization { get { throw null; } } + public double? PercentageMemoryUtilization { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus ProductSupportStatus { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize? RecommendedSize { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? Suitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail? SuitabilityDetail { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation? SuitabilityExplanation { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType? TypePropertiesType { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedMachineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedMachineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedMachineResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AssessedMachineResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedMachineData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedMachineName) { 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; } + Azure.ResourceManager.Migration.Assessment.AssessedMachineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedMachineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedSqlDatabaseV2Collection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AssessedSqlDatabaseV2Collection() { } + public virtual Azure.Response Exists(string assessedSqlDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string assessedSqlDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string assessedSqlDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string assessedSqlDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string assessedSqlDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string assessedSqlDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class AssessedSqlDatabaseV2Data : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AssessedSqlDatabaseV2Data() { } + public Azure.Core.ResourceIdentifier AssessedSqlInstanceArmId { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails AzureSqlDBSuitabilityDetails { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails AzureSqlMISuitabilityDetails { get { throw null; } } + public double? BufferCacheSizeInMB { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel? CompatibilityLevel { get { throw null; } } + public double? ConfidenceRatingInPercentage { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string DatabaseName { get { throw null; } } + public double? DatabaseSizeInMB { get { throw null; } } + public string InstanceName { get { throw null; } } + public bool? IsDatabaseHighlyAvailable { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlAvailabilityGroupDataOverview LinkedAvailabilityGroupOverview { get { throw null; } } + public Azure.Core.ResourceIdentifier MachineArmId { get { throw null; } } + public string MachineName { get { throw null; } } + public double? MegabytesPerSecondOfRead { get { throw null; } } + public double? MegabytesPerSecondOfWrite { get { throw null; } } + public double? NumberOfReadOperationsPerSecond { get { throw null; } } + public double? NumberOfWriteOperationsPerSecond { get { throw null; } } + public double? PercentageCoresUtilization { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus ProductSupportStatus { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? RecommendedAzureSqlTargetType { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability? RecommendedSuitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? SizingCriterion { get { throw null; } } + public Azure.Core.ResourceIdentifier SqlDatabaseSdsArmId { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedSqlDatabaseV2Data System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedSqlDatabaseV2Data System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedSqlDatabaseV2Resource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AssessedSqlDatabaseV2Resource() { } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedSqlDatabaseV2Data Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedSqlDatabaseName) { 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; } + Azure.ResourceManager.Migration.Assessment.AssessedSqlDatabaseV2Data System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedSqlDatabaseV2Data System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedSqlInstanceV2Collection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AssessedSqlInstanceV2Collection() { } + public virtual Azure.Response Exists(string assessedSqlInstanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string assessedSqlInstanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string assessedSqlInstanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string assessedSqlInstanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string assessedSqlInstanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string assessedSqlInstanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class AssessedSqlInstanceV2Data : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AssessedSqlInstanceV2Data() { } + public Azure.ResourceManager.Migration.Assessment.Models.SqlAvailabilityReplicaSummary AvailabilityReplicaSummary { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails AzureSqlDBSuitabilityDetails { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails AzureSqlMISuitabilityDetails { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2IaasSuitabilityDetails AzureSqlVmSuitabilityDetails { get { throw null; } } + public double? ConfidenceRatingInPercentage { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceDatabaseSummary DatabaseSummary { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadata FciMetadata { get { throw null; } } + public bool? HasScanOccurred { get { throw null; } } + public string InstanceName { get { throw null; } } + public bool? IsClustered { get { throw null; } } + public bool? IsHighAvailabilityEnabled { get { throw null; } } + public System.Collections.Generic.IReadOnlyList LogicalDisks { get { throw null; } } + public Azure.Core.ResourceIdentifier MachineArmId { get { throw null; } } + public string MachineName { get { throw null; } } + public double? MemoryInUseInMB { get { throw null; } } + public int? NumberOfCoresAllocated { get { throw null; } } + public double? PercentageCoresUtilization { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus ProductSupportStatus { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? RecommendedAzureSqlTargetType { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability? RecommendedSuitability { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RecommendedTargetReasonings { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? SizingCriterion { get { throw null; } } + public string SqlEdition { get { throw null; } } + public Azure.Core.ResourceIdentifier SqlInstanceSdsArmId { get { throw null; } } + public string SqlVersion { get { throw null; } } + public System.Collections.Generic.IReadOnlyList StorageTypeBasedDetails { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedSqlInstanceV2Data System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedSqlInstanceV2Data System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedSqlInstanceV2Resource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AssessedSqlInstanceV2Resource() { } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedSqlInstanceV2Data Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedSqlInstanceName) { 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; } + Azure.ResourceManager.Migration.Assessment.AssessedSqlInstanceV2Data System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedSqlInstanceV2Data System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedSqlMachineCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AssessedSqlMachineCollection() { } + public virtual Azure.Response Exists(string assessedSqlMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string assessedSqlMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string assessedSqlMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string assessedSqlMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string assessedSqlMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string assessedSqlMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class AssessedSqlMachineData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AssessedSqlMachineData() { } + public string BiosGuid { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MachineBootType? BootType { get { throw null; } } + public double? ConfidenceRatingInPercentage { get { throw null; } } + public System.Collections.Generic.IList CostComponents { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.Core.ResourceIdentifier DatacenterMachineArmId { get { throw null; } } + public Azure.Core.ResourceIdentifier DatacenterManagementServerArmId { get { throw null; } } + public string DatacenterManagementServerName { get { throw null; } } + public string Description { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Disks { get { throw null; } } + public string DisplayName { get { throw null; } } + public string Fqdn { get { throw null; } } + public double? MegabytesOfMemory { get { throw null; } } + public System.Collections.Generic.IReadOnlyList MigrationGuidelines { get { throw null; } } + public double? MonthlyBandwidthCost { get { throw null; } } + public double? MonthlyComputeCost { get { throw null; } } + public double? MonthlyStorageCost { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary NetworkAdapters { get { throw null; } } + public int? NumberOfCores { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture? OperatingSystemArchitecture { get { throw null; } } + public string OperatingSystemName { get { throw null; } } + public string OperatingSystemType { get { throw null; } } + public string OperatingSystemVersion { get { throw null; } } + public double? PercentageCoresUtilization { get { throw null; } } + public double? PercentageMemoryUtilization { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus ProductSupportStatus { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily? RecommendedVmFamily { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize? RecommendedVmSize { get { throw null; } } + public double? RecommendedVmSizeMegabytesOfMemory { get { throw null; } } + public int? RecommendedVmSizeNumberOfCores { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? SecuritySuitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? SizingCriterion { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SqlInstances { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? Suitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail? SuitabilityDetail { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation? SuitabilityExplanation { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType? TypePropertiesType { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedSqlMachineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedSqlMachineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedSqlMachineResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AssessedSqlMachineResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedSqlMachineData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedSqlMachineName) { 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; } + Azure.ResourceManager.Migration.Assessment.AssessedSqlMachineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedSqlMachineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedSqlRecommendedEntityCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AssessedSqlRecommendedEntityCollection() { } + public virtual Azure.Response Exists(string recommendedAssessedEntityName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string recommendedAssessedEntityName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string recommendedAssessedEntityName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string recommendedAssessedEntityName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string recommendedAssessedEntityName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string recommendedAssessedEntityName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class AssessedSqlRecommendedEntityData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AssessedSqlRecommendedEntityData() { } + public Azure.Core.ResourceIdentifier AssessedSqlEntityArmId { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails AzureSqlDBSuitabilityDetails { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails AzureSqlMISuitabilityDetails { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2IaasSuitabilityDetails AzureSqlVmSuitabilityDetails { get { throw null; } } + public int? DBCount { get { throw null; } } + public int? DiscoveredDBCount { get { throw null; } } + public bool? HasScanOccurred { get { throw null; } } + public string InstanceName { get { throw null; } } + public bool? IsClustered { get { throw null; } } + public bool? IsHighAvailabilityEnabled { get { throw null; } } + public string MachineName { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus ProductSupportStatus { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? RecommendedAzureSqlTargetType { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability? RecommendedSuitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? SizingCriterion { get { throw null; } } + public string SqlEdition { get { throw null; } } + public string SqlVersion { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedSqlRecommendedEntityData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedSqlRecommendedEntityData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedSqlRecommendedEntityResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AssessedSqlRecommendedEntityResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedSqlRecommendedEntityData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string recommendedAssessedEntityName) { 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; } + Azure.ResourceManager.Migration.Assessment.AssessedSqlRecommendedEntityData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedSqlRecommendedEntityData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAssessmentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentAssessmentCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string assessmentName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string assessmentName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentAssessmentData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentAssessmentData() { } + public System.Collections.Generic.IReadOnlyDictionary AssessmentErrorSummary { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentType? AssessmentType { get { throw null; } } + public System.Collections.Generic.IList AzureDiskTypes { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureHybridUseBenefit? AzureHybridUseBenefit { get { throw null; } set { } } + public Azure.Core.AzureLocation? AzureLocation { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode? AzureOfferCode { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzurePricingTier? AzurePricingTier { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy? AzureStorageRedundancy { get { throw null; } set { } } + public System.Collections.Generic.IList AzureVmFamilies { get { throw null; } } + public double? ConfidenceRatingInPercentage { get { throw null; } } + public System.Collections.Generic.IReadOnlyList CostComponents { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency? Currency { get { throw null; } set { } } + public double? DiscountPercentage { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyDictionary DistributionByOSName { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary DistributionByServicePackInsight { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary DistributionBySupportStatus { get { throw null; } } + public string EASubscriptionId { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType? GroupType { get { throw null; } } + public double? MonthlyBandwidthCost { get { throw null; } } + public double? MonthlyComputeCost { get { throw null; } } + public double? MonthlyPremiumStorageCost { get { throw null; } } + public double? MonthlyStandardSsdStorageCost { get { throw null; } } + public double? MonthlyStorageCost { get { throw null; } } + public double? MonthlyUltraStorageCost { get { throw null; } } + public int? NumberOfMachines { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization? Percentile { get { throw null; } set { } } + public System.DateTimeOffset? PerfDataEndOn { get { throw null; } set { } } + public System.DateTimeOffset? PerfDataStartOn { get { throw null; } set { } } + public System.DateTimeOffset? PricesQueriedOn { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? ProvisioningState { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance? ReservedInstance { get { throw null; } set { } } + public double? ScalingFactor { get { throw null; } set { } } + public string SchemaVersion { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? SizingCriterion { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage? Stage { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus? Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary SuitabilitySummary { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange? TimeRange { get { throw null; } set { } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.VmUptime VmUptime { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAssessmentOptionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentAssessmentOptionCollection() { } + public virtual Azure.Response Exists(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentAssessmentOptionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentAssessmentOptionData() { } + public System.Collections.Generic.IReadOnlyList PremiumDiskVmFamilies { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ReservedInstanceSupportedCurrencies { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ReservedInstanceSupportedLocations { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ReservedInstanceSupportedOffers { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ReservedInstanceVmFamilies { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SavingsPlanSupportedLocations { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SavingsPlanVmFamilies { get { throw null; } } + public System.Collections.Generic.IReadOnlyList UltraDiskVmFamilies { get { throw null; } } + public System.Collections.Generic.IReadOnlyList VmFamilies { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentOptionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentOptionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAssessmentOptionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentAssessmentOptionResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentOptionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string assessmentOptionsName) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentOptionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentOptionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAssessmentProjectCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentAssessmentProjectCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string projectName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string projectName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentAssessmentProjectData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentAssessmentProjectData(Azure.Core.AzureLocation location) { } + public string AssessmentSolutionId { get { throw null; } set { } } + public System.DateTimeOffset? CreateOn { get { throw null; } } + public Azure.Core.ResourceIdentifier CustomerStorageAccountArmId { get { throw null; } set { } } + public string CustomerWorkspaceId { get { throw null; } set { } } + public string CustomerWorkspaceLocation { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList PrivateEndpointConnections { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentProjectStatus? ProjectStatus { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? ProvisioningState { get { throw null; } set { } } + public string PublicNetworkAccess { get { throw null; } set { } } + public string ServiceEndpoint { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAssessmentProjectResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentAssessmentProjectResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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; } + public virtual Azure.Response GetMigrationAssessmentAssessmentOption(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentAssessmentOptionAsync(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentOptionCollection GetMigrationAssessmentAssessmentOptions() { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectSummaryCollection GetMigrationAssessmentAssessmentProjectSummaries() { throw null; } + public virtual Azure.Response GetMigrationAssessmentAssessmentProjectSummary(string projectSummaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentAssessmentProjectSummaryAsync(string projectSummaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetMigrationAssessmentAvsAssessmentOption(string avsAssessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentAvsAssessmentOptionAsync(string avsAssessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentOptionCollection GetMigrationAssessmentAvsAssessmentOptions() { throw null; } + public virtual Azure.Response GetMigrationAssessmentGroup(string groupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentGroupAsync(string groupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupCollection GetMigrationAssessmentGroups() { throw null; } + public virtual Azure.Response GetMigrationAssessmentHyperVCollector(string hyperVCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentHyperVCollectorAsync(string hyperVCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorCollection GetMigrationAssessmentHyperVCollectors() { throw null; } + public virtual Azure.Response GetMigrationAssessmentImportCollector(string importCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentImportCollectorAsync(string importCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorCollection GetMigrationAssessmentImportCollectors() { throw null; } + public virtual Azure.Response GetMigrationAssessmentMachine(string machineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentMachineAsync(string machineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentMachineCollection GetMigrationAssessmentMachines() { throw null; } + public virtual Azure.Response GetMigrationAssessmentPrivateEndpointConnection(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentPrivateEndpointConnectionAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionCollection GetMigrationAssessmentPrivateEndpointConnections() { throw null; } + public virtual Azure.Response GetMigrationAssessmentPrivateLinkResource(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentPrivateLinkResourceAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateLinkResourceCollection GetMigrationAssessmentPrivateLinkResources() { throw null; } + public virtual Azure.Response GetMigrationAssessmentServerCollector(string serverCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentServerCollectorAsync(string serverCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorCollection GetMigrationAssessmentServerCollectors() { throw null; } + public virtual Azure.Response GetMigrationAssessmentSqlAssessmentOption(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentSqlAssessmentOptionAsync(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentOptionCollection GetMigrationAssessmentSqlAssessmentOptions() { throw null; } + public virtual Azure.Response GetMigrationAssessmentSqlCollector(string collectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentSqlCollectorAsync(string collectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorCollection GetMigrationAssessmentSqlCollectors() { throw null; } + public virtual Azure.Response GetMigrationAssessmentVMwareCollector(string vmWareCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentVMwareCollectorAsync(string vmWareCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorCollection GetMigrationAssessmentVMwareCollectors() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentAssessmentProjectPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentAssessmentProjectPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MigrationAssessmentAssessmentProjectSummaryCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentAssessmentProjectSummaryCollection() { } + public virtual Azure.Response Exists(string projectSummaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string projectSummaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string projectSummaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string projectSummaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string projectSummaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string projectSummaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentAssessmentProjectSummaryData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentAssessmentProjectSummaryData() { } + public System.Collections.Generic.IReadOnlyList ErrorSummaryAffectedEntities { get { throw null; } } + public System.DateTimeOffset? LastAssessedOn { get { throw null; } } + public int? NumberOfAssessments { get { throw null; } } + public int? NumberOfGroups { get { throw null; } } + public int? NumberOfImportMachines { get { throw null; } } + public int? NumberOfMachines { get { throw null; } } + public int? NumberOfPrivateEndpointConnections { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectSummaryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectSummaryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAssessmentProjectSummaryResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentAssessmentProjectSummaryResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectSummaryData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string projectSummaryName) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectSummaryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectSummaryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAssessmentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentAssessmentResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation DownloadUrl(Azure.WaitUntil waitUntil, System.BinaryData body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DownloadUrlAsync(Azure.WaitUntil waitUntil, System.BinaryData body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAssessedMachine(string assessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAssessedMachineAsync(string assessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedMachineCollection GetAssessedMachines() { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MigrationAssessmentAvsAssessedMachineCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentAvsAssessedMachineCollection() { } + public virtual Azure.Response Exists(string avsAssessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string avsAssessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string avsAssessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string avsAssessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string avsAssessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string avsAssessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentAvsAssessedMachineData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentAvsAssessedMachineData() { } + public Azure.ResourceManager.Migration.Assessment.Models.MachineBootType? BootType { get { throw null; } } + public double? ConfidenceRatingInPercentage { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.Core.ResourceIdentifier DatacenterMachineArmId { get { throw null; } } + public Azure.Core.ResourceIdentifier DatacenterManagementServerArmId { get { throw null; } } + public string DatacenterManagementServerName { get { throw null; } } + public string Description { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Disks { get { throw null; } } + public string DisplayName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public double? MegabytesOfMemory { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary NetworkAdapters { get { throw null; } } + public int? NumberOfCores { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture? OperatingSystemArchitecture { get { throw null; } } + public string OperatingSystemName { get { throw null; } } + public string OperatingSystemType { get { throw null; } } + public string OperatingSystemVersion { get { throw null; } } + public double? PercentageCoresUtilization { get { throw null; } } + public double? PercentageMemoryUtilization { get { throw null; } } + public double? StorageInUseGB { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? Suitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail? SuitabilityDetail { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityExplanation? SuitabilityExplanation { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType? TypePropertiesType { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessedMachineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessedMachineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAvsAssessedMachineResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentAvsAssessedMachineResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessedMachineData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string avsAssessedMachineName) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessedMachineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessedMachineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAvsAssessmentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentAvsAssessmentCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string assessmentName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string assessmentName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentAvsAssessmentData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentAvsAssessmentData() { } + public System.Collections.Generic.IReadOnlyDictionary AssessmentErrorSummary { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentType? AssessmentType { get { throw null; } } + public Azure.Core.AzureLocation? AzureLocation { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode? AzureOfferCode { get { throw null; } set { } } + public double? ConfidenceRatingInPercentage { get { throw null; } } + public double? CpuUtilization { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency? Currency { get { throw null; } set { } } + public double? DedupeCompression { get { throw null; } set { } } + public double? DiscountPercentage { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel? FailuresToTolerateAndRaidLevel { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType? GroupType { get { throw null; } } + public bool? IsStretchClusterEnabled { get { throw null; } set { } } + public string LimitingFactor { get { throw null; } } + public double? MemOvercommit { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AvsNodeType? NodeType { get { throw null; } set { } } + public int? NumberOfMachines { get { throw null; } } + public int? NumberOfNodes { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization? Percentile { get { throw null; } set { } } + public System.DateTimeOffset? PerfDataEndOn { get { throw null; } set { } } + public System.DateTimeOffset? PerfDataStartOn { get { throw null; } set { } } + public System.DateTimeOffset? PricesQueriedOn { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? ProvisioningState { get { throw null; } set { } } + public double? RamUtilization { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance? ReservedInstance { get { throw null; } set { } } + public double? ScalingFactor { get { throw null; } set { } } + public string SchemaVersion { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? SizingCriterion { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage? Stage { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus? Status { get { throw null; } } + public double? StorageUtilization { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? Suitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AvsSuitabilityExplanation? SuitabilityExplanation { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary SuitabilitySummary { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange? TimeRange { get { throw null; } set { } } + public double? TotalCpuCores { get { throw null; } } + public double? TotalMonthlyCost { get { throw null; } } + public double? TotalRamInGB { get { throw null; } } + public double? TotalStorageInGB { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + public double? VcpuOversubscription { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAvsAssessmentOptionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentAvsAssessmentOptionCollection() { } + public virtual Azure.Response Exists(string avsAssessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string avsAssessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string avsAssessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string avsAssessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string avsAssessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string avsAssessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentAvsAssessmentOptionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentAvsAssessmentOptionData() { } + public System.Collections.Generic.IList AvsNodes { get { throw null; } } + public System.Collections.Generic.IList FailuresToTolerateAndRaidLevelValues { get { throw null; } } + public System.Collections.Generic.IList ReservedInstanceAvsNodes { get { throw null; } } + public System.Collections.Generic.IList ReservedInstanceSupportedCurrencies { get { throw null; } } + public System.Collections.Generic.IList ReservedInstanceSupportedLocations { get { throw null; } } + public System.Collections.Generic.IList ReservedInstanceSupportedOffers { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentOptionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentOptionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAvsAssessmentOptionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentAvsAssessmentOptionResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentOptionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string avsAssessmentOptionsName) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentOptionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentOptionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAvsAssessmentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentAvsAssessmentResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation DownloadUrl(Azure.WaitUntil waitUntil, System.BinaryData body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DownloadUrlAsync(Azure.WaitUntil waitUntil, System.BinaryData body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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; } + public virtual Azure.Response GetMigrationAssessmentAvsAssessedMachine(string avsAssessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentAvsAssessedMachineAsync(string avsAssessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessedMachineCollection GetMigrationAssessmentAvsAssessedMachines() { throw null; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class MigrationAssessmentExtensions + { + public static Azure.ResourceManager.Migration.Assessment.AssessedMachineResource GetAssessedMachineResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.AssessedSqlDatabaseV2Resource GetAssessedSqlDatabaseV2Resource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.AssessedSqlInstanceV2Resource GetAssessedSqlInstanceV2Resource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.AssessedSqlMachineResource GetAssessedSqlMachineResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.AssessedSqlRecommendedEntityResource GetAssessedSqlRecommendedEntityResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentOptionResource GetMigrationAssessmentAssessmentOptionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetMigrationAssessmentAssessmentProject(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetMigrationAssessmentAssessmentProjectAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectResource GetMigrationAssessmentAssessmentProjectResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectCollection GetMigrationAssessmentAssessmentProjects(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetMigrationAssessmentAssessmentProjects(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetMigrationAssessmentAssessmentProjectsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectSummaryResource GetMigrationAssessmentAssessmentProjectSummaryResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentResource GetMigrationAssessmentAssessmentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessedMachineResource GetMigrationAssessmentAvsAssessedMachineResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentOptionResource GetMigrationAssessmentAvsAssessmentOptionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentResource GetMigrationAssessmentAvsAssessmentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupResource GetMigrationAssessmentGroupResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorResource GetMigrationAssessmentHyperVCollectorResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorResource GetMigrationAssessmentImportCollectorResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentMachineResource GetMigrationAssessmentMachineResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionResource GetMigrationAssessmentPrivateEndpointConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateLinkResource GetMigrationAssessmentPrivateLinkResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorResource GetMigrationAssessmentServerCollectorResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentOptionResource GetMigrationAssessmentSqlAssessmentOptionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Resource GetMigrationAssessmentSqlAssessmentV2Resource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2SummaryResource GetMigrationAssessmentSqlAssessmentV2SummaryResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorResource GetMigrationAssessmentSqlCollectorResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorResource GetMigrationAssessmentVMwareCollectorResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MigrationAssessmentGroupCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentGroupCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string groupName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string groupName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string groupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string groupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string groupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string groupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string groupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string groupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentGroupData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentGroupData() { } + public bool? AreAssessmentsRunning { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Assessments { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus? GroupStatus { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType? GroupType { get { throw null; } set { } } + public int? MachineCount { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? ProvisioningState { get { throw null; } set { } } + public System.Collections.Generic.IList SupportedAssessmentTypes { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentGroupResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentGroupResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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; } + public virtual Azure.Response GetMigrationAssessmentAssessment(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentAssessmentAsync(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentCollection GetMigrationAssessmentAssessments() { throw null; } + public virtual Azure.Response GetMigrationAssessmentAvsAssessment(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentAvsAssessmentAsync(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentCollection GetMigrationAssessmentAvsAssessments() { throw null; } + public virtual Azure.Response GetMigrationAssessmentSqlAssessmentV2(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentSqlAssessmentV2Async(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Collection GetMigrationAssessmentSqlAssessmentV2s() { throw null; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation UpdateMachines(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateMachinesAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MigrationAssessmentHyperVCollectorCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentHyperVCollectorCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string hyperVCollectorName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string hyperVCollectorName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string hyperVCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string hyperVCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string hyperVCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string hyperVCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string hyperVCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string hyperVCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentHyperVCollectorData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentHyperVCollectorData() { } + public Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentPropertiesBase AgentProperties { get { throw null; } set { } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string DiscoverySiteId { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? ProvisioningState { get { throw null; } set { } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentHyperVCollectorResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentHyperVCollectorResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string hyperVCollectorName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MigrationAssessmentImportCollectorCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentImportCollectorCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string importCollectorName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string importCollectorName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string importCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string importCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string importCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string importCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string importCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string importCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentImportCollectorData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentImportCollectorData() { } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string DiscoverySiteId { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? ProvisioningState { get { throw null; } set { } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentImportCollectorResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentImportCollectorResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string importCollectorName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MigrationAssessmentMachineCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentMachineCollection() { } + public virtual Azure.Response Exists(string machineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string machineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string machineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string machineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string machineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string machineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentMachineData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentMachineData() { } + public Azure.ResourceManager.Migration.Assessment.Models.MachineBootType? BootType { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.Core.ResourceIdentifier DatacenterManagementServerArmId { get { throw null; } } + public string DatacenterManagementServerName { get { throw null; } } + public string Description { get { throw null; } } + public Azure.Core.ResourceIdentifier DiscoveryMachineArmId { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Disks { get { throw null; } } + public string DisplayName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Groups { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.ProcessorInfo HostProcessor { get { throw null; } } + public double? MegabytesOfMemory { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary NetworkAdapters { get { throw null; } } + public int? NumberOfCores { get { throw null; } } + public string OperatingSystemName { get { throw null; } } + public string OperatingSystemType { get { throw null; } } + public string OperatingSystemVersion { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus ProductSupportStatus { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SqlInstances { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + public System.Collections.Generic.IReadOnlyList WebApplications { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.WorkloadSummary WorkloadSummary { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentMachineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentMachineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentMachineResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentMachineResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentMachineData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string machineName) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentMachineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentMachineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentPrivateEndpointConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentPrivateEndpointConnectionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentPrivateEndpointConnectionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentPrivateEndpointConnectionData() { } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateLinkServiceConnectionState ConnectionState { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList GroupIds { get { throw null; } } + public Azure.Core.ResourceIdentifier PrivateEndpointId { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState? ProvisioningState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentPrivateEndpointConnectionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentPrivateEndpointConnectionResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string privateEndpointConnectionName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MigrationAssessmentPrivateLinkResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentPrivateLinkResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateLinkResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string privateLinkResourceName) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateLinkResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateLinkResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentPrivateLinkResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentPrivateLinkResourceCollection() { } + public virtual Azure.Response Exists(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentPrivateLinkResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentPrivateLinkResourceData() { } + public string GroupId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredMembers { get { throw null; } } + public System.Collections.Generic.IList RequiredZoneNames { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateLinkResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateLinkResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentServerCollectorCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentServerCollectorCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string serverCollectorName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string serverCollectorName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string serverCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string serverCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string serverCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string serverCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string serverCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string serverCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentServerCollectorData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentServerCollectorData() { } + public Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentPropertiesBase AgentProperties { get { throw null; } set { } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string DiscoverySiteId { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? ProvisioningState { get { throw null; } set { } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentServerCollectorResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentServerCollectorResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string serverCollectorName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MigrationAssessmentSqlAssessmentOptionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentSqlAssessmentOptionCollection() { } + public virtual Azure.Response Exists(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentSqlAssessmentOptionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentSqlAssessmentOptionData() { } + public System.Collections.Generic.IReadOnlyList PremiumDiskVmFamilies { get { throw null; } } + public System.Collections.Generic.IList ReservedInstanceSqlTargets { get { throw null; } } + public System.Collections.Generic.IList ReservedInstanceSupportedCurrencies { get { throw null; } } + public System.Collections.Generic.IList ReservedInstanceSupportedLocations { get { throw null; } } + public System.Collections.Generic.IList ReservedInstanceSupportedLocationsForIaas { get { throw null; } } + public System.Collections.Generic.IList ReservedInstanceSupportedOffers { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ReservedInstanceVmFamilies { get { throw null; } } + public System.Collections.Generic.IList SavingsPlanSupportedLocations { get { throw null; } } + public System.Collections.Generic.IList SavingsPlanSupportedLocationsForPaas { get { throw null; } } + public System.Collections.Generic.IList SavingsPlanSupportedOffers { get { throw null; } } + public System.Collections.Generic.IList SavingsPlanVmFamilies { get { throw null; } } + public System.Collections.Generic.IList SqlSkus { get { throw null; } } + public System.Collections.Generic.IList SupportedOffers { get { throw null; } } + public System.Collections.Generic.IReadOnlyList VmFamilies { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentOptionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentOptionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentSqlAssessmentOptionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentSqlAssessmentOptionResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentOptionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string assessmentOptionsName) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentOptionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentOptionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentSqlAssessmentV2Collection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentSqlAssessmentV2Collection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string assessmentName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Data data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string assessmentName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Data data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentSqlAssessmentV2Data : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentSqlAssessmentV2Data() { } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentType? AssessmentType { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AsyncCommitModeIntent? AsyncCommitModeIntent { get { throw null; } set { } } + public Azure.Core.AzureLocation? AzureLocation { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode? AzureOfferCode { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode? AzureOfferCodeForVm { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureSecurityOfferingType? AzureSecurityOfferingType { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlDBSettings AzureSqlDatabaseSettings { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlMISettings AzureSqlManagedInstanceSettings { get { throw null; } set { } } + public System.Collections.Generic.IList AzureSqlVmInstanceSeries { get { throw null; } } + public double? ConfidenceRatingInPercentage { get { throw null; } set { } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency? Currency { get { throw null; } set { } } + public Azure.Core.AzureLocation? DisasterRecoveryLocation { get { throw null; } set { } } + public double? DiscountPercentage { get { throw null; } set { } } + public string EASubscriptionId { get { throw null; } set { } } + public bool? EnableHadrAssessment { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.EntityUptime EntityUptime { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentEnvironmentType? EnvironmentType { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType? GroupType { get { throw null; } set { } } + public bool? IsInternetAccessAvailable { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MultiSubnetIntent? MultiSubnetIntent { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlOptimizationLogic? OptimizationLogic { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentOSLicense? OSLicense { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization? Percentile { get { throw null; } set { } } + public System.DateTimeOffset? PerfDataEndOn { get { throw null; } set { } } + public System.DateTimeOffset? PerfDataStartOn { get { throw null; } set { } } + public System.DateTimeOffset? PricesQueriedOn { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? ProvisioningState { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance? ReservedInstance { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance? ReservedInstanceForVm { get { throw null; } set { } } + public double? ScalingFactor { get { throw null; } set { } } + public string SchemaVersion { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? SizingCriterion { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlServerLicense? SqlServerLicense { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage? Stage { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus? Status { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange? TimeRange { get { throw null; } set { } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Data System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Data System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentSqlAssessmentV2Resource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentSqlAssessmentV2Resource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Data Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation DownloadUrl(Azure.WaitUntil waitUntil, System.BinaryData body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DownloadUrlAsync(Azure.WaitUntil waitUntil, System.BinaryData body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAssessedSqlDatabaseV2(string assessedSqlDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAssessedSqlDatabaseV2Async(string assessedSqlDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedSqlDatabaseV2Collection GetAssessedSqlDatabaseV2s() { throw null; } + public virtual Azure.Response GetAssessedSqlInstanceV2(string assessedSqlInstanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAssessedSqlInstanceV2Async(string assessedSqlInstanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedSqlInstanceV2Collection GetAssessedSqlInstanceV2s() { throw null; } + public virtual Azure.Response GetAssessedSqlMachine(string assessedSqlMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAssessedSqlMachineAsync(string assessedSqlMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedSqlMachineCollection GetAssessedSqlMachines() { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedSqlRecommendedEntityCollection GetAssessedSqlRecommendedEntities() { throw null; } + public virtual Azure.Response GetAssessedSqlRecommendedEntity(string recommendedAssessedEntityName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAssessedSqlRecommendedEntityAsync(string recommendedAssessedEntityName, 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; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2SummaryCollection GetMigrationAssessmentSqlAssessmentV2Summaries() { throw null; } + public virtual Azure.Response GetMigrationAssessmentSqlAssessmentV2Summary(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentSqlAssessmentV2SummaryAsync(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Data System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Data System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Data data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Data data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MigrationAssessmentSqlAssessmentV2SummaryCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentSqlAssessmentV2SummaryCollection() { } + public virtual Azure.Response Exists(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentSqlAssessmentV2SummaryData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentSqlAssessmentV2SummaryData() { } + public System.Collections.Generic.IReadOnlyDictionary AssessmentSummary { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary DatabaseDistributionBySizingCriterion { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary DistributionByServicePackInsight { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary DistributionBySqlEdition { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary DistributionBySqlVersion { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary DistributionBySupportStatus { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary InstanceDistributionBySizingCriterion { get { throw null; } } + public int? NumberOfFciInstances { get { throw null; } } + public int? NumberOfMachines { get { throw null; } } + public int? NumberOfSqlAvailabilityGroups { get { throw null; } } + public int? NumberOfSqlDatabases { get { throw null; } } + public int? NumberOfSqlInstances { get { throw null; } } + public int? NumberOfSuccessfullyDiscoveredSqlInstances { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2SummaryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2SummaryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentSqlAssessmentV2SummaryResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentSqlAssessmentV2SummaryResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2SummaryData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string summaryName) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2SummaryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2SummaryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentSqlCollectorCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentSqlCollectorCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string collectorName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string collectorName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string collectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string collectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string collectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string collectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string collectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string collectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentSqlCollectorData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentSqlCollectorData() { } + public Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentPropertiesBase AgentProperties { get { throw null; } set { } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string DiscoverySiteId { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? ProvisioningState { get { throw null; } set { } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentSqlCollectorResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentSqlCollectorResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string collectorName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MigrationAssessmentVMwareCollectorCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentVMwareCollectorCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string vmWareCollectorName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string vmWareCollectorName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string vmWareCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string vmWareCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string vmWareCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string vmWareCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string vmWareCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string vmWareCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentVMwareCollectorData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentVMwareCollectorData() { } + public Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentPropertiesBase AgentProperties { get { throw null; } set { } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string DiscoverySiteId { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? ProvisioningState { get { throw null; } set { } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentVMwareCollectorResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentVMwareCollectorResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string vmWareCollectorName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.Migration.Assessment.Mocking +{ + public partial class MockableMigrationAssessmentArmClient : Azure.ResourceManager.ArmResource + { + protected MockableMigrationAssessmentArmClient() { } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedMachineResource GetAssessedMachineResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedSqlDatabaseV2Resource GetAssessedSqlDatabaseV2Resource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedSqlInstanceV2Resource GetAssessedSqlInstanceV2Resource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedSqlMachineResource GetAssessedSqlMachineResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedSqlRecommendedEntityResource GetAssessedSqlRecommendedEntityResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentOptionResource GetMigrationAssessmentAssessmentOptionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectResource GetMigrationAssessmentAssessmentProjectResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectSummaryResource GetMigrationAssessmentAssessmentProjectSummaryResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentResource GetMigrationAssessmentAssessmentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessedMachineResource GetMigrationAssessmentAvsAssessedMachineResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentOptionResource GetMigrationAssessmentAvsAssessmentOptionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentResource GetMigrationAssessmentAvsAssessmentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupResource GetMigrationAssessmentGroupResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorResource GetMigrationAssessmentHyperVCollectorResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorResource GetMigrationAssessmentImportCollectorResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentMachineResource GetMigrationAssessmentMachineResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionResource GetMigrationAssessmentPrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateLinkResource GetMigrationAssessmentPrivateLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorResource GetMigrationAssessmentServerCollectorResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentOptionResource GetMigrationAssessmentSqlAssessmentOptionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Resource GetMigrationAssessmentSqlAssessmentV2Resource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2SummaryResource GetMigrationAssessmentSqlAssessmentV2SummaryResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorResource GetMigrationAssessmentSqlCollectorResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorResource GetMigrationAssessmentVMwareCollectorResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableMigrationAssessmentResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableMigrationAssessmentResourceGroupResource() { } + public virtual Azure.Response GetMigrationAssessmentAssessmentProject(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentAssessmentProjectAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectCollection GetMigrationAssessmentAssessmentProjects() { throw null; } + } + public partial class MockableMigrationAssessmentSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableMigrationAssessmentSubscriptionResource() { } + public virtual Azure.Pageable GetMigrationAssessmentAssessmentProjects(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetMigrationAssessmentAssessmentProjectsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public static partial class ArmMigrationAssessmentModelFactory + { + public static Azure.ResourceManager.Migration.Assessment.Models.AssessedDataDisk AssessedDataDisk(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? suitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?), Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation? suitabilityExplanation = default(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation?), Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail? suitabilityDetail = default(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail?), Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize? recommendedDiskSize = default(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize?), Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType? recommendedDiskType = default(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType?), int? recommendedDiskSizeGigabytes = default(int?), double? recommendDiskThroughputInMbps = default(double?), double? recommendedDiskIops = default(double?), double? monthlyStorageCost = default(double?), string name = null, string displayName = null, double? gigabytesProvisioned = default(double?), double? megabytesPerSecondOfRead = default(double?), double? megabytesPerSecondOfWrite = default(double?), double? numberOfReadOperationsPerSecond = default(double?), double? numberOfWriteOperationsPerSecond = default(double?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessedDisk AssessedDisk(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? suitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?), Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation? suitabilityExplanation = default(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation?), Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail? suitabilityDetail = default(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail?), Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize? recommendedDiskSize = default(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize?), Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType? recommendedDiskType = default(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType?), int? gigabytesForRecommendedDiskSize = default(int?), double? recommendDiskThroughputInMbps = default(double?), double? recommendedDiskIops = default(double?), double? monthlyStorageCost = default(double?), string name = null, string displayName = null, double? gigabytesProvisioned = default(double?), double? megabytesPerSecondOfRead = default(double?), double? megabytesPerSecondOfWrite = default(double?), double? numberOfReadOperationsPerSecond = default(double?), double? numberOfWriteOperationsPerSecond = default(double?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.AssessedMachineData AssessedMachineData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable errors = null, System.Collections.Generic.IReadOnlyDictionary disks = null, double? monthlyUltraStorageCost = default(double?), Azure.ResourceManager.Migration.Assessment.Models.ProcessorInfo hostProcessor = null, System.Collections.Generic.IEnumerable costComponents = null, Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus productSupportStatus = null, double? monthlyBandwidthCost = default(double?), double? monthlyStorageCost = default(double?), double? monthlyPremiumStorageCost = default(double?), double? monthlyStandardSsdStorageCost = default(double?), System.Collections.Generic.IReadOnlyDictionary networkAdapters = null, Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize? recommendedSize = default(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize?), int? numberOfCoresForRecommendedSize = default(int?), double? megabytesOfMemoryForRecommendedSize = default(double?), double? monthlyComputeCostForRecommendedSize = default(double?), Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation? suitabilityExplanation = default(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation?), Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail? suitabilityDetail = default(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail?), Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType? typePropertiesType = default(Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType?), Azure.ResourceManager.Migration.Assessment.Models.MachineBootType? bootType = default(Azure.ResourceManager.Migration.Assessment.Models.MachineBootType?), string operatingSystemType = null, string operatingSystemName = null, string operatingSystemVersion = null, Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture? operatingSystemArchitecture = default(Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), string displayName = null, string description = null, Azure.Core.ResourceIdentifier datacenterMachineArmId = null, Azure.Core.ResourceIdentifier datacenterManagementServerArmId = null, string datacenterManagementServerName = null, double? megabytesOfMemory = default(double?), int? numberOfCores = default(int?), double? confidenceRatingInPercentage = default(double?), double? percentageCoresUtilization = default(double?), double? percentageMemoryUtilization = default(double?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? suitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessedNetworkAdapter AssessedNetworkAdapter(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? suitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?), Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail? suitabilityDetail = default(Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail?), Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation? suitabilityExplanation = default(Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation?), double? monthlyBandwidthCosts = default(double?), double? netGigabytesTransmittedPerMonth = default(double?), string displayName = null, string macAddress = null, System.Collections.Generic.IEnumerable ipAddresses = null, double? megabytesPerSecondReceived = default(double?), double? megabytesPerSecondTransmitted = default(double?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.AssessedSqlDatabaseV2Data AssessedSqlDatabaseV2Data(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? recommendedAzureSqlTargetType = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType?), Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability? recommendedSuitability = default(Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability?), double? bufferCacheSizeInMB = default(double?), Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus productSupportStatus = null, Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails azureSqlMISuitabilityDetails = null, Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails azureSqlDBSuitabilityDetails = null, bool? isDatabaseHighlyAvailable = default(bool?), Azure.ResourceManager.Migration.Assessment.Models.SqlAvailabilityGroupDataOverview linkedAvailabilityGroupOverview = null, Azure.Core.ResourceIdentifier machineArmId = null, Azure.Core.ResourceIdentifier assessedSqlInstanceArmId = null, string machineName = null, string instanceName = null, string databaseName = null, double? databaseSizeInMB = default(double?), Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel? compatibilityLevel = default(Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel?), Azure.Core.ResourceIdentifier sqlDatabaseSdsArmId = null, double? percentageCoresUtilization = default(double?), double? megabytesPerSecondOfRead = default(double?), double? megabytesPerSecondOfWrite = default(double?), double? numberOfReadOperationsPerSecond = default(double?), double? numberOfWriteOperationsPerSecond = default(double?), double? confidenceRatingInPercentage = default(double?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? sizingCriterion = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceDatabaseSummary AssessedSqlInstanceDatabaseSummary(int? numberOfUserDatabases = default(int?), double? totalDatabaseSizeInMB = default(double?), double? largestDatabaseSizeInMB = default(double?), int? totalDiscoveredUserDatabases = default(int?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceDiskDetails AssessedSqlInstanceDiskDetails(string diskId = null, double? diskSizeInMB = default(double?), double? megabytesPerSecondOfRead = default(double?), double? megabytesPerSecondOfWrite = default(double?), double? numberOfReadOperationsPerSecond = default(double?), double? numberOfWriteOperationsPerSecond = default(double?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceStorageDetails AssessedSqlInstanceStorageDetails(string storageType = null, double? diskSizeInMB = default(double?), double? megabytesPerSecondOfRead = default(double?), double? megabytesPerSecondOfWrite = default(double?), double? numberOfReadOperationsPerSecond = default(double?), double? numberOfWriteOperationsPerSecond = default(double?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceSummary AssessedSqlInstanceSummary(string instanceId = null, string instanceName = null, Azure.Core.ResourceIdentifier sqlInstanceSdsArmId = null, string sqlInstanceEntityId = null, string sqlEdition = null, string sqlVersion = null, bool? isClustered = default(bool?), bool? isHighAvailabilityEnabled = default(bool?), Azure.ResourceManager.Migration.Assessment.Models.SqlFciState? sqlFciState = default(Azure.ResourceManager.Migration.Assessment.Models.SqlFciState?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.AssessedSqlInstanceV2Data AssessedSqlInstanceV2Data(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, double? memoryInUseInMB = default(double?), bool? hasScanOccurred = default(bool?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? recommendedAzureSqlTargetType = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType?), Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability? recommendedSuitability = default(Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability?), Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails azureSqlMISuitabilityDetails = null, Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails azureSqlDBSuitabilityDetails = null, Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2IaasSuitabilityDetails azureSqlVmSuitabilityDetails = null, System.Collections.Generic.IEnumerable storageTypeBasedDetails = null, Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus productSupportStatus = null, Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadata fciMetadata = null, Azure.ResourceManager.Migration.Assessment.Models.SqlAvailabilityReplicaSummary availabilityReplicaSummary = null, bool? isClustered = default(bool?), bool? isHighAvailabilityEnabled = default(bool?), System.Collections.Generic.IEnumerable recommendedTargetReasonings = null, Azure.Core.ResourceIdentifier machineArmId = null, string machineName = null, string instanceName = null, Azure.Core.ResourceIdentifier sqlInstanceSdsArmId = null, string sqlEdition = null, string sqlVersion = null, int? numberOfCoresAllocated = default(int?), double? percentageCoresUtilization = default(double?), System.Collections.Generic.IEnumerable logicalDisks = null, Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceDatabaseSummary databaseSummary = null, double? confidenceRatingInPercentage = default(double?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? sizingCriterion = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.AssessedSqlMachineData AssessedSqlMachineData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string biosGuid = null, string fqdn = null, System.Collections.Generic.IEnumerable sqlInstances = null, Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail? suitabilityDetail = default(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail?), Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation? suitabilityExplanation = default(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation?), Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize? recommendedVmSize = default(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize?), Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily? recommendedVmFamily = default(Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily?), Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus productSupportStatus = null, int? recommendedVmSizeNumberOfCores = default(int?), double? recommendedVmSizeMegabytesOfMemory = default(double?), double? monthlyComputeCost = default(double?), System.Collections.Generic.IReadOnlyDictionary disks = null, System.Collections.Generic.IReadOnlyDictionary networkAdapters = null, double? monthlyBandwidthCost = default(double?), double? monthlyStorageCost = default(double?), System.Collections.Generic.IEnumerable costComponents = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? securitySuitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?), System.Collections.Generic.IEnumerable migrationGuidelines = null, Azure.ResourceManager.Migration.Assessment.Models.MachineBootType? bootType = default(Azure.ResourceManager.Migration.Assessment.Models.MachineBootType?), string operatingSystemType = null, string operatingSystemName = null, string operatingSystemVersion = null, Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture? operatingSystemArchitecture = default(Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), string displayName = null, Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType? typePropertiesType = default(Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType?), string description = null, Azure.Core.ResourceIdentifier datacenterMachineArmId = null, Azure.Core.ResourceIdentifier datacenterManagementServerArmId = null, string datacenterManagementServerName = null, double? megabytesOfMemory = default(double?), int? numberOfCores = default(int?), double? confidenceRatingInPercentage = default(double?), double? percentageCoresUtilization = default(double?), double? percentageMemoryUtilization = default(double?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? suitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? sizingCriterion = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.AssessedSqlRecommendedEntityData AssessedSqlRecommendedEntityData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string machineName = null, string instanceName = null, Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus productSupportStatus = null, int? dbCount = default(int?), int? discoveredDBCount = default(int?), bool? hasScanOccurred = default(bool?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? recommendedAzureSqlTargetType = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType?), Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability? recommendedSuitability = default(Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability?), Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails azureSqlMISuitabilityDetails = null, Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails azureSqlDBSuitabilityDetails = null, Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2IaasSuitabilityDetails azureSqlVmSuitabilityDetails = null, Azure.Core.ResourceIdentifier assessedSqlEntityArmId = null, bool? isClustered = default(bool?), bool? isHighAvailabilityEnabled = default(bool?), string sqlEdition = null, string sqlVersion = null, Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? sizingCriterion = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentErrorSummary AssessmentErrorSummary(Azure.ResourceManager.Migration.Assessment.Models.AssessmentType? assessmentType = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentType?), int? count = default(int?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentReportDownloadUri AssessmentReportDownloadUri(System.Uri assessmentReportUri = null, System.DateTimeOffset expireOn = default(System.DateTimeOffset)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsAssessedDisk AvsAssessedDisk(string name = null, string displayName = null, double? gigabytesProvisioned = default(double?), double? megabytesPerSecondOfRead = default(double?), double? megabytesPerSecondOfWrite = default(double?), double? numberOfReadOperationsPerSecond = default(double?), double? numberOfWriteOperationsPerSecond = default(double?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsAssessedNetworkAdapter AvsAssessedNetworkAdapter(string macAddress = null, System.Collections.Generic.IEnumerable ipAddresses = null, string displayName = null, double? megabytesPerSecondReceived = default(double?), double? megabytesPerSecondTransmitted = default(double?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDto AzureManagedDiskSkuDto(Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType? diskType = default(Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType?), Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize? diskSize = default(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize?), Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskRedundancy? diskRedundancy = default(Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskRedundancy?), double? storageCost = default(double?), double? recommendedSizeInGib = default(double?), double? recommendedThroughputInMbps = default(double?), double? recommendedIops = default(double?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlIaasSkuDto AzureSqlIaasSkuDto(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSkuDto virtualMachineSize = null, System.Collections.Generic.IEnumerable dataDiskSizes = null, System.Collections.Generic.IEnumerable logDiskSizes = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? azureSqlTargetType = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPaasSkuDto AzureSqlPaasSkuDto(Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier? azureSqlServiceTier = default(Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier? azureSqlComputeTier = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration? azureSqlHardwareGeneration = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration?), double? storageMaxSizeInMB = default(double?), double? predictedDataSizeInMB = default(double?), double? predictedLogSizeInMB = default(double?), int? cores = default(int?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? azureSqlTargetType = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSkuDto AzureVmSkuDto(Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily? azureVmFamily = default(Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily?), int? cores = default(int?), Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize? azureSkuName = default(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize?), int? availableCores = default(int?), int? maxNetworkInterfaces = default(int?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.CostComponent CostComponent(Azure.ResourceManager.Migration.Assessment.Models.CostComponentName? name = default(Azure.ResourceManager.Migration.Assessment.Models.CostComponentName?), double? value = default(double?), string description = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.ImpactedAssessmentObject ImpactedAssessmentObject(string objectName = null, string objectType = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentData MigrationAssessmentAssessmentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? provisioningState = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState?), System.Collections.Generic.IReadOnlyDictionary assessmentErrorSummary = null, double? monthlyUltraStorageCost = default(double?), System.Collections.Generic.IEnumerable costComponents = null, string eaSubscriptionId = null, Azure.ResourceManager.Migration.Assessment.Models.AzurePricingTier? azurePricingTier = default(Azure.ResourceManager.Migration.Assessment.Models.AzurePricingTier?), Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy? azureStorageRedundancy = default(Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy?), Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance? reservedInstance = default(Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance?), Azure.ResourceManager.Migration.Assessment.Models.AzureHybridUseBenefit? azureHybridUseBenefit = default(Azure.ResourceManager.Migration.Assessment.Models.AzureHybridUseBenefit?), System.Collections.Generic.IEnumerable azureDiskTypes = null, System.Collections.Generic.IEnumerable azureVmFamilies = null, System.Collections.Generic.IReadOnlyDictionary distributionBySupportStatus = null, System.Collections.Generic.IReadOnlyDictionary distributionByServicePackInsight = null, System.Collections.Generic.IReadOnlyDictionary distributionByOSName = null, double? monthlyComputeCost = default(double?), double? monthlyBandwidthCost = default(double?), double? monthlyStorageCost = default(double?), double? monthlyPremiumStorageCost = default(double?), double? monthlyStandardSsdStorageCost = default(double?), System.Collections.Generic.IReadOnlyDictionary suitabilitySummary = null, int? numberOfMachines = default(int?), Azure.ResourceManager.Migration.Assessment.Models.VmUptime vmUptime = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType? groupType = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentType? assessmentType = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentType?), Azure.Core.AzureLocation? azureLocation = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode? azureOfferCode = default(Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode?), Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency? currency = default(Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency?), double? scalingFactor = default(double?), Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization? percentile = default(Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange? timeRange = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange?), System.DateTimeOffset? perfDataStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? perfDataEndOn = default(System.DateTimeOffset?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage? stage = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage?), double? discountPercentage = default(double?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? sizingCriterion = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion?), double? confidenceRatingInPercentage = default(double?), System.DateTimeOffset? pricesQueriedOn = default(System.DateTimeOffset?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus? status = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus?), string schemaVersion = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentOptionData MigrationAssessmentAssessmentOptionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable vmFamilies = null, System.Collections.Generic.IEnumerable reservedInstanceVmFamilies = null, System.Collections.Generic.IEnumerable reservedInstanceSupportedLocations = null, System.Collections.Generic.IEnumerable reservedInstanceSupportedCurrencies = null, System.Collections.Generic.IEnumerable reservedInstanceSupportedOffers = null, System.Collections.Generic.IEnumerable ultraDiskVmFamilies = null, System.Collections.Generic.IEnumerable premiumDiskVmFamilies = null, System.Collections.Generic.IEnumerable savingsPlanVmFamilies = null, System.Collections.Generic.IEnumerable savingsPlanSupportedLocations = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectData MigrationAssessmentAssessmentProjectData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? provisioningState = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState?), System.DateTimeOffset? createOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), string serviceEndpoint = null, string assessmentSolutionId = null, Azure.ResourceManager.Migration.Assessment.Models.AssessmentProjectStatus? projectStatus = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentProjectStatus?), string customerWorkspaceId = null, string customerWorkspaceLocation = null, string publicNetworkAccess = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.Core.ResourceIdentifier customerStorageAccountArmId = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectSummaryData MigrationAssessmentAssessmentProjectSummaryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable errorSummaryAffectedEntities = null, int? numberOfPrivateEndpointConnections = default(int?), int? numberOfGroups = default(int?), int? numberOfMachines = default(int?), int? numberOfImportMachines = default(int?), int? numberOfAssessments = default(int?), System.DateTimeOffset? lastAssessedOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessedMachineData MigrationAssessmentAvsAssessedMachineData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable errors = null, System.Collections.Generic.IReadOnlyDictionary disks = null, System.Collections.Generic.IReadOnlyDictionary networkAdapters = null, double? storageInUseGB = default(double?), Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityExplanation? suitabilityExplanation = default(Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityExplanation?), Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail? suitabilityDetail = default(Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail?), Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType? typePropertiesType = default(Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType?), Azure.ResourceManager.Migration.Assessment.Models.MachineBootType? bootType = default(Azure.ResourceManager.Migration.Assessment.Models.MachineBootType?), string operatingSystemType = null, string operatingSystemName = null, string operatingSystemVersion = null, Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture? operatingSystemArchitecture = default(Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), string displayName = null, string description = null, Azure.Core.ResourceIdentifier datacenterMachineArmId = null, Azure.Core.ResourceIdentifier datacenterManagementServerArmId = null, string datacenterManagementServerName = null, double? megabytesOfMemory = default(double?), int? numberOfCores = default(int?), double? confidenceRatingInPercentage = default(double?), double? percentageCoresUtilization = default(double?), double? percentageMemoryUtilization = default(double?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? suitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentData MigrationAssessmentAvsAssessmentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? provisioningState = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState?), System.Collections.Generic.IReadOnlyDictionary assessmentErrorSummary = null, Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel? failuresToTolerateAndRaidLevel = default(Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel?), double? vcpuOversubscription = default(double?), Azure.ResourceManager.Migration.Assessment.Models.AvsNodeType? nodeType = default(Azure.ResourceManager.Migration.Assessment.Models.AvsNodeType?), Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance? reservedInstance = default(Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance?), double? totalMonthlyCost = default(double?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? suitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?), Azure.ResourceManager.Migration.Assessment.Models.AvsSuitabilityExplanation? suitabilityExplanation = default(Azure.ResourceManager.Migration.Assessment.Models.AvsSuitabilityExplanation?), int? numberOfNodes = default(int?), double? cpuUtilization = default(double?), double? ramUtilization = default(double?), double? storageUtilization = default(double?), double? totalCpuCores = default(double?), double? totalRamInGB = default(double?), double? totalStorageInGB = default(double?), int? numberOfMachines = default(int?), System.Collections.Generic.IReadOnlyDictionary suitabilitySummary = null, double? memOvercommit = default(double?), double? dedupeCompression = default(double?), string limitingFactor = null, bool? isStretchClusterEnabled = default(bool?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType? groupType = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentType? assessmentType = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentType?), Azure.Core.AzureLocation? azureLocation = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode? azureOfferCode = default(Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode?), Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency? currency = default(Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency?), double? scalingFactor = default(double?), Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization? percentile = default(Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange? timeRange = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange?), System.DateTimeOffset? perfDataStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? perfDataEndOn = default(System.DateTimeOffset?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage? stage = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage?), double? discountPercentage = default(double?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? sizingCriterion = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion?), double? confidenceRatingInPercentage = default(double?), System.DateTimeOffset? pricesQueriedOn = default(System.DateTimeOffset?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus? status = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus?), string schemaVersion = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentOptionData MigrationAssessmentAvsAssessmentOptionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable avsNodes = null, System.Collections.Generic.IEnumerable failuresToTolerateAndRaidLevelValues = null, System.Collections.Generic.IEnumerable reservedInstanceAvsNodes = null, System.Collections.Generic.IEnumerable reservedInstanceSupportedLocations = null, System.Collections.Generic.IEnumerable reservedInstanceSupportedCurrencies = null, System.Collections.Generic.IEnumerable reservedInstanceSupportedOffers = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentDisk MigrationAssessmentDisk(double? gigabytesAllocated = default(double?), string displayName = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentError MigrationAssessmentError(int? id = default(int?), string code = null, string runAsAccountId = null, string applianceName = null, string message = null, string summaryMessage = null, string agentScenario = null, string possibleCauses = null, string recommendedAction = null, string severity = null, System.Collections.Generic.IReadOnlyDictionary messageParameters = null, System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), string impactedAssessmentType = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupData MigrationAssessmentGroupData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? provisioningState = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus? groupStatus = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus?), int? machineCount = default(int?), System.Collections.Generic.IEnumerable assessments = null, System.Collections.Generic.IEnumerable supportedAssessmentTypes = null, bool? areAssessmentsRunning = default(bool?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType? groupType = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorData MigrationAssessmentHyperVCollectorData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? provisioningState = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState?), Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentPropertiesBase agentProperties = null, string discoverySiteId = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorData MigrationAssessmentImportCollectorData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? provisioningState = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState?), string discoverySiteId = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentMachineData MigrationAssessmentMachineData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migration.Assessment.Models.WorkloadSummary workloadSummary = null, System.Collections.Generic.IEnumerable errors = null, Azure.ResourceManager.Migration.Assessment.Models.ProcessorInfo hostProcessor = null, Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus productSupportStatus = null, Azure.Core.ResourceIdentifier discoveryMachineArmId = null, Azure.Core.ResourceIdentifier datacenterManagementServerArmId = null, string datacenterManagementServerName = null, Azure.ResourceManager.Migration.Assessment.Models.MachineBootType? bootType = default(Azure.ResourceManager.Migration.Assessment.Models.MachineBootType?), string displayName = null, double? megabytesOfMemory = default(double?), int? numberOfCores = default(int?), string operatingSystemType = null, string operatingSystemName = null, string operatingSystemVersion = null, string description = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.Collections.Generic.IReadOnlyDictionary disks = null, System.Collections.Generic.IEnumerable groups = null, System.Collections.Generic.IReadOnlyDictionary networkAdapters = null, System.Collections.Generic.IEnumerable sqlInstances = null, System.Collections.Generic.IEnumerable webApplications = null, System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentNetworkAdapter MigrationAssessmentNetworkAdapter(string macAddress = null, System.Collections.Generic.IEnumerable ipAddresses = null, string displayName = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionData MigrationAssessmentPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable groupIds = null, Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateLinkResourceData MigrationAssessmentPrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorData MigrationAssessmentServerCollectorData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? provisioningState = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState?), Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentPropertiesBase agentProperties = null, string discoverySiteId = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentOptionData MigrationAssessmentSqlAssessmentOptionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable vmFamilies = null, System.Collections.Generic.IEnumerable reservedInstanceVmFamilies = null, System.Collections.Generic.IEnumerable premiumDiskVmFamilies = null, System.Collections.Generic.IEnumerable savingsPlanVmFamilies = null, System.Collections.Generic.IEnumerable savingsPlanSupportedLocations = null, System.Collections.Generic.IEnumerable savingsPlanSupportedLocationsForPaas = null, System.Collections.Generic.IEnumerable reservedInstanceSupportedLocationsForIaas = null, System.Collections.Generic.IEnumerable savingsPlanSupportedOffers = null, System.Collections.Generic.IEnumerable sqlSkus = null, System.Collections.Generic.IEnumerable reservedInstanceSqlTargets = null, System.Collections.Generic.IEnumerable reservedInstanceSupportedLocations = null, System.Collections.Generic.IEnumerable reservedInstanceSupportedCurrencies = null, System.Collections.Generic.IEnumerable reservedInstanceSupportedOffers = null, System.Collections.Generic.IEnumerable supportedOffers = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Data MigrationAssessmentSqlAssessmentV2Data(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? provisioningState = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentOSLicense? osLicense = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentOSLicense?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentEnvironmentType? environmentType = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentEnvironmentType?), Azure.ResourceManager.Migration.Assessment.Models.EntityUptime entityUptime = null, Azure.ResourceManager.Migration.Assessment.Models.SqlOptimizationLogic? optimizationLogic = default(Azure.ResourceManager.Migration.Assessment.Models.SqlOptimizationLogic?), Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance? reservedInstanceForVm = default(Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance?), Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode? azureOfferCodeForVm = default(Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode?), string eaSubscriptionId = null, Azure.ResourceManager.Migration.Assessment.Models.SqlMISettings azureSqlManagedInstanceSettings = null, Azure.ResourceManager.Migration.Assessment.Models.SqlDBSettings azureSqlDatabaseSettings = null, System.Collections.Generic.IEnumerable azureSqlVmInstanceSeries = null, Azure.ResourceManager.Migration.Assessment.Models.MultiSubnetIntent? multiSubnetIntent = default(Azure.ResourceManager.Migration.Assessment.Models.MultiSubnetIntent?), Azure.ResourceManager.Migration.Assessment.Models.AsyncCommitModeIntent? asyncCommitModeIntent = default(Azure.ResourceManager.Migration.Assessment.Models.AsyncCommitModeIntent?), bool? isInternetAccessAvailable = default(bool?), Azure.Core.AzureLocation? disasterRecoveryLocation = default(Azure.Core.AzureLocation?), bool? enableHadrAssessment = default(bool?), Azure.ResourceManager.Migration.Assessment.Models.AzureSecurityOfferingType? azureSecurityOfferingType = default(Azure.ResourceManager.Migration.Assessment.Models.AzureSecurityOfferingType?), Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance? reservedInstance = default(Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance?), Azure.ResourceManager.Migration.Assessment.Models.SqlServerLicense? sqlServerLicense = default(Azure.ResourceManager.Migration.Assessment.Models.SqlServerLicense?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType? groupType = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentType? assessmentType = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentType?), Azure.Core.AzureLocation? azureLocation = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode? azureOfferCode = default(Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode?), Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency? currency = default(Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency?), double? scalingFactor = default(double?), Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization? percentile = default(Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange? timeRange = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange?), System.DateTimeOffset? perfDataStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? perfDataEndOn = default(System.DateTimeOffset?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage? stage = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage?), double? discountPercentage = default(double?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? sizingCriterion = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion?), double? confidenceRatingInPercentage = default(double?), System.DateTimeOffset? pricesQueriedOn = default(System.DateTimeOffset?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus? status = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus?), string schemaVersion = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2SummaryData MigrationAssessmentSqlAssessmentV2SummaryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IReadOnlyDictionary assessmentSummary = null, System.Collections.Generic.IReadOnlyDictionary distributionBySupportStatus = null, System.Collections.Generic.IReadOnlyDictionary distributionByServicePackInsight = null, System.Collections.Generic.IReadOnlyDictionary distributionBySqlVersion = null, System.Collections.Generic.IReadOnlyDictionary distributionBySqlEdition = null, System.Collections.Generic.IReadOnlyDictionary instanceDistributionBySizingCriterion = null, System.Collections.Generic.IReadOnlyDictionary databaseDistributionBySizingCriterion = null, int? numberOfMachines = default(int?), int? numberOfSqlInstances = default(int?), int? numberOfSuccessfullyDiscoveredSqlInstances = default(int?), int? numberOfSqlDatabases = default(int?), int? numberOfFciInstances = default(int?), int? numberOfSqlAvailabilityGroups = default(int?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorData MigrationAssessmentSqlCollectorData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? provisioningState = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState?), Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentPropertiesBase agentProperties = null, string discoverySiteId = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorData MigrationAssessmentVMwareCollectorData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? provisioningState = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState?), Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentPropertiesBase agentProperties = null, string discoverySiteId = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationGuidelineContext MigrationGuidelineContext(string contextKey = null, string contextValue = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus ProductSupportStatus(string currentVersion = null, string servicePackStatus = null, string esuStatus = null, string supportStatus = null, int? eta = default(int?), string currentEsuYear = null, System.DateTimeOffset? mainstreamEndOn = default(System.DateTimeOffset?), System.DateTimeOffset? extendedSupportEndOn = default(System.DateTimeOffset?), System.DateTimeOffset? extendedSecurityUpdateYear1EndOn = default(System.DateTimeOffset?), System.DateTimeOffset? extendedSecurityUpdateYear2EndOn = default(System.DateTimeOffset?), System.DateTimeOffset? extendedSecurityUpdateYear3EndOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SharedResourcesDto SharedResourcesDto(System.Collections.Generic.IEnumerable sharedDataDisks = null, System.Collections.Generic.IEnumerable sharedLogDisks = null, System.Collections.Generic.IEnumerable sharedTempDBDisks = null, int? numberOfMounts = default(int?), Azure.ResourceManager.Migration.Assessment.Models.AzureQuorumWitnessDtoQuorumWitnessType? quorumWitnessType = default(Azure.ResourceManager.Migration.Assessment.Models.AzureQuorumWitnessDtoQuorumWitnessType?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlAssessedNetworkAdapter SqlAssessedNetworkAdapter(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? suitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?), Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail? suitabilityDetail = default(Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail?), Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation? suitabilityExplanation = default(Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation?), double? monthlyBandwidthCosts = default(double?), double? netGigabytesTransmittedPerMonth = default(double?), string name = null, string displayName = null, string macAddress = null, System.Collections.Generic.IEnumerable ipAddresses = null, double? megabytesPerSecondReceived = default(double?), double? megabytesPerSecondTransmitted = default(double?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssue SqlAssessmentMigrationIssue(string issueId = null, Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssueCategory? issueCategory = default(Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssueCategory?), System.Collections.Generic.IEnumerable impactedObjects = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2IaasSuitabilityDetails SqlAssessmentV2IaasSuitabilityDetails(Azure.ResourceManager.Migration.Assessment.Models.AzureSqlIaasSkuDto azureSqlSku = null, System.Collections.Generic.IEnumerable replicaAzureSqlSku = null, Azure.ResourceManager.Migration.Assessment.Models.SharedResourcesDto sharedResources = null, double? monthlyComputeCost = default(double?), double? monthlyStorageCost = default(double?), System.Collections.Generic.IEnumerable costComponents = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? securitySuitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?), bool? shouldProvisionReplicas = default(bool?), Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode? skuReplicationMode = default(Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode?), System.Collections.Generic.IEnumerable migrationGuidelines = null, System.Collections.Generic.IEnumerable recommendationReasonings = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? migrationTargetPlatform = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? suitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?), System.Collections.Generic.IEnumerable migrationIssues = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails SqlAssessmentV2PaasSuitabilityDetails(Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPaasSkuDto azureSqlSku = null, System.Collections.Generic.IEnumerable replicaAzureSqlSku = null, Azure.ResourceManager.Migration.Assessment.Models.SharedResourcesDto sharedResources = null, double? monthlyComputeCost = default(double?), double? monthlyStorageCost = default(double?), System.Collections.Generic.IEnumerable costComponents = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? securitySuitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?), bool? shouldProvisionReplicas = default(bool?), Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode? skuReplicationMode = default(Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode?), System.Collections.Generic.IEnumerable migrationGuidelines = null, System.Collections.Generic.IEnumerable recommendationReasonings = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? migrationTargetPlatform = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? suitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?), System.Collections.Generic.IEnumerable migrationIssues = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2SummaryDetails SqlAssessmentV2SummaryDetails(System.Collections.Generic.IReadOnlyDictionary suitabilitySummary = null, double? monthlyComputeCost = default(double?), double? monthlyStorageCost = default(double?), double? monthlyLicenseCost = default(double?), double? confidenceScore = default(double?), double? monthlySecurityCost = default(double?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlAvailabilityGroupDataOverview SqlAvailabilityGroupDataOverview(string availabilityGroupId = null, string availabilityGroupName = null, Azure.Core.ResourceIdentifier sqlAvailabilityGroupSdsArmId = null, string sqlAvailabilityGroupEntityId = null, string sqlAvailabilityReplicaId = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlAvailabilityReplicaSummary SqlAvailabilityReplicaSummary(int? numberOfSynchronousReadReplicas = default(int?), int? numberOfSynchronousNonReadReplicas = default(int?), int? numberOfAsynchronousReadReplicas = default(int?), int? numberOfAsynchronousNonReadReplicas = default(int?), int? numberOfPrimaryReplicas = default(int?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadata SqlFciMetadata(Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState? state = default(Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState?), bool? isMultiSubnet = default(bool?), int? fciSharedDiskCount = default(int?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuideline SqlMigrationGuideline(string guidelineId = null, Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuidelineCategory? migrationGuidelineCategory = default(Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuidelineCategory?), System.Collections.Generic.IEnumerable migrationGuidelineContext = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlRecommendationReasoning SqlRecommendationReasoning(string reasoningId = null, string reasoningString = null, string reasoningCategory = null, System.Collections.Generic.IEnumerable contextParameters = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlRecommendationReasoningContext SqlRecommendationReasoningContext(string contextKey = null, string contextValue = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.UltraDiskAssessmentConfig UltraDiskAssessmentConfig(string familyName = null, System.Collections.Generic.IEnumerable targetLocations = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.VmFamilyConfig VmFamilyConfig(string familyName = null, System.Collections.Generic.IEnumerable targetLocations = null, System.Collections.Generic.IEnumerable category = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.WorkloadSummary WorkloadSummary(int? oracleInstances = default(int?), int? springApps = default(int?)) { throw null; } + } + public partial class AssessedDataDisk : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssessedDataDisk() { } + public string DisplayName { get { throw null; } } + public double? GigabytesProvisioned { get { throw null; } } + public double? MegabytesPerSecondOfRead { get { throw null; } } + public double? MegabytesPerSecondOfWrite { get { throw null; } } + public double? MonthlyStorageCost { get { throw null; } } + public string Name { get { throw null; } } + public double? NumberOfReadOperationsPerSecond { get { throw null; } } + public double? NumberOfWriteOperationsPerSecond { get { throw null; } } + public double? RecommendDiskThroughputInMbps { get { throw null; } } + public double? RecommendedDiskIops { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize? RecommendedDiskSize { get { throw null; } } + public int? RecommendedDiskSizeGigabytes { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType? RecommendedDiskType { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? Suitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail? SuitabilityDetail { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation? SuitabilityExplanation { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedDataDisk System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedDataDisk System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedDisk : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssessedDisk() { } + public string DisplayName { get { throw null; } } + public int? GigabytesForRecommendedDiskSize { get { throw null; } } + public double? GigabytesProvisioned { get { throw null; } } + public double? MegabytesPerSecondOfRead { get { throw null; } } + public double? MegabytesPerSecondOfWrite { get { throw null; } } + public double? MonthlyStorageCost { get { throw null; } } + public string Name { get { throw null; } } + public double? NumberOfReadOperationsPerSecond { get { throw null; } } + public double? NumberOfWriteOperationsPerSecond { get { throw null; } } + public double? RecommendDiskThroughputInMbps { get { throw null; } } + public double? RecommendedDiskIops { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize? RecommendedDiskSize { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType? RecommendedDiskType { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? Suitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail? SuitabilityDetail { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation? SuitabilityExplanation { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedDisk System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedDisk System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AssessedMachineType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AssessedMachineType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType AssessedMachine { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType AvsAssessedMachine { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType SqlAssessedMachine { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType 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.Migration.Assessment.Models.AssessedMachineType left, Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType left, Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AssessedNetworkAdapter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssessedNetworkAdapter() { } + public string DisplayName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList IPAddresses { get { throw null; } } + public string MacAddress { get { throw null; } } + public double? MegabytesPerSecondReceived { get { throw null; } } + public double? MegabytesPerSecondTransmitted { get { throw null; } } + public double? MonthlyBandwidthCosts { get { throw null; } } + public double? NetGigabytesTransmittedPerMonth { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? Suitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail? SuitabilityDetail { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation? SuitabilityExplanation { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedNetworkAdapter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedNetworkAdapter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedSqlInstanceDatabaseSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssessedSqlInstanceDatabaseSummary() { } + public double? LargestDatabaseSizeInMB { get { throw null; } } + public int? NumberOfUserDatabases { get { throw null; } } + public double? TotalDatabaseSizeInMB { get { throw null; } } + public int? TotalDiscoveredUserDatabases { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceDatabaseSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceDatabaseSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedSqlInstanceDiskDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssessedSqlInstanceDiskDetails() { } + public string DiskId { get { throw null; } } + public double? DiskSizeInMB { get { throw null; } } + public double? MegabytesPerSecondOfRead { get { throw null; } } + public double? MegabytesPerSecondOfWrite { get { throw null; } } + public double? NumberOfReadOperationsPerSecond { get { throw null; } } + public double? NumberOfWriteOperationsPerSecond { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceDiskDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceDiskDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedSqlInstanceStorageDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssessedSqlInstanceStorageDetails() { } + public double? DiskSizeInMB { get { throw null; } } + public double? MegabytesPerSecondOfRead { get { throw null; } } + public double? MegabytesPerSecondOfWrite { get { throw null; } } + public double? NumberOfReadOperationsPerSecond { get { throw null; } } + public double? NumberOfWriteOperationsPerSecond { get { throw null; } } + public string StorageType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceStorageDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceStorageDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedSqlInstanceSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssessedSqlInstanceSummary() { } + public string InstanceId { get { throw null; } } + public string InstanceName { get { throw null; } } + public bool? IsClustered { get { throw null; } } + public bool? IsHighAvailabilityEnabled { get { throw null; } } + public string SqlEdition { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlFciState? SqlFciState { get { throw null; } } + public string SqlInstanceEntityId { get { throw null; } } + public Azure.Core.ResourceIdentifier SqlInstanceSdsArmId { get { throw null; } } + public string SqlVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AssessmentEnvironmentType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AssessmentEnvironmentType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentEnvironmentType Production { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentEnvironmentType Test { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AssessmentEnvironmentType 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.Migration.Assessment.Models.AssessmentEnvironmentType left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentEnvironmentType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AssessmentEnvironmentType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AssessmentEnvironmentType left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentEnvironmentType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AssessmentErrorSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssessmentErrorSummary() { } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentType? AssessmentType { get { throw null; } } + public int? Count { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessmentErrorSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessmentErrorSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AssessmentProjectStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AssessmentProjectStatus(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentProjectStatus Active { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentProjectStatus Inactive { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AssessmentProjectStatus 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.Migration.Assessment.Models.AssessmentProjectStatus left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentProjectStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AssessmentProjectStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AssessmentProjectStatus left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentProjectStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AssessmentReportDownloadUri : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssessmentReportDownloadUri() { } + public System.Uri AssessmentReportUri { get { throw null; } } + public System.DateTimeOffset ExpireOn { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessmentReportDownloadUri System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessmentReportDownloadUri System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AssessmentSizingCriterion : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AssessmentSizingCriterion(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion AsOnPremises { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion PerformanceBased { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion 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.Migration.Assessment.Models.AssessmentSizingCriterion left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AssessmentStage : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AssessmentStage(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage Approved { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage InProgress { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage UnderReview { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage 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.Migration.Assessment.Models.AssessmentStage left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AssessmentStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AssessmentStatus(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus Completed { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus Created { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus Deleted { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus Invalid { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus OutDated { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus OutOfSync { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus Running { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus Updated { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus 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.Migration.Assessment.Models.AssessmentStatus left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AssessmentTimeRange : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AssessmentTimeRange(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange Custom { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange Day { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange Month { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange Week { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange 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.Migration.Assessment.Models.AssessmentTimeRange left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AssessmentType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AssessmentType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentType AvsAssessment { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentType MachineAssessment { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentType SqlAssessment { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentType Unknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentType WebAppAssessment { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AssessmentType 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.Migration.Assessment.Models.AssessmentType left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AssessmentType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AssessmentType left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AsyncCommitModeIntent : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AsyncCommitModeIntent(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AsyncCommitModeIntent DisasterRecovery { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AsyncCommitModeIntent HighAvailability { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AsyncCommitModeIntent None { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AsyncCommitModeIntent 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.Migration.Assessment.Models.AsyncCommitModeIntent left, Azure.ResourceManager.Migration.Assessment.Models.AsyncCommitModeIntent right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AsyncCommitModeIntent (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AsyncCommitModeIntent left, Azure.ResourceManager.Migration.Assessment.Models.AsyncCommitModeIntent right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AvsAssessedDisk : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvsAssessedDisk() { } + public string DisplayName { get { throw null; } } + public double? GigabytesProvisioned { get { throw null; } } + public double? MegabytesPerSecondOfRead { get { throw null; } } + public double? MegabytesPerSecondOfWrite { get { throw null; } } + public string Name { get { throw null; } } + public double? NumberOfReadOperationsPerSecond { get { throw null; } } + public double? NumberOfWriteOperationsPerSecond { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AvsAssessedDisk System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AvsAssessedDisk System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsAssessedNetworkAdapter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvsAssessedNetworkAdapter() { } + public string DisplayName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList IPAddresses { get { throw null; } } + public string MacAddress { get { throw null; } } + public double? MegabytesPerSecondReceived { get { throw null; } } + public double? MegabytesPerSecondTransmitted { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AvsAssessedNetworkAdapter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AvsAssessedNetworkAdapter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AvsNodeType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AvsNodeType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsNodeType AV36 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsNodeType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AvsNodeType 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.Migration.Assessment.Models.AvsNodeType left, Azure.ResourceManager.Migration.Assessment.Models.AvsNodeType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AvsNodeType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AvsNodeType left, Azure.ResourceManager.Migration.Assessment.Models.AvsNodeType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AvsSkuConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AvsSkuConfig() { } + public Azure.ResourceManager.Migration.Assessment.Models.AvsNodeType? NodeType { get { throw null; } set { } } + public System.Collections.Generic.IList TargetLocations { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AvsSkuConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AvsSkuConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AvsSuitabilityExplanation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AvsSuitabilityExplanation(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsSuitabilityExplanation NotApplicable { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsSuitabilityExplanation Unknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsSuitabilityExplanation UnsupportedLocationForSelectedNode { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AvsSuitabilityExplanation 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.Migration.Assessment.Models.AvsSuitabilityExplanation left, Azure.ResourceManager.Migration.Assessment.Models.AvsSuitabilityExplanation right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AvsSuitabilityExplanation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AvsSuitabilityExplanation left, Azure.ResourceManager.Migration.Assessment.Models.AvsSuitabilityExplanation right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AvsVmSuitabilityDetail : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AvsVmSuitabilityDetail(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail None { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail PercentageOfCoresUtilizedMissing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail PercentageOfCoresUtilizedOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail PercentageOfMemoryUtilizedMissing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail PercentageOfMemoryUtilizedOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail PercentageOfStorageUtilizedOutOfRange { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail 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.Migration.Assessment.Models.AvsVmSuitabilityDetail left, Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail left, Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AvsVmSuitabilityExplanation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AvsVmSuitabilityExplanation(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityExplanation IPV6NotSupported { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityExplanation NotApplicable { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityExplanation Unknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityExplanation UnsupportedOperatingSystem { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityExplanation 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.Migration.Assessment.Models.AvsVmSuitabilityExplanation left, Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityExplanation right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityExplanation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityExplanation left, Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityExplanation right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureCurrency : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureCurrency(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency ARS { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency AUD { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency BRL { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency CAD { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency CHF { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency CNY { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency DKK { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency EUR { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency GBP { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency HKD { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency IdR { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency INR { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency JPY { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency KRW { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency MXN { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency MYR { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency NOK { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency NZD { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency RUB { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency SAR { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency SEK { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency TRY { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency TWD { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency Unknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency USD { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency ZAR { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency 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.Migration.Assessment.Models.AzureCurrency left, Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency left, Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureDiskSize : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureDiskSize(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP1 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP10 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP15 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP20 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP30 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP40 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP50 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP6 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP60 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP70 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP80 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardS10 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardS15 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardS20 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardS30 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardS4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardS40 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardS50 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardS6 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardS60 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardS70 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardS80 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE1 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE10 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE15 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE20 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE30 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE40 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE50 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE6 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE60 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE70 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE80 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize Ultra { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize 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.Migration.Assessment.Models.AzureDiskSize left, Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize left, Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureDiskSuitabilityDetail : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureDiskSuitabilityDetail(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail DiskGigabytesConsumedMissing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail DiskGigabytesConsumedOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail DiskGigabytesProvisionedMissing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail DiskGigabytesProvisionedOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail MegabytesPerSecondOfReadMissing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail MegabytesPerSecondOfReadOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail MegabytesPerSecondOfWriteMissing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail MegabytesPerSecondOfWriteOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail None { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail NumberOfReadOperationsPerSecondMissing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail NumberOfReadOperationsPerSecondOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail NumberOfWriteOperationsPerSecondMissing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail NumberOfWriteOperationsPerSecondOutOfRange { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail 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.Migration.Assessment.Models.AzureDiskSuitabilityDetail left, Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail left, Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureDiskSuitabilityExplanation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureDiskSuitabilityExplanation(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation DiskSizeGreaterThanSupported { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation InternalErrorOccurredForDiskEvaluation { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation NoDiskSizeFoundForSelectedRedundancy { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation NoDiskSizeFoundInSelectedLocation { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation NoEAPriceFoundForDiskSize { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation NoSuitableDiskSizeForIops { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation NoSuitableDiskSizeForThroughput { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation NotApplicable { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation 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.Migration.Assessment.Models.AzureDiskSuitabilityExplanation left, Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation left, Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureDiskType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureDiskType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType Premium { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType PremiumV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType Standard { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType StandardOrPremium { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType StandardSsd { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType Ultra { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType 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.Migration.Assessment.Models.AzureDiskType left, Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType left, Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureHybridUseBenefit : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureHybridUseBenefit(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureHybridUseBenefit No { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureHybridUseBenefit Unknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureHybridUseBenefit Yes { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureHybridUseBenefit 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.Migration.Assessment.Models.AzureHybridUseBenefit left, Azure.ResourceManager.Migration.Assessment.Models.AzureHybridUseBenefit right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureHybridUseBenefit (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureHybridUseBenefit left, Azure.ResourceManager.Migration.Assessment.Models.AzureHybridUseBenefit right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AzureManagedDiskSkuDto : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AzureManagedDiskSkuDto() { } + public Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskRedundancy? DiskRedundancy { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize? DiskSize { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType? DiskType { get { throw null; } } + public double? RecommendedIops { get { throw null; } } + public double? RecommendedSizeInGib { get { throw null; } } + public double? RecommendedThroughputInMbps { get { throw null; } } + public double? StorageCost { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDto System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDto System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureManagedDiskSkuDtoDiskRedundancy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureManagedDiskSkuDtoDiskRedundancy(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskRedundancy Lrs { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskRedundancy Unknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskRedundancy Zrs { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskRedundancy 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.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskRedundancy left, Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskRedundancy right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskRedundancy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskRedundancy left, Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskRedundancy right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureManagedDiskSkuDtoDiskType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureManagedDiskSkuDtoDiskType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType Premium { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType PremiumV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType Standard { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType StandardOrPremium { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType StandardSsd { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType Ultra { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType 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.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType left, Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType left, Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureNetworkAdapterSuitabilityDetail : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureNetworkAdapterSuitabilityDetail(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail MegabytesOfDataRecievedMissing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail MegabytesOfDataRecievedOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail MegabytesOfDataTransmittedMissing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail MegabytesOfDataTransmittedOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail None { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail 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.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail left, Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail left, Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureNetworkAdapterSuitabilityExplanation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureNetworkAdapterSuitabilityExplanation(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation InternalErrorOccurred { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation NotApplicable { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation 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.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation left, Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation left, Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureOfferCode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureOfferCode(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode EA { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0003P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0022P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0023P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0025P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0029P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0036P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0044P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0059P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0060P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0062P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0063P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0064P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0111P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0120P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0121P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0122P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0123P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0124P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0125P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0126P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0127P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0128P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0129P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0130P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0144P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0148P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0149P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0243P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZRDE0003P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZRDE0044P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZRUSGOV0003P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSMCAZR0044P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSMCAZR0059P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSMCAZR0060P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSMCAZR0063P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSMCAZR0120P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSMCAZR0121P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSMCAZR0125P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSMCAZR0128P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode SavingsPlan1Year { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode SavingsPlan3Year { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode 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.Migration.Assessment.Models.AzureOfferCode left, Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode left, Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzurePricingTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzurePricingTier(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzurePricingTier Basic { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzurePricingTier Standard { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzurePricingTier 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.Migration.Assessment.Models.AzurePricingTier left, Azure.ResourceManager.Migration.Assessment.Models.AzurePricingTier right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzurePricingTier (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzurePricingTier left, Azure.ResourceManager.Migration.Assessment.Models.AzurePricingTier right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureQuorumWitnessDtoQuorumWitnessType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureQuorumWitnessDtoQuorumWitnessType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureQuorumWitnessDtoQuorumWitnessType Cloud { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureQuorumWitnessDtoQuorumWitnessType Disk { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureQuorumWitnessDtoQuorumWitnessType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureQuorumWitnessDtoQuorumWitnessType 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.Migration.Assessment.Models.AzureQuorumWitnessDtoQuorumWitnessType left, Azure.ResourceManager.Migration.Assessment.Models.AzureQuorumWitnessDtoQuorumWitnessType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureQuorumWitnessDtoQuorumWitnessType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureQuorumWitnessDtoQuorumWitnessType left, Azure.ResourceManager.Migration.Assessment.Models.AzureQuorumWitnessDtoQuorumWitnessType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureReservedInstance : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureReservedInstance(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance None { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance RI1Year { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance RI3Year { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance 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.Migration.Assessment.Models.AzureReservedInstance left, Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance left, Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureSecurityOfferingType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureSecurityOfferingType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSecurityOfferingType MDC { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSecurityOfferingType NO { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureSecurityOfferingType 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.Migration.Assessment.Models.AzureSecurityOfferingType left, Azure.ResourceManager.Migration.Assessment.Models.AzureSecurityOfferingType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureSecurityOfferingType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureSecurityOfferingType left, Azure.ResourceManager.Migration.Assessment.Models.AzureSecurityOfferingType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureSqlDataBaseType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureSqlDataBaseType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlDataBaseType Automatic { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlDataBaseType ElasticPool { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlDataBaseType SingleDatabase { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlDataBaseType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureSqlDataBaseType 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.Migration.Assessment.Models.AzureSqlDataBaseType left, Azure.ResourceManager.Migration.Assessment.Models.AzureSqlDataBaseType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureSqlDataBaseType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureSqlDataBaseType left, Azure.ResourceManager.Migration.Assessment.Models.AzureSqlDataBaseType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AzureSqlIaasSkuDto : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AzureSqlIaasSkuDto() { } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? AzureSqlTargetType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList DataDiskSizes { get { throw null; } } + public System.Collections.Generic.IReadOnlyList LogDiskSizes { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureVmSkuDto VirtualMachineSize { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AzureSqlIaasSkuDto System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AzureSqlIaasSkuDto System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureSqlInstanceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureSqlInstanceType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlInstanceType Automatic { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlInstanceType InstancePools { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlInstanceType SingleInstance { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlInstanceType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureSqlInstanceType 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.Migration.Assessment.Models.AzureSqlInstanceType left, Azure.ResourceManager.Migration.Assessment.Models.AzureSqlInstanceType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureSqlInstanceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureSqlInstanceType left, Azure.ResourceManager.Migration.Assessment.Models.AzureSqlInstanceType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AzureSqlPaasSkuDto : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AzureSqlPaasSkuDto() { } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier? AzureSqlComputeTier { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration? AzureSqlHardwareGeneration { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier? AzureSqlServiceTier { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? AzureSqlTargetType { get { throw null; } } + public int? Cores { get { throw null; } } + public double? PredictedDataSizeInMB { get { throw null; } } + public double? PredictedLogSizeInMB { get { throw null; } } + public double? StorageMaxSizeInMB { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPaasSkuDto System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPaasSkuDto System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureSqlPurchaseModel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureSqlPurchaseModel(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPurchaseModel Dtu { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPurchaseModel Unknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPurchaseModel VCore { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPurchaseModel 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.Migration.Assessment.Models.AzureSqlPurchaseModel left, Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPurchaseModel right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPurchaseModel (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPurchaseModel left, Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPurchaseModel right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureSqlServiceTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureSqlServiceTier(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier Automatic { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier BusinessCritical { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier GeneralPurpose { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier HyperScale { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier 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.Migration.Assessment.Models.AzureSqlServiceTier left, Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier left, Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureStorageRedundancy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureStorageRedundancy(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy GeoRedundant { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy LocallyRedundant { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy ReadAccessGeoRedundant { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy Unknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy ZoneRedundant { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy 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.Migration.Assessment.Models.AzureStorageRedundancy left, Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy left, Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureVmFamily : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureVmFamily(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Av2Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily BasicA0A4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Dadsv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Dasv4Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Dasv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Dav4Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily DCSeries { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Ddsv4Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Ddsv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Ddv4Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Ddv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily DSeries { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily DSSeries { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily DSv2Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Dsv3Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Dsv4Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Dsv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Dv2Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Dv3Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Dv4Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Dv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Eadsv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Easv4Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Easv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Eav4Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Ebdsv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Ebsv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Edsv4Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Edsv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Edv4Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Edv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Esv3Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Esv4Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Esv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Ev3Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Ev4Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Ev5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily FSeries { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily FsSeries { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Fsv2Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily GSeries { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily GSSeries { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily HSeries { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily LsSeries { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Lsv2Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Mdsv2Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily MSeries { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Msv2Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Mv2Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily StandardA0A7 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily StandardA8A11 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily 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.Migration.Assessment.Models.AzureVmFamily left, Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily left, Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureVmSize : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureVmSize(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize BasicA0 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize BasicA1 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize BasicA2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize BasicA3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize BasicA4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA0 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA1 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA10 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA11 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA1V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA2MV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA2V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA4MV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA4V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA6 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA7 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA8 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA8MV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA8V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA9 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD1 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD11 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD11V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD12 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD12V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD13 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD13V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD14 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD14V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD15V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD1V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD3V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD48AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD48AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD48AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD48AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD48DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD48DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD48DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD48DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD48SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD48SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD48V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD48V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD5V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD96AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD96AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD96AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD96AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD96DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD96DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD96SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD96V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDC2S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDC4S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS1 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS11 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS111V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS11V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS12 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS121V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS122V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS12V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS13 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS132V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS134V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS13V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS14 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS144V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS148V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS14V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS15V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS1V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS2V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS3V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS4V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS5V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE104IdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE104IdV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE104IsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE104IV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE164AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE164AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE164AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE164DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE164DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE164SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE164SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE164SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE168AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE168AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE168AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE168DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE168DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE168SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE168SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE168SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16BdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16BsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2BdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2BsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE3216AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE3216AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE3216AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE3216DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE3216DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE3216SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE3216SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE3216SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE328AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE328AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE328AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE328DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE328DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE328SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE328SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE328SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32BdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32BsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE42AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE42AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE42AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE42DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE42DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE42SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE42SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE42SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48BdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48BsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4BdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4BsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6416AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6416AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6416AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6416DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6416DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6416SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6416SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6416SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6432AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6432AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6432AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6432DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6432DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6432SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6432SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6432SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64BdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64BsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64IsV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64IV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE80IdsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE80IsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE82AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE82AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE82AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE82DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE82DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE82SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE82SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE82SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE84AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE84AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE84AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE84DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE84DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE84SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE84SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE84SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8BdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8BsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE9624AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE9624AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE9624AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE9624DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE9624SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE9648AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE9648AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE9648AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE9648DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE9648SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE96AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE96AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE96AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE96AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE96DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE96DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE96SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE96V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF1 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF16 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF16S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF16SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF1S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF2S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF2SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF32SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF48SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF4S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF4SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF64SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF72SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF8 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF8S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF8SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardG1 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardG2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardG3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardG4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardG5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardGS1 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardGS2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardGS3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardGS4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardGS44 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardGS48 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardGS5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardGS516 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardGS58 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardH16 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardH16M { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardH16Mr { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardH16R { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardH8 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardH8M { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardL16S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardL16SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardL32S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardL32SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardL48SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardL4S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardL64SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardL80SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardL8S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardL8SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM128 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM12832Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM12864Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM128DmsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM128DsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM128M { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM128Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM128MsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM128S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM128SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM164Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM168Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM16Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM192IdmsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM192IdsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM192ImsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM192IsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM208MsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM208SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM3216Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM328Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM32DmsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM32Ls { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM32Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM32MsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM32Ts { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM416208MsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM416208SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM416MsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM416SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM64 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM6416Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM6432Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM64DmsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM64DsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM64Ls { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM64M { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM64Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM64MsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM64S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM64SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM82Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM84Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM8Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize 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.Migration.Assessment.Models.AzureVmSize left, Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize left, Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AzureVmSkuDto : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AzureVmSkuDto() { } + public int? AvailableCores { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize? AzureSkuName { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily? AzureVmFamily { get { throw null; } } + public int? Cores { get { throw null; } } + public int? MaxNetworkInterfaces { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AzureVmSkuDto System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AzureVmSkuDto System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureVmSuitabilityDetail : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureVmSuitabilityDetail(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail CannotReportBandwidthCosts { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail CannotReportComputeCost { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail CannotReportStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail None { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail PercentageOfCoresUtilizedMissing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail PercentageOfCoresUtilizedOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail PercentageOfMemoryUtilizedMissing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail PercentageOfMemoryUtilizedOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail RecommendedSizeHasLessNetworkAdapters { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail 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.Migration.Assessment.Models.AzureVmSuitabilityDetail left, Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail left, Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureVmSuitabilityExplanation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureVmSuitabilityExplanation(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation BootTypeNotSupported { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation BootTypeUnknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation CheckCentOSVersion { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation CheckCoreOSLinuxVersion { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation CheckDebianLinuxVersion { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation CheckOpenSuseLinuxVersion { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation CheckOracleLinuxVersion { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation CheckRedHatLinuxVersion { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation CheckSuseLinuxVersion { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation CheckUbuntuLinuxVersion { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation CheckWindowsServer2008R2Version { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation EndorsedWithConditionsLinuxDistributions { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation GuestOperatingSystemArchitectureNotSupported { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation GuestOperatingSystemNotSupported { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation GuestOperatingSystemUnknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation InternalErrorOccurredDuringComputeEvaluation { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation InternalErrorOccurredDuringNetworkEvaluation { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation InternalErrorOccurredDuringStorageEvaluation { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation MoreDisksThanSupported { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation NoEAPriceFoundForVmSize { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation NoGuestOperatingSystemConditionallySupported { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation NoSuitableVmSizeFound { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation NotApplicable { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation NoVmSizeForBasicPricingTier { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation NoVmSizeForSelectedAzureLocation { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation NoVmSizeForSelectedPricingTier { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation NoVmSizeForStandardPricingTier { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation NoVmSizeFoundForOfferCurrencyReservedInstance { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation NoVmSizeInSelectedFamilyFound { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation NoVmSizeSupportsNetworkPerformance { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation NoVmSizeSupportsStoragePerformance { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation OneOrMoreAdaptersNotSuitable { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation OneOrMoreDisksNotSuitable { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation UnendorsedLinuxDistributions { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation Unknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation WindowsClientVersionsConditionallySupported { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation WindowsOSNoLongerUnderMSSupport { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation WindowsServerVersionConditionallySupported { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation WindowsServerVersionsSupportedWithCaveat { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation 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.Migration.Assessment.Models.AzureVmSuitabilityExplanation left, Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation left, Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CollectorAgentPropertiesBase : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CollectorAgentPropertiesBase() { } + public string Id { get { throw null; } set { } } + public System.DateTimeOffset? LastHeartbeatOn { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentSpnPropertiesBase SpnDetails { get { throw null; } set { } } + public string Version { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentPropertiesBase System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentPropertiesBase System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CollectorAgentSpnPropertiesBase : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CollectorAgentSpnPropertiesBase() { } + public string ApplicationId { get { throw null; } set { } } + public string Audience { get { throw null; } set { } } + public string Authority { get { throw null; } set { } } + public string ObjectId { get { throw null; } set { } } + public System.Guid? TenantId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentSpnPropertiesBase System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentSpnPropertiesBase System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CompatibilityLevel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CompatibilityLevel(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel CompatLevel100 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel CompatLevel110 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel CompatLevel120 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel CompatLevel130 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel CompatLevel140 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel CompatLevel150 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel CompatLevel80 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel CompatLevel90 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel 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.Migration.Assessment.Models.CompatibilityLevel left, Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel left, Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CostComponent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CostComponent() { } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.CostComponentName? Name { get { throw null; } } + public double? Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.CostComponent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.CostComponent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CostComponentName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CostComponentName(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.CostComponentName MonthlyAzureHybridCostSavings { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.CostComponentName MonthlyPremiumV2StorageCost { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.CostComponentName MonthlySecurityCost { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.CostComponentName Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.CostComponentName 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.Migration.Assessment.Models.CostComponentName left, Azure.ResourceManager.Migration.Assessment.Models.CostComponentName right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.CostComponentName (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.CostComponentName left, Azure.ResourceManager.Migration.Assessment.Models.CostComponentName right) { throw null; } + public override string ToString() { throw null; } + } + public partial class EntityUptime : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EntityUptime() { } + public int? DaysPerMonth { get { throw null; } set { } } + public int? HoursPerDay { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.EntityUptime System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.EntityUptime System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FttAndRaidLevel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FttAndRaidLevel(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel Ftt1Raid1 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel Ftt1Raid5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel Ftt2Raid1 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel Ftt2Raid6 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel Ftt3Raid1 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel 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.Migration.Assessment.Models.FttAndRaidLevel left, Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel left, Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct GuestOperatingSystemArchitecture : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public GuestOperatingSystemArchitecture(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture Unknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture X64 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture X86 { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture 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.Migration.Assessment.Models.GuestOperatingSystemArchitecture left, Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture left, Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ImpactedAssessmentObject : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ImpactedAssessmentObject() { } + public string ObjectName { get { throw null; } } + public string ObjectType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.ImpactedAssessmentObject System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.ImpactedAssessmentObject System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MachineBootType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MachineBootType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MachineBootType Bios { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MachineBootType Efi { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MachineBootType NotSpecified { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MachineBootType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MachineBootType 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.Migration.Assessment.Models.MachineBootType left, Azure.ResourceManager.Migration.Assessment.Models.MachineBootType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MachineBootType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MachineBootType left, Azure.ResourceManager.Migration.Assessment.Models.MachineBootType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MigrateGroupUpdateContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrateGroupUpdateContent() { } + public Azure.ETag? ETag { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateProperties Properties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrateGroupUpdateOperationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrateGroupUpdateOperationType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateOperationType Add { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateOperationType Remove { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateOperationType 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.Migration.Assessment.Models.MigrateGroupUpdateOperationType left, Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateOperationType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateOperationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateOperationType left, Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateOperationType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MigrateGroupUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrateGroupUpdateProperties() { } + public System.Collections.Generic.IList Machines { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateOperationType? OperationType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAssessmentProjectPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentAssessmentProjectPatch() { } + public string AssessmentSolutionId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier CustomerStorageAccountArmId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier CustomerWorkspaceId { get { throw null; } set { } } + public string CustomerWorkspaceLocation { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentProjectStatus? ProjectStatus { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? ProvisioningState { get { throw null; } set { } } + public string PublicNetworkAccess { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentAssessmentProjectPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentAssessmentProjectPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationAssessmentCloudSuitability : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationAssessmentCloudSuitability(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability ConditionallySuitable { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability NotSuitable { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability ReadinessUnknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability Suitable { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability 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.Migration.Assessment.Models.MigrationAssessmentCloudSuitability left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationAssessmentComputeTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationAssessmentComputeTier(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier Automatic { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier Provisioned { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier Serverless { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier 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.Migration.Assessment.Models.MigrationAssessmentComputeTier left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MigrationAssessmentDisk : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MigrationAssessmentDisk() { } + public string DisplayName { get { throw null; } } + public double? GigabytesAllocated { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentDisk System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentDisk System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MigrationAssessmentError() { } + public string AgentScenario { get { throw null; } } + public string ApplianceName { get { throw null; } } + public string Code { get { throw null; } } + public int? Id { get { throw null; } } + public string ImpactedAssessmentType { get { throw null; } } + public string Message { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary MessageParameters { get { throw null; } } + public string PossibleCauses { get { throw null; } } + public string RecommendedAction { get { throw null; } } + public string RunAsAccountId { get { throw null; } } + public string Severity { get { throw null; } } + public string SummaryMessage { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationAssessmentGroupStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationAssessmentGroupStatus(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus Completed { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus Created { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus Invalid { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus Running { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus Updated { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus 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.Migration.Assessment.Models.MigrationAssessmentGroupStatus left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationAssessmentGroupType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationAssessmentGroupType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType Default { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType Import { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType 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.Migration.Assessment.Models.MigrationAssessmentGroupType left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationAssessmentHardwareGeneration : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationAssessmentHardwareGeneration(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration Automatic { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration DCSeries { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration Fsv2Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration Gen5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration MSeries { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration 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.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MigrationAssessmentNetworkAdapter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MigrationAssessmentNetworkAdapter() { } + public string DisplayName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList IPAddresses { get { throw null; } } + public string MacAddress { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentNetworkAdapter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentNetworkAdapter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationAssessmentOSLicense : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationAssessmentOSLicense(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentOSLicense No { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentOSLicense Unknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentOSLicense Yes { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentOSLicense 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.Migration.Assessment.Models.MigrationAssessmentOSLicense left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentOSLicense right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentOSLicense (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentOSLicense left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentOSLicense right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationAssessmentPrivateEndpointConnectionProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationAssessmentPrivateEndpointConnectionProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState 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.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationAssessmentPrivateEndpointServiceConnectionStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationAssessmentPrivateEndpointServiceConnectionStatus(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointServiceConnectionStatus Approved { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointServiceConnectionStatus Pending { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointServiceConnectionStatus Rejected { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointServiceConnectionStatus 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.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointServiceConnectionStatus left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointServiceConnectionStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointServiceConnectionStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointServiceConnectionStatus left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointServiceConnectionStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MigrationAssessmentPrivateLinkServiceConnectionState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentPrivateLinkServiceConnectionState() { } + public string ActionsRequired { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointServiceConnectionStatus? Status { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateLinkServiceConnectionState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateLinkServiceConnectionState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationAssessmentProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationAssessmentProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState 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.Migration.Assessment.Models.MigrationAssessmentProvisioningState left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationAssessmentTargetType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationAssessmentTargetType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType AzureSqlDatabase { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType AzureSqlManagedInstance { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType AzureSqlVirtualMachine { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType AzureVirtualMachine { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType Recommended { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType 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.Migration.Assessment.Models.MigrationAssessmentTargetType left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MigrationGuidelineContext : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MigrationGuidelineContext() { } + public string ContextKey { get { throw null; } } + public string ContextValue { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrationGuidelineContext System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrationGuidelineContext System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MultiSubnetIntent : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MultiSubnetIntent(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MultiSubnetIntent DisasterRecovery { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MultiSubnetIntent HighAvailability { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MultiSubnetIntent None { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MultiSubnetIntent 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.Migration.Assessment.Models.MultiSubnetIntent left, Azure.ResourceManager.Migration.Assessment.Models.MultiSubnetIntent right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MultiSubnetIntent (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MultiSubnetIntent left, Azure.ResourceManager.Migration.Assessment.Models.MultiSubnetIntent right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PercentileOfUtilization : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PercentileOfUtilization(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization Percentile50 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization Percentile90 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization Percentile95 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization Percentile99 { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization 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.Migration.Assessment.Models.PercentileOfUtilization left, Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization left, Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ProcessorInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ProcessorInfo() { } + public string Name { get { throw null; } set { } } + public int? NumberOfCoresPerSocket { get { throw null; } set { } } + public int? NumberOfSockets { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.ProcessorInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.ProcessorInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProductSupportStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ProductSupportStatus() { } + public string CurrentEsuYear { get { throw null; } } + public string CurrentVersion { get { throw null; } } + public string EsuStatus { get { throw null; } } + public int? Eta { get { throw null; } } + public System.DateTimeOffset? ExtendedSecurityUpdateYear1EndOn { get { throw null; } } + public System.DateTimeOffset? ExtendedSecurityUpdateYear2EndOn { get { throw null; } } + public System.DateTimeOffset? ExtendedSecurityUpdateYear3EndOn { get { throw null; } } + public System.DateTimeOffset? ExtendedSupportEndOn { get { throw null; } } + public System.DateTimeOffset? MainstreamEndOn { get { throw null; } } + public string ServicePackStatus { get { throw null; } } + public string SupportStatus { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct RecommendedSuitability : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public RecommendedSuitability(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability ConditionallySuitableForSqlDB { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability ConditionallySuitableForSqlMI { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability ConditionallySuitableForSqlVm { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability ConditionallySuitableForVm { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability NotSuitable { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability PotentiallySuitableForVm { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability ReadinessUnknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability SuitableForSqlDB { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability SuitableForSqlMI { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability SuitableForSqlVm { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability SuitableForVm { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability 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.Migration.Assessment.Models.RecommendedSuitability left, Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability left, Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SharedResourcesDto : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SharedResourcesDto() { } + public int? NumberOfMounts { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureQuorumWitnessDtoQuorumWitnessType? QuorumWitnessType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SharedDataDisks { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SharedLogDisks { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SharedTempDBDisks { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SharedResourcesDto System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SharedResourcesDto System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SkuReplicationMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SkuReplicationMode(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode ActiveGeoReplication { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode FailoverGroupInstance { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode NotApplicable { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode 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.Migration.Assessment.Models.SkuReplicationMode left, Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode left, Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SqlAssessedNetworkAdapter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SqlAssessedNetworkAdapter() { } + public string DisplayName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList IPAddresses { get { throw null; } } + public string MacAddress { get { throw null; } } + public double? MegabytesPerSecondReceived { get { throw null; } } + public double? MegabytesPerSecondTransmitted { get { throw null; } } + public double? MonthlyBandwidthCosts { get { throw null; } } + public string Name { get { throw null; } } + public double? NetGigabytesTransmittedPerMonth { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? Suitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail? SuitabilityDetail { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation? SuitabilityExplanation { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAssessedNetworkAdapter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAssessedNetworkAdapter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SqlAssessmentMigrationIssue : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SqlAssessmentMigrationIssue() { } + public System.Collections.Generic.IReadOnlyList ImpactedObjects { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssueCategory? IssueCategory { get { throw null; } } + public string IssueId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssue System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssue System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SqlAssessmentMigrationIssueCategory : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SqlAssessmentMigrationIssueCategory(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssueCategory Internal { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssueCategory Issue { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssueCategory Warning { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssueCategory 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.Migration.Assessment.Models.SqlAssessmentMigrationIssueCategory left, Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssueCategory right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssueCategory (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssueCategory left, Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssueCategory right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SqlAssessmentV2IaasSuitabilityDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SqlAssessmentV2IaasSuitabilityDetails() { } + public Azure.ResourceManager.Migration.Assessment.Models.AzureSqlIaasSkuDto AzureSqlSku { get { throw null; } } + public System.Collections.Generic.IReadOnlyList CostComponents { get { throw null; } } + public System.Collections.Generic.IReadOnlyList MigrationGuidelines { get { throw null; } } + public System.Collections.Generic.IReadOnlyList MigrationIssues { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? MigrationTargetPlatform { get { throw null; } } + public double? MonthlyComputeCost { get { throw null; } } + public double? MonthlyStorageCost { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RecommendationReasonings { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ReplicaAzureSqlSku { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? SecuritySuitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SharedResourcesDto SharedResources { get { throw null; } } + public bool? ShouldProvisionReplicas { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode? SkuReplicationMode { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? Suitability { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2IaasSuitabilityDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2IaasSuitabilityDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SqlAssessmentV2PaasSuitabilityDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SqlAssessmentV2PaasSuitabilityDetails() { } + public Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPaasSkuDto AzureSqlSku { get { throw null; } } + public System.Collections.Generic.IReadOnlyList CostComponents { get { throw null; } } + public System.Collections.Generic.IReadOnlyList MigrationGuidelines { get { throw null; } } + public System.Collections.Generic.IReadOnlyList MigrationIssues { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? MigrationTargetPlatform { get { throw null; } } + public double? MonthlyComputeCost { get { throw null; } } + public double? MonthlyStorageCost { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RecommendationReasonings { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ReplicaAzureSqlSku { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? SecuritySuitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SharedResourcesDto SharedResources { get { throw null; } } + public bool? ShouldProvisionReplicas { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode? SkuReplicationMode { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? Suitability { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SqlAssessmentV2SummaryDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SqlAssessmentV2SummaryDetails() { } + public double? ConfidenceScore { get { throw null; } } + public double? MonthlyComputeCost { get { throw null; } } + public double? MonthlyLicenseCost { get { throw null; } } + public double? MonthlySecurityCost { get { throw null; } } + public double? MonthlyStorageCost { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary SuitabilitySummary { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2SummaryDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2SummaryDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SqlAvailabilityGroupDataOverview : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SqlAvailabilityGroupDataOverview() { } + public string AvailabilityGroupId { get { throw null; } } + public string AvailabilityGroupName { get { throw null; } } + public string SqlAvailabilityGroupEntityId { get { throw null; } } + public Azure.Core.ResourceIdentifier SqlAvailabilityGroupSdsArmId { get { throw null; } } + public string SqlAvailabilityReplicaId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAvailabilityGroupDataOverview System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAvailabilityGroupDataOverview System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SqlAvailabilityReplicaSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SqlAvailabilityReplicaSummary() { } + public int? NumberOfAsynchronousNonReadReplicas { get { throw null; } } + public int? NumberOfAsynchronousReadReplicas { get { throw null; } } + public int? NumberOfPrimaryReplicas { get { throw null; } } + public int? NumberOfSynchronousNonReadReplicas { get { throw null; } } + public int? NumberOfSynchronousReadReplicas { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAvailabilityReplicaSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAvailabilityReplicaSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SqlDBSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SqlDBSettings() { } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier? AzureSqlComputeTier { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureSqlDataBaseType? AzureSqlDataBaseType { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPurchaseModel? AzureSqlPurchaseModel { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier? AzureSqlServiceTier { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlDBSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlDBSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SqlFciMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SqlFciMetadata() { } + public int? FciSharedDiskCount { get { throw null; } } + public bool? IsMultiSubnet { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState? State { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SqlFciMetadataState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SqlFciMetadataState(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState Failed { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState Inherited { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState Initializing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState Offline { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState OfflinePending { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState Online { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState OnlinePending { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState Pending { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState 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.Migration.Assessment.Models.SqlFciMetadataState left, Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState left, Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SqlFciState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SqlFciState(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciState Active { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciState NotApplicable { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciState Passive { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciState Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.SqlFciState 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.Migration.Assessment.Models.SqlFciState left, Azure.ResourceManager.Migration.Assessment.Models.SqlFciState right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.SqlFciState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.SqlFciState left, Azure.ResourceManager.Migration.Assessment.Models.SqlFciState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SqlMigrationGuideline : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SqlMigrationGuideline() { } + public string GuidelineId { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuidelineCategory? MigrationGuidelineCategory { get { throw null; } } + public System.Collections.Generic.IReadOnlyList MigrationGuidelineContext { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuideline System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuideline System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SqlMigrationGuidelineCategory : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SqlMigrationGuidelineCategory(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuidelineCategory AvailabilityGroupGuideline { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuidelineCategory FailoverCluterInstanceGuideLine { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuidelineCategory General { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuidelineCategory Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuidelineCategory 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.Migration.Assessment.Models.SqlMigrationGuidelineCategory left, Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuidelineCategory right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuidelineCategory (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuidelineCategory left, Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuidelineCategory right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SqlMISettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SqlMISettings() { } + public Azure.ResourceManager.Migration.Assessment.Models.AzureSqlInstanceType? AzureSqlInstanceType { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier? AzureSqlServiceTier { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlMISettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlMISettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SqlOptimizationLogic : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SqlOptimizationLogic(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlOptimizationLogic MinimizeCost { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlOptimizationLogic ModernizeToAzureSqlDB { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlOptimizationLogic ModernizeToAzureSqlMI { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlOptimizationLogic ModernizeToPaaS { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.SqlOptimizationLogic 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.Migration.Assessment.Models.SqlOptimizationLogic left, Azure.ResourceManager.Migration.Assessment.Models.SqlOptimizationLogic right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.SqlOptimizationLogic (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.SqlOptimizationLogic left, Azure.ResourceManager.Migration.Assessment.Models.SqlOptimizationLogic right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SqlPaaSTargetConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SqlPaaSTargetConfig() { } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier? ComputeTier { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration? HardwareGeneration { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier? ServiceTier { get { throw null; } set { } } + public System.Collections.Generic.IList TargetLocations { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? TargetType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlPaaSTargetConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlPaaSTargetConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SqlRecommendationReasoning : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SqlRecommendationReasoning() { } + public System.Collections.Generic.IReadOnlyList ContextParameters { get { throw null; } } + public string ReasoningCategory { get { throw null; } } + public string ReasoningId { get { throw null; } } + public string ReasoningString { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlRecommendationReasoning System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlRecommendationReasoning System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SqlRecommendationReasoningContext : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SqlRecommendationReasoningContext() { } + public string ContextKey { get { throw null; } } + public string ContextValue { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlRecommendationReasoningContext System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlRecommendationReasoningContext System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SqlServerLicense : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SqlServerLicense(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlServerLicense No { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlServerLicense Unknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlServerLicense Yes { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.SqlServerLicense 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.Migration.Assessment.Models.SqlServerLicense left, Azure.ResourceManager.Migration.Assessment.Models.SqlServerLicense right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.SqlServerLicense (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.SqlServerLicense left, Azure.ResourceManager.Migration.Assessment.Models.SqlServerLicense right) { throw null; } + public override string ToString() { throw null; } + } + public partial class UltraDiskAssessmentConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal UltraDiskAssessmentConfig() { } + public string FamilyName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList TargetLocations { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.UltraDiskAssessmentConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.UltraDiskAssessmentConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VmFamilyConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VmFamilyConfig() { } + public System.Collections.Generic.IReadOnlyList Category { get { throw null; } } + public string FamilyName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList TargetLocations { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.VmFamilyConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.VmFamilyConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VmUptime : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VmUptime() { } + public int? DaysPerMonth { get { throw null; } set { } } + public int? HoursPerDay { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.VmUptime System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.VmUptime System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WorkloadSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WorkloadSummary() { } + public int? OracleInstances { get { throw null; } } + public int? SpringApps { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.WorkloadSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.WorkloadSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/api/Azure.ResourceManager.Migration.Assessment.netstandard2.0.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/api/Azure.ResourceManager.Migration.Assessment.netstandard2.0.cs new file mode 100644 index 000000000000..10538b54994c --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/api/Azure.ResourceManager.Migration.Assessment.netstandard2.0.cs @@ -0,0 +1,4395 @@ +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class AssessedMachineCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AssessedMachineCollection() { } + public virtual Azure.Response Exists(string assessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string assessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string assessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string assessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string assessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string assessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class AssessedMachineData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AssessedMachineData() { } + public Azure.ResourceManager.Migration.Assessment.Models.MachineBootType? BootType { get { throw null; } } + public double? ConfidenceRatingInPercentage { get { throw null; } } + public System.Collections.Generic.IList CostComponents { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.Core.ResourceIdentifier DatacenterMachineArmId { get { throw null; } } + public Azure.Core.ResourceIdentifier DatacenterManagementServerArmId { get { throw null; } } + public string DatacenterManagementServerName { get { throw null; } } + public string Description { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Disks { get { throw null; } } + public string DisplayName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.ProcessorInfo HostProcessor { get { throw null; } set { } } + public double? MegabytesOfMemory { get { throw null; } } + public double? MegabytesOfMemoryForRecommendedSize { get { throw null; } } + public double? MonthlyBandwidthCost { get { throw null; } } + public double? MonthlyComputeCostForRecommendedSize { get { throw null; } } + public double? MonthlyPremiumStorageCost { get { throw null; } } + public double? MonthlyStandardSsdStorageCost { get { throw null; } } + public double? MonthlyStorageCost { get { throw null; } } + public double? MonthlyUltraStorageCost { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary NetworkAdapters { get { throw null; } } + public int? NumberOfCores { get { throw null; } } + public int? NumberOfCoresForRecommendedSize { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture? OperatingSystemArchitecture { get { throw null; } } + public string OperatingSystemName { get { throw null; } } + public string OperatingSystemType { get { throw null; } } + public string OperatingSystemVersion { get { throw null; } } + public double? PercentageCoresUtilization { get { throw null; } } + public double? PercentageMemoryUtilization { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus ProductSupportStatus { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize? RecommendedSize { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? Suitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail? SuitabilityDetail { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation? SuitabilityExplanation { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType? TypePropertiesType { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedMachineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedMachineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedMachineResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AssessedMachineResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedMachineData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedMachineName) { 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; } + Azure.ResourceManager.Migration.Assessment.AssessedMachineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedMachineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedSqlDatabaseV2Collection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AssessedSqlDatabaseV2Collection() { } + public virtual Azure.Response Exists(string assessedSqlDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string assessedSqlDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string assessedSqlDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string assessedSqlDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string assessedSqlDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string assessedSqlDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class AssessedSqlDatabaseV2Data : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AssessedSqlDatabaseV2Data() { } + public Azure.Core.ResourceIdentifier AssessedSqlInstanceArmId { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails AzureSqlDBSuitabilityDetails { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails AzureSqlMISuitabilityDetails { get { throw null; } } + public double? BufferCacheSizeInMB { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel? CompatibilityLevel { get { throw null; } } + public double? ConfidenceRatingInPercentage { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string DatabaseName { get { throw null; } } + public double? DatabaseSizeInMB { get { throw null; } } + public string InstanceName { get { throw null; } } + public bool? IsDatabaseHighlyAvailable { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlAvailabilityGroupDataOverview LinkedAvailabilityGroupOverview { get { throw null; } } + public Azure.Core.ResourceIdentifier MachineArmId { get { throw null; } } + public string MachineName { get { throw null; } } + public double? MegabytesPerSecondOfRead { get { throw null; } } + public double? MegabytesPerSecondOfWrite { get { throw null; } } + public double? NumberOfReadOperationsPerSecond { get { throw null; } } + public double? NumberOfWriteOperationsPerSecond { get { throw null; } } + public double? PercentageCoresUtilization { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus ProductSupportStatus { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? RecommendedAzureSqlTargetType { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability? RecommendedSuitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? SizingCriterion { get { throw null; } } + public Azure.Core.ResourceIdentifier SqlDatabaseSdsArmId { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedSqlDatabaseV2Data System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedSqlDatabaseV2Data System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedSqlDatabaseV2Resource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AssessedSqlDatabaseV2Resource() { } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedSqlDatabaseV2Data Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedSqlDatabaseName) { 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; } + Azure.ResourceManager.Migration.Assessment.AssessedSqlDatabaseV2Data System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedSqlDatabaseV2Data System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedSqlInstanceV2Collection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AssessedSqlInstanceV2Collection() { } + public virtual Azure.Response Exists(string assessedSqlInstanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string assessedSqlInstanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string assessedSqlInstanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string assessedSqlInstanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string assessedSqlInstanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string assessedSqlInstanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class AssessedSqlInstanceV2Data : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AssessedSqlInstanceV2Data() { } + public Azure.ResourceManager.Migration.Assessment.Models.SqlAvailabilityReplicaSummary AvailabilityReplicaSummary { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails AzureSqlDBSuitabilityDetails { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails AzureSqlMISuitabilityDetails { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2IaasSuitabilityDetails AzureSqlVmSuitabilityDetails { get { throw null; } } + public double? ConfidenceRatingInPercentage { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceDatabaseSummary DatabaseSummary { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadata FciMetadata { get { throw null; } } + public bool? HasScanOccurred { get { throw null; } } + public string InstanceName { get { throw null; } } + public bool? IsClustered { get { throw null; } } + public bool? IsHighAvailabilityEnabled { get { throw null; } } + public System.Collections.Generic.IReadOnlyList LogicalDisks { get { throw null; } } + public Azure.Core.ResourceIdentifier MachineArmId { get { throw null; } } + public string MachineName { get { throw null; } } + public double? MemoryInUseInMB { get { throw null; } } + public int? NumberOfCoresAllocated { get { throw null; } } + public double? PercentageCoresUtilization { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus ProductSupportStatus { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? RecommendedAzureSqlTargetType { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability? RecommendedSuitability { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RecommendedTargetReasonings { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? SizingCriterion { get { throw null; } } + public string SqlEdition { get { throw null; } } + public Azure.Core.ResourceIdentifier SqlInstanceSdsArmId { get { throw null; } } + public string SqlVersion { get { throw null; } } + public System.Collections.Generic.IReadOnlyList StorageTypeBasedDetails { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedSqlInstanceV2Data System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedSqlInstanceV2Data System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedSqlInstanceV2Resource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AssessedSqlInstanceV2Resource() { } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedSqlInstanceV2Data Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedSqlInstanceName) { 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; } + Azure.ResourceManager.Migration.Assessment.AssessedSqlInstanceV2Data System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedSqlInstanceV2Data System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedSqlMachineCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AssessedSqlMachineCollection() { } + public virtual Azure.Response Exists(string assessedSqlMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string assessedSqlMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string assessedSqlMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string assessedSqlMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string assessedSqlMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string assessedSqlMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class AssessedSqlMachineData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AssessedSqlMachineData() { } + public string BiosGuid { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MachineBootType? BootType { get { throw null; } } + public double? ConfidenceRatingInPercentage { get { throw null; } } + public System.Collections.Generic.IList CostComponents { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.Core.ResourceIdentifier DatacenterMachineArmId { get { throw null; } } + public Azure.Core.ResourceIdentifier DatacenterManagementServerArmId { get { throw null; } } + public string DatacenterManagementServerName { get { throw null; } } + public string Description { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Disks { get { throw null; } } + public string DisplayName { get { throw null; } } + public string Fqdn { get { throw null; } } + public double? MegabytesOfMemory { get { throw null; } } + public System.Collections.Generic.IReadOnlyList MigrationGuidelines { get { throw null; } } + public double? MonthlyBandwidthCost { get { throw null; } } + public double? MonthlyComputeCost { get { throw null; } } + public double? MonthlyStorageCost { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary NetworkAdapters { get { throw null; } } + public int? NumberOfCores { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture? OperatingSystemArchitecture { get { throw null; } } + public string OperatingSystemName { get { throw null; } } + public string OperatingSystemType { get { throw null; } } + public string OperatingSystemVersion { get { throw null; } } + public double? PercentageCoresUtilization { get { throw null; } } + public double? PercentageMemoryUtilization { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus ProductSupportStatus { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily? RecommendedVmFamily { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize? RecommendedVmSize { get { throw null; } } + public double? RecommendedVmSizeMegabytesOfMemory { get { throw null; } } + public int? RecommendedVmSizeNumberOfCores { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? SecuritySuitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? SizingCriterion { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SqlInstances { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? Suitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail? SuitabilityDetail { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation? SuitabilityExplanation { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType? TypePropertiesType { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedSqlMachineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedSqlMachineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedSqlMachineResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AssessedSqlMachineResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedSqlMachineData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedSqlMachineName) { 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; } + Azure.ResourceManager.Migration.Assessment.AssessedSqlMachineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedSqlMachineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedSqlRecommendedEntityCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AssessedSqlRecommendedEntityCollection() { } + public virtual Azure.Response Exists(string recommendedAssessedEntityName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string recommendedAssessedEntityName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string recommendedAssessedEntityName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string recommendedAssessedEntityName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string recommendedAssessedEntityName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string recommendedAssessedEntityName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class AssessedSqlRecommendedEntityData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AssessedSqlRecommendedEntityData() { } + public Azure.Core.ResourceIdentifier AssessedSqlEntityArmId { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails AzureSqlDBSuitabilityDetails { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails AzureSqlMISuitabilityDetails { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2IaasSuitabilityDetails AzureSqlVmSuitabilityDetails { get { throw null; } } + public int? DBCount { get { throw null; } } + public int? DiscoveredDBCount { get { throw null; } } + public bool? HasScanOccurred { get { throw null; } } + public string InstanceName { get { throw null; } } + public bool? IsClustered { get { throw null; } } + public bool? IsHighAvailabilityEnabled { get { throw null; } } + public string MachineName { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus ProductSupportStatus { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? RecommendedAzureSqlTargetType { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability? RecommendedSuitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? SizingCriterion { get { throw null; } } + public string SqlEdition { get { throw null; } } + public string SqlVersion { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedSqlRecommendedEntityData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedSqlRecommendedEntityData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedSqlRecommendedEntityResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AssessedSqlRecommendedEntityResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedSqlRecommendedEntityData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string recommendedAssessedEntityName) { 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; } + Azure.ResourceManager.Migration.Assessment.AssessedSqlRecommendedEntityData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.AssessedSqlRecommendedEntityData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAssessmentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentAssessmentCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string assessmentName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string assessmentName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentAssessmentData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentAssessmentData() { } + public System.Collections.Generic.IReadOnlyDictionary AssessmentErrorSummary { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentType? AssessmentType { get { throw null; } } + public System.Collections.Generic.IList AzureDiskTypes { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureHybridUseBenefit? AzureHybridUseBenefit { get { throw null; } set { } } + public Azure.Core.AzureLocation? AzureLocation { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode? AzureOfferCode { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzurePricingTier? AzurePricingTier { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy? AzureStorageRedundancy { get { throw null; } set { } } + public System.Collections.Generic.IList AzureVmFamilies { get { throw null; } } + public double? ConfidenceRatingInPercentage { get { throw null; } } + public System.Collections.Generic.IReadOnlyList CostComponents { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency? Currency { get { throw null; } set { } } + public double? DiscountPercentage { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyDictionary DistributionByOSName { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary DistributionByServicePackInsight { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary DistributionBySupportStatus { get { throw null; } } + public string EASubscriptionId { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType? GroupType { get { throw null; } } + public double? MonthlyBandwidthCost { get { throw null; } } + public double? MonthlyComputeCost { get { throw null; } } + public double? MonthlyPremiumStorageCost { get { throw null; } } + public double? MonthlyStandardSsdStorageCost { get { throw null; } } + public double? MonthlyStorageCost { get { throw null; } } + public double? MonthlyUltraStorageCost { get { throw null; } } + public int? NumberOfMachines { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization? Percentile { get { throw null; } set { } } + public System.DateTimeOffset? PerfDataEndOn { get { throw null; } set { } } + public System.DateTimeOffset? PerfDataStartOn { get { throw null; } set { } } + public System.DateTimeOffset? PricesQueriedOn { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? ProvisioningState { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance? ReservedInstance { get { throw null; } set { } } + public double? ScalingFactor { get { throw null; } set { } } + public string SchemaVersion { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? SizingCriterion { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage? Stage { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus? Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary SuitabilitySummary { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange? TimeRange { get { throw null; } set { } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.VmUptime VmUptime { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAssessmentOptionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentAssessmentOptionCollection() { } + public virtual Azure.Response Exists(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentAssessmentOptionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentAssessmentOptionData() { } + public System.Collections.Generic.IReadOnlyList PremiumDiskVmFamilies { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ReservedInstanceSupportedCurrencies { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ReservedInstanceSupportedLocations { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ReservedInstanceSupportedOffers { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ReservedInstanceVmFamilies { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SavingsPlanSupportedLocations { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SavingsPlanVmFamilies { get { throw null; } } + public System.Collections.Generic.IReadOnlyList UltraDiskVmFamilies { get { throw null; } } + public System.Collections.Generic.IReadOnlyList VmFamilies { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentOptionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentOptionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAssessmentOptionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentAssessmentOptionResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentOptionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string assessmentOptionsName) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentOptionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentOptionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAssessmentProjectCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentAssessmentProjectCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string projectName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string projectName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentAssessmentProjectData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentAssessmentProjectData(Azure.Core.AzureLocation location) { } + public string AssessmentSolutionId { get { throw null; } set { } } + public System.DateTimeOffset? CreateOn { get { throw null; } } + public Azure.Core.ResourceIdentifier CustomerStorageAccountArmId { get { throw null; } set { } } + public string CustomerWorkspaceId { get { throw null; } set { } } + public string CustomerWorkspaceLocation { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList PrivateEndpointConnections { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentProjectStatus? ProjectStatus { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? ProvisioningState { get { throw null; } set { } } + public string PublicNetworkAccess { get { throw null; } set { } } + public string ServiceEndpoint { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAssessmentProjectResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentAssessmentProjectResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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; } + public virtual Azure.Response GetMigrationAssessmentAssessmentOption(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentAssessmentOptionAsync(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentOptionCollection GetMigrationAssessmentAssessmentOptions() { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectSummaryCollection GetMigrationAssessmentAssessmentProjectSummaries() { throw null; } + public virtual Azure.Response GetMigrationAssessmentAssessmentProjectSummary(string projectSummaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentAssessmentProjectSummaryAsync(string projectSummaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetMigrationAssessmentAvsAssessmentOption(string avsAssessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentAvsAssessmentOptionAsync(string avsAssessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentOptionCollection GetMigrationAssessmentAvsAssessmentOptions() { throw null; } + public virtual Azure.Response GetMigrationAssessmentGroup(string groupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentGroupAsync(string groupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupCollection GetMigrationAssessmentGroups() { throw null; } + public virtual Azure.Response GetMigrationAssessmentHyperVCollector(string hyperVCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentHyperVCollectorAsync(string hyperVCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorCollection GetMigrationAssessmentHyperVCollectors() { throw null; } + public virtual Azure.Response GetMigrationAssessmentImportCollector(string importCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentImportCollectorAsync(string importCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorCollection GetMigrationAssessmentImportCollectors() { throw null; } + public virtual Azure.Response GetMigrationAssessmentMachine(string machineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentMachineAsync(string machineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentMachineCollection GetMigrationAssessmentMachines() { throw null; } + public virtual Azure.Response GetMigrationAssessmentPrivateEndpointConnection(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentPrivateEndpointConnectionAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionCollection GetMigrationAssessmentPrivateEndpointConnections() { throw null; } + public virtual Azure.Response GetMigrationAssessmentPrivateLinkResource(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentPrivateLinkResourceAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateLinkResourceCollection GetMigrationAssessmentPrivateLinkResources() { throw null; } + public virtual Azure.Response GetMigrationAssessmentServerCollector(string serverCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentServerCollectorAsync(string serverCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorCollection GetMigrationAssessmentServerCollectors() { throw null; } + public virtual Azure.Response GetMigrationAssessmentSqlAssessmentOption(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentSqlAssessmentOptionAsync(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentOptionCollection GetMigrationAssessmentSqlAssessmentOptions() { throw null; } + public virtual Azure.Response GetMigrationAssessmentSqlCollector(string collectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentSqlCollectorAsync(string collectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorCollection GetMigrationAssessmentSqlCollectors() { throw null; } + public virtual Azure.Response GetMigrationAssessmentVMwareCollector(string vmWareCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentVMwareCollectorAsync(string vmWareCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorCollection GetMigrationAssessmentVMwareCollectors() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentAssessmentProjectPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentAssessmentProjectPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MigrationAssessmentAssessmentProjectSummaryCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentAssessmentProjectSummaryCollection() { } + public virtual Azure.Response Exists(string projectSummaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string projectSummaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string projectSummaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string projectSummaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string projectSummaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string projectSummaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentAssessmentProjectSummaryData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentAssessmentProjectSummaryData() { } + public System.Collections.Generic.IReadOnlyList ErrorSummaryAffectedEntities { get { throw null; } } + public System.DateTimeOffset? LastAssessedOn { get { throw null; } } + public int? NumberOfAssessments { get { throw null; } } + public int? NumberOfGroups { get { throw null; } } + public int? NumberOfImportMachines { get { throw null; } } + public int? NumberOfMachines { get { throw null; } } + public int? NumberOfPrivateEndpointConnections { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectSummaryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectSummaryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAssessmentProjectSummaryResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentAssessmentProjectSummaryResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectSummaryData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string projectSummaryName) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectSummaryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectSummaryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAssessmentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentAssessmentResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation DownloadUrl(Azure.WaitUntil waitUntil, System.BinaryData body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DownloadUrlAsync(Azure.WaitUntil waitUntil, System.BinaryData body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAssessedMachine(string assessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAssessedMachineAsync(string assessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedMachineCollection GetAssessedMachines() { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MigrationAssessmentAvsAssessedMachineCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentAvsAssessedMachineCollection() { } + public virtual Azure.Response Exists(string avsAssessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string avsAssessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string avsAssessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string avsAssessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string avsAssessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string avsAssessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentAvsAssessedMachineData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentAvsAssessedMachineData() { } + public Azure.ResourceManager.Migration.Assessment.Models.MachineBootType? BootType { get { throw null; } } + public double? ConfidenceRatingInPercentage { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.Core.ResourceIdentifier DatacenterMachineArmId { get { throw null; } } + public Azure.Core.ResourceIdentifier DatacenterManagementServerArmId { get { throw null; } } + public string DatacenterManagementServerName { get { throw null; } } + public string Description { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Disks { get { throw null; } } + public string DisplayName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public double? MegabytesOfMemory { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary NetworkAdapters { get { throw null; } } + public int? NumberOfCores { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture? OperatingSystemArchitecture { get { throw null; } } + public string OperatingSystemName { get { throw null; } } + public string OperatingSystemType { get { throw null; } } + public string OperatingSystemVersion { get { throw null; } } + public double? PercentageCoresUtilization { get { throw null; } } + public double? PercentageMemoryUtilization { get { throw null; } } + public double? StorageInUseGB { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? Suitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail? SuitabilityDetail { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityExplanation? SuitabilityExplanation { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType? TypePropertiesType { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessedMachineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessedMachineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAvsAssessedMachineResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentAvsAssessedMachineResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessedMachineData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string avsAssessedMachineName) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessedMachineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessedMachineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAvsAssessmentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentAvsAssessmentCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string assessmentName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string assessmentName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentAvsAssessmentData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentAvsAssessmentData() { } + public System.Collections.Generic.IReadOnlyDictionary AssessmentErrorSummary { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentType? AssessmentType { get { throw null; } } + public Azure.Core.AzureLocation? AzureLocation { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode? AzureOfferCode { get { throw null; } set { } } + public double? ConfidenceRatingInPercentage { get { throw null; } } + public double? CpuUtilization { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency? Currency { get { throw null; } set { } } + public double? DedupeCompression { get { throw null; } set { } } + public double? DiscountPercentage { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel? FailuresToTolerateAndRaidLevel { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType? GroupType { get { throw null; } } + public bool? IsStretchClusterEnabled { get { throw null; } set { } } + public string LimitingFactor { get { throw null; } } + public double? MemOvercommit { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AvsNodeType? NodeType { get { throw null; } set { } } + public int? NumberOfMachines { get { throw null; } } + public int? NumberOfNodes { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization? Percentile { get { throw null; } set { } } + public System.DateTimeOffset? PerfDataEndOn { get { throw null; } set { } } + public System.DateTimeOffset? PerfDataStartOn { get { throw null; } set { } } + public System.DateTimeOffset? PricesQueriedOn { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? ProvisioningState { get { throw null; } set { } } + public double? RamUtilization { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance? ReservedInstance { get { throw null; } set { } } + public double? ScalingFactor { get { throw null; } set { } } + public string SchemaVersion { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? SizingCriterion { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage? Stage { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus? Status { get { throw null; } } + public double? StorageUtilization { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? Suitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AvsSuitabilityExplanation? SuitabilityExplanation { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary SuitabilitySummary { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange? TimeRange { get { throw null; } set { } } + public double? TotalCpuCores { get { throw null; } } + public double? TotalMonthlyCost { get { throw null; } } + public double? TotalRamInGB { get { throw null; } } + public double? TotalStorageInGB { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + public double? VcpuOversubscription { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAvsAssessmentOptionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentAvsAssessmentOptionCollection() { } + public virtual Azure.Response Exists(string avsAssessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string avsAssessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string avsAssessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string avsAssessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string avsAssessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string avsAssessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentAvsAssessmentOptionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentAvsAssessmentOptionData() { } + public System.Collections.Generic.IList AvsNodes { get { throw null; } } + public System.Collections.Generic.IList FailuresToTolerateAndRaidLevelValues { get { throw null; } } + public System.Collections.Generic.IList ReservedInstanceAvsNodes { get { throw null; } } + public System.Collections.Generic.IList ReservedInstanceSupportedCurrencies { get { throw null; } } + public System.Collections.Generic.IList ReservedInstanceSupportedLocations { get { throw null; } } + public System.Collections.Generic.IList ReservedInstanceSupportedOffers { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentOptionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentOptionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAvsAssessmentOptionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentAvsAssessmentOptionResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentOptionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string avsAssessmentOptionsName) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentOptionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentOptionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAvsAssessmentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentAvsAssessmentResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation DownloadUrl(Azure.WaitUntil waitUntil, System.BinaryData body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DownloadUrlAsync(Azure.WaitUntil waitUntil, System.BinaryData body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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; } + public virtual Azure.Response GetMigrationAssessmentAvsAssessedMachine(string avsAssessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentAvsAssessedMachineAsync(string avsAssessedMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessedMachineCollection GetMigrationAssessmentAvsAssessedMachines() { throw null; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class MigrationAssessmentExtensions + { + public static Azure.ResourceManager.Migration.Assessment.AssessedMachineResource GetAssessedMachineResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.AssessedSqlDatabaseV2Resource GetAssessedSqlDatabaseV2Resource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.AssessedSqlInstanceV2Resource GetAssessedSqlInstanceV2Resource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.AssessedSqlMachineResource GetAssessedSqlMachineResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.AssessedSqlRecommendedEntityResource GetAssessedSqlRecommendedEntityResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentOptionResource GetMigrationAssessmentAssessmentOptionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetMigrationAssessmentAssessmentProject(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetMigrationAssessmentAssessmentProjectAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectResource GetMigrationAssessmentAssessmentProjectResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectCollection GetMigrationAssessmentAssessmentProjects(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetMigrationAssessmentAssessmentProjects(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetMigrationAssessmentAssessmentProjectsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectSummaryResource GetMigrationAssessmentAssessmentProjectSummaryResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentResource GetMigrationAssessmentAssessmentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessedMachineResource GetMigrationAssessmentAvsAssessedMachineResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentOptionResource GetMigrationAssessmentAvsAssessmentOptionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentResource GetMigrationAssessmentAvsAssessmentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupResource GetMigrationAssessmentGroupResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorResource GetMigrationAssessmentHyperVCollectorResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorResource GetMigrationAssessmentImportCollectorResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentMachineResource GetMigrationAssessmentMachineResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionResource GetMigrationAssessmentPrivateEndpointConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateLinkResource GetMigrationAssessmentPrivateLinkResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorResource GetMigrationAssessmentServerCollectorResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentOptionResource GetMigrationAssessmentSqlAssessmentOptionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Resource GetMigrationAssessmentSqlAssessmentV2Resource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2SummaryResource GetMigrationAssessmentSqlAssessmentV2SummaryResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorResource GetMigrationAssessmentSqlCollectorResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorResource GetMigrationAssessmentVMwareCollectorResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MigrationAssessmentGroupCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentGroupCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string groupName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string groupName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string groupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string groupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string groupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string groupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string groupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string groupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentGroupData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentGroupData() { } + public bool? AreAssessmentsRunning { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Assessments { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus? GroupStatus { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType? GroupType { get { throw null; } set { } } + public int? MachineCount { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? ProvisioningState { get { throw null; } set { } } + public System.Collections.Generic.IList SupportedAssessmentTypes { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentGroupResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentGroupResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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; } + public virtual Azure.Response GetMigrationAssessmentAssessment(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentAssessmentAsync(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentCollection GetMigrationAssessmentAssessments() { throw null; } + public virtual Azure.Response GetMigrationAssessmentAvsAssessment(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentAvsAssessmentAsync(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentCollection GetMigrationAssessmentAvsAssessments() { throw null; } + public virtual Azure.Response GetMigrationAssessmentSqlAssessmentV2(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentSqlAssessmentV2Async(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Collection GetMigrationAssessmentSqlAssessmentV2s() { throw null; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation UpdateMachines(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateMachinesAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MigrationAssessmentHyperVCollectorCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentHyperVCollectorCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string hyperVCollectorName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string hyperVCollectorName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string hyperVCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string hyperVCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string hyperVCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string hyperVCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string hyperVCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string hyperVCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentHyperVCollectorData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentHyperVCollectorData() { } + public Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentPropertiesBase AgentProperties { get { throw null; } set { } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string DiscoverySiteId { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? ProvisioningState { get { throw null; } set { } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentHyperVCollectorResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentHyperVCollectorResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string hyperVCollectorName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MigrationAssessmentImportCollectorCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentImportCollectorCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string importCollectorName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string importCollectorName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string importCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string importCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string importCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string importCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string importCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string importCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentImportCollectorData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentImportCollectorData() { } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string DiscoverySiteId { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? ProvisioningState { get { throw null; } set { } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentImportCollectorResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentImportCollectorResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string importCollectorName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MigrationAssessmentMachineCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentMachineCollection() { } + public virtual Azure.Response Exists(string machineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string machineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string machineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, int? pageSize = default(int?), string continuationToken = null, int? totalRecordCount = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string machineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string machineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string machineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentMachineData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentMachineData() { } + public Azure.ResourceManager.Migration.Assessment.Models.MachineBootType? BootType { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.Core.ResourceIdentifier DatacenterManagementServerArmId { get { throw null; } } + public string DatacenterManagementServerName { get { throw null; } } + public string Description { get { throw null; } } + public Azure.Core.ResourceIdentifier DiscoveryMachineArmId { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Disks { get { throw null; } } + public string DisplayName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Groups { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.ProcessorInfo HostProcessor { get { throw null; } } + public double? MegabytesOfMemory { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary NetworkAdapters { get { throw null; } } + public int? NumberOfCores { get { throw null; } } + public string OperatingSystemName { get { throw null; } } + public string OperatingSystemType { get { throw null; } } + public string OperatingSystemVersion { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus ProductSupportStatus { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SqlInstances { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + public System.Collections.Generic.IReadOnlyList WebApplications { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.WorkloadSummary WorkloadSummary { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentMachineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentMachineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentMachineResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentMachineResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentMachineData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string machineName) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentMachineData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentMachineData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentPrivateEndpointConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentPrivateEndpointConnectionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentPrivateEndpointConnectionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentPrivateEndpointConnectionData() { } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateLinkServiceConnectionState ConnectionState { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList GroupIds { get { throw null; } } + public Azure.Core.ResourceIdentifier PrivateEndpointId { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState? ProvisioningState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentPrivateEndpointConnectionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentPrivateEndpointConnectionResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string privateEndpointConnectionName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MigrationAssessmentPrivateLinkResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentPrivateLinkResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateLinkResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string privateLinkResourceName) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateLinkResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateLinkResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentPrivateLinkResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentPrivateLinkResourceCollection() { } + public virtual Azure.Response Exists(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentPrivateLinkResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentPrivateLinkResourceData() { } + public string GroupId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredMembers { get { throw null; } } + public System.Collections.Generic.IList RequiredZoneNames { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateLinkResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateLinkResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentServerCollectorCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentServerCollectorCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string serverCollectorName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string serverCollectorName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string serverCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string serverCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string serverCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string serverCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string serverCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string serverCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentServerCollectorData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentServerCollectorData() { } + public Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentPropertiesBase AgentProperties { get { throw null; } set { } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string DiscoverySiteId { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? ProvisioningState { get { throw null; } set { } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentServerCollectorResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentServerCollectorResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string serverCollectorName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MigrationAssessmentSqlAssessmentOptionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentSqlAssessmentOptionCollection() { } + public virtual Azure.Response Exists(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentSqlAssessmentOptionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentSqlAssessmentOptionData() { } + public System.Collections.Generic.IReadOnlyList PremiumDiskVmFamilies { get { throw null; } } + public System.Collections.Generic.IList ReservedInstanceSqlTargets { get { throw null; } } + public System.Collections.Generic.IList ReservedInstanceSupportedCurrencies { get { throw null; } } + public System.Collections.Generic.IList ReservedInstanceSupportedLocations { get { throw null; } } + public System.Collections.Generic.IList ReservedInstanceSupportedLocationsForIaas { get { throw null; } } + public System.Collections.Generic.IList ReservedInstanceSupportedOffers { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ReservedInstanceVmFamilies { get { throw null; } } + public System.Collections.Generic.IList SavingsPlanSupportedLocations { get { throw null; } } + public System.Collections.Generic.IList SavingsPlanSupportedLocationsForPaas { get { throw null; } } + public System.Collections.Generic.IList SavingsPlanSupportedOffers { get { throw null; } } + public System.Collections.Generic.IList SavingsPlanVmFamilies { get { throw null; } } + public System.Collections.Generic.IList SqlSkus { get { throw null; } } + public System.Collections.Generic.IList SupportedOffers { get { throw null; } } + public System.Collections.Generic.IReadOnlyList VmFamilies { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentOptionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentOptionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentSqlAssessmentOptionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentSqlAssessmentOptionResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentOptionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string assessmentOptionsName) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentOptionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentOptionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentSqlAssessmentV2Collection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentSqlAssessmentV2Collection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string assessmentName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Data data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string assessmentName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Data data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentSqlAssessmentV2Data : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentSqlAssessmentV2Data() { } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentType? AssessmentType { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AsyncCommitModeIntent? AsyncCommitModeIntent { get { throw null; } set { } } + public Azure.Core.AzureLocation? AzureLocation { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode? AzureOfferCode { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode? AzureOfferCodeForVm { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureSecurityOfferingType? AzureSecurityOfferingType { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlDBSettings AzureSqlDatabaseSettings { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlMISettings AzureSqlManagedInstanceSettings { get { throw null; } set { } } + public System.Collections.Generic.IList AzureSqlVmInstanceSeries { get { throw null; } } + public double? ConfidenceRatingInPercentage { get { throw null; } set { } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency? Currency { get { throw null; } set { } } + public Azure.Core.AzureLocation? DisasterRecoveryLocation { get { throw null; } set { } } + public double? DiscountPercentage { get { throw null; } set { } } + public string EASubscriptionId { get { throw null; } set { } } + public bool? EnableHadrAssessment { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.EntityUptime EntityUptime { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentEnvironmentType? EnvironmentType { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType? GroupType { get { throw null; } set { } } + public bool? IsInternetAccessAvailable { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MultiSubnetIntent? MultiSubnetIntent { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlOptimizationLogic? OptimizationLogic { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentOSLicense? OSLicense { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization? Percentile { get { throw null; } set { } } + public System.DateTimeOffset? PerfDataEndOn { get { throw null; } set { } } + public System.DateTimeOffset? PerfDataStartOn { get { throw null; } set { } } + public System.DateTimeOffset? PricesQueriedOn { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? ProvisioningState { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance? ReservedInstance { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance? ReservedInstanceForVm { get { throw null; } set { } } + public double? ScalingFactor { get { throw null; } set { } } + public string SchemaVersion { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? SizingCriterion { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlServerLicense? SqlServerLicense { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage? Stage { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus? Status { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange? TimeRange { get { throw null; } set { } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Data System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Data System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentSqlAssessmentV2Resource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentSqlAssessmentV2Resource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Data Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation DownloadUrl(Azure.WaitUntil waitUntil, System.BinaryData body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DownloadUrlAsync(Azure.WaitUntil waitUntil, System.BinaryData body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAssessedSqlDatabaseV2(string assessedSqlDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAssessedSqlDatabaseV2Async(string assessedSqlDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedSqlDatabaseV2Collection GetAssessedSqlDatabaseV2s() { throw null; } + public virtual Azure.Response GetAssessedSqlInstanceV2(string assessedSqlInstanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAssessedSqlInstanceV2Async(string assessedSqlInstanceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedSqlInstanceV2Collection GetAssessedSqlInstanceV2s() { throw null; } + public virtual Azure.Response GetAssessedSqlMachine(string assessedSqlMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAssessedSqlMachineAsync(string assessedSqlMachineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedSqlMachineCollection GetAssessedSqlMachines() { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedSqlRecommendedEntityCollection GetAssessedSqlRecommendedEntities() { throw null; } + public virtual Azure.Response GetAssessedSqlRecommendedEntity(string recommendedAssessedEntityName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAssessedSqlRecommendedEntityAsync(string recommendedAssessedEntityName, 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; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2SummaryCollection GetMigrationAssessmentSqlAssessmentV2Summaries() { throw null; } + public virtual Azure.Response GetMigrationAssessmentSqlAssessmentV2Summary(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentSqlAssessmentV2SummaryAsync(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Data System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Data System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Data data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Data data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MigrationAssessmentSqlAssessmentV2SummaryCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentSqlAssessmentV2SummaryCollection() { } + public virtual Azure.Response Exists(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentSqlAssessmentV2SummaryData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentSqlAssessmentV2SummaryData() { } + public System.Collections.Generic.IReadOnlyDictionary AssessmentSummary { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary DatabaseDistributionBySizingCriterion { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary DistributionByServicePackInsight { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary DistributionBySqlEdition { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary DistributionBySqlVersion { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary DistributionBySupportStatus { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary InstanceDistributionBySizingCriterion { get { throw null; } } + public int? NumberOfFciInstances { get { throw null; } } + public int? NumberOfMachines { get { throw null; } } + public int? NumberOfSqlAvailabilityGroups { get { throw null; } } + public int? NumberOfSqlDatabases { get { throw null; } } + public int? NumberOfSqlInstances { get { throw null; } } + public int? NumberOfSuccessfullyDiscoveredSqlInstances { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2SummaryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2SummaryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentSqlAssessmentV2SummaryResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentSqlAssessmentV2SummaryResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2SummaryData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string summaryName) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2SummaryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2SummaryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentSqlCollectorCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentSqlCollectorCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string collectorName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string collectorName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string collectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string collectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string collectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string collectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string collectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string collectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentSqlCollectorData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentSqlCollectorData() { } + public Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentPropertiesBase AgentProperties { get { throw null; } set { } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string DiscoverySiteId { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? ProvisioningState { get { throw null; } set { } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentSqlCollectorResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentSqlCollectorResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string collectorName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MigrationAssessmentVMwareCollectorCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigrationAssessmentVMwareCollectorCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string vmWareCollectorName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string vmWareCollectorName, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string vmWareCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string vmWareCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string vmWareCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string vmWareCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string vmWareCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string vmWareCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MigrationAssessmentVMwareCollectorData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentVMwareCollectorData() { } + public Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentPropertiesBase AgentProperties { get { throw null; } set { } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string DiscoverySiteId { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? ProvisioningState { get { throw null; } set { } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentVMwareCollectorResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigrationAssessmentVMwareCollectorResource() { } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string vmWareCollectorName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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; } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.Migration.Assessment.Mocking +{ + public partial class MockableMigrationAssessmentArmClient : Azure.ResourceManager.ArmResource + { + protected MockableMigrationAssessmentArmClient() { } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedMachineResource GetAssessedMachineResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedSqlDatabaseV2Resource GetAssessedSqlDatabaseV2Resource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedSqlInstanceV2Resource GetAssessedSqlInstanceV2Resource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedSqlMachineResource GetAssessedSqlMachineResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.AssessedSqlRecommendedEntityResource GetAssessedSqlRecommendedEntityResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentOptionResource GetMigrationAssessmentAssessmentOptionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectResource GetMigrationAssessmentAssessmentProjectResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectSummaryResource GetMigrationAssessmentAssessmentProjectSummaryResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentResource GetMigrationAssessmentAssessmentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessedMachineResource GetMigrationAssessmentAvsAssessedMachineResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentOptionResource GetMigrationAssessmentAvsAssessmentOptionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentResource GetMigrationAssessmentAvsAssessmentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupResource GetMigrationAssessmentGroupResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorResource GetMigrationAssessmentHyperVCollectorResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorResource GetMigrationAssessmentImportCollectorResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentMachineResource GetMigrationAssessmentMachineResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionResource GetMigrationAssessmentPrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateLinkResource GetMigrationAssessmentPrivateLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorResource GetMigrationAssessmentServerCollectorResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentOptionResource GetMigrationAssessmentSqlAssessmentOptionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Resource GetMigrationAssessmentSqlAssessmentV2Resource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2SummaryResource GetMigrationAssessmentSqlAssessmentV2SummaryResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorResource GetMigrationAssessmentSqlCollectorResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorResource GetMigrationAssessmentVMwareCollectorResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableMigrationAssessmentResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableMigrationAssessmentResourceGroupResource() { } + public virtual Azure.Response GetMigrationAssessmentAssessmentProject(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigrationAssessmentAssessmentProjectAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectCollection GetMigrationAssessmentAssessmentProjects() { throw null; } + } + public partial class MockableMigrationAssessmentSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableMigrationAssessmentSubscriptionResource() { } + public virtual Azure.Pageable GetMigrationAssessmentAssessmentProjects(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetMigrationAssessmentAssessmentProjectsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public static partial class ArmMigrationAssessmentModelFactory + { + public static Azure.ResourceManager.Migration.Assessment.Models.AssessedDataDisk AssessedDataDisk(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? suitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?), Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation? suitabilityExplanation = default(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation?), Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail? suitabilityDetail = default(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail?), Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize? recommendedDiskSize = default(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize?), Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType? recommendedDiskType = default(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType?), int? recommendedDiskSizeGigabytes = default(int?), double? recommendDiskThroughputInMbps = default(double?), double? recommendedDiskIops = default(double?), double? monthlyStorageCost = default(double?), string name = null, string displayName = null, double? gigabytesProvisioned = default(double?), double? megabytesPerSecondOfRead = default(double?), double? megabytesPerSecondOfWrite = default(double?), double? numberOfReadOperationsPerSecond = default(double?), double? numberOfWriteOperationsPerSecond = default(double?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessedDisk AssessedDisk(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? suitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?), Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation? suitabilityExplanation = default(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation?), Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail? suitabilityDetail = default(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail?), Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize? recommendedDiskSize = default(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize?), Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType? recommendedDiskType = default(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType?), int? gigabytesForRecommendedDiskSize = default(int?), double? recommendDiskThroughputInMbps = default(double?), double? recommendedDiskIops = default(double?), double? monthlyStorageCost = default(double?), string name = null, string displayName = null, double? gigabytesProvisioned = default(double?), double? megabytesPerSecondOfRead = default(double?), double? megabytesPerSecondOfWrite = default(double?), double? numberOfReadOperationsPerSecond = default(double?), double? numberOfWriteOperationsPerSecond = default(double?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.AssessedMachineData AssessedMachineData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable errors = null, System.Collections.Generic.IReadOnlyDictionary disks = null, double? monthlyUltraStorageCost = default(double?), Azure.ResourceManager.Migration.Assessment.Models.ProcessorInfo hostProcessor = null, System.Collections.Generic.IEnumerable costComponents = null, Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus productSupportStatus = null, double? monthlyBandwidthCost = default(double?), double? monthlyStorageCost = default(double?), double? monthlyPremiumStorageCost = default(double?), double? monthlyStandardSsdStorageCost = default(double?), System.Collections.Generic.IReadOnlyDictionary networkAdapters = null, Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize? recommendedSize = default(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize?), int? numberOfCoresForRecommendedSize = default(int?), double? megabytesOfMemoryForRecommendedSize = default(double?), double? monthlyComputeCostForRecommendedSize = default(double?), Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation? suitabilityExplanation = default(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation?), Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail? suitabilityDetail = default(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail?), Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType? typePropertiesType = default(Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType?), Azure.ResourceManager.Migration.Assessment.Models.MachineBootType? bootType = default(Azure.ResourceManager.Migration.Assessment.Models.MachineBootType?), string operatingSystemType = null, string operatingSystemName = null, string operatingSystemVersion = null, Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture? operatingSystemArchitecture = default(Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), string displayName = null, string description = null, Azure.Core.ResourceIdentifier datacenterMachineArmId = null, Azure.Core.ResourceIdentifier datacenterManagementServerArmId = null, string datacenterManagementServerName = null, double? megabytesOfMemory = default(double?), int? numberOfCores = default(int?), double? confidenceRatingInPercentage = default(double?), double? percentageCoresUtilization = default(double?), double? percentageMemoryUtilization = default(double?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? suitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessedNetworkAdapter AssessedNetworkAdapter(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? suitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?), Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail? suitabilityDetail = default(Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail?), Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation? suitabilityExplanation = default(Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation?), double? monthlyBandwidthCosts = default(double?), double? netGigabytesTransmittedPerMonth = default(double?), string displayName = null, string macAddress = null, System.Collections.Generic.IEnumerable ipAddresses = null, double? megabytesPerSecondReceived = default(double?), double? megabytesPerSecondTransmitted = default(double?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.AssessedSqlDatabaseV2Data AssessedSqlDatabaseV2Data(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? recommendedAzureSqlTargetType = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType?), Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability? recommendedSuitability = default(Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability?), double? bufferCacheSizeInMB = default(double?), Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus productSupportStatus = null, Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails azureSqlMISuitabilityDetails = null, Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails azureSqlDBSuitabilityDetails = null, bool? isDatabaseHighlyAvailable = default(bool?), Azure.ResourceManager.Migration.Assessment.Models.SqlAvailabilityGroupDataOverview linkedAvailabilityGroupOverview = null, Azure.Core.ResourceIdentifier machineArmId = null, Azure.Core.ResourceIdentifier assessedSqlInstanceArmId = null, string machineName = null, string instanceName = null, string databaseName = null, double? databaseSizeInMB = default(double?), Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel? compatibilityLevel = default(Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel?), Azure.Core.ResourceIdentifier sqlDatabaseSdsArmId = null, double? percentageCoresUtilization = default(double?), double? megabytesPerSecondOfRead = default(double?), double? megabytesPerSecondOfWrite = default(double?), double? numberOfReadOperationsPerSecond = default(double?), double? numberOfWriteOperationsPerSecond = default(double?), double? confidenceRatingInPercentage = default(double?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? sizingCriterion = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceDatabaseSummary AssessedSqlInstanceDatabaseSummary(int? numberOfUserDatabases = default(int?), double? totalDatabaseSizeInMB = default(double?), double? largestDatabaseSizeInMB = default(double?), int? totalDiscoveredUserDatabases = default(int?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceDiskDetails AssessedSqlInstanceDiskDetails(string diskId = null, double? diskSizeInMB = default(double?), double? megabytesPerSecondOfRead = default(double?), double? megabytesPerSecondOfWrite = default(double?), double? numberOfReadOperationsPerSecond = default(double?), double? numberOfWriteOperationsPerSecond = default(double?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceStorageDetails AssessedSqlInstanceStorageDetails(string storageType = null, double? diskSizeInMB = default(double?), double? megabytesPerSecondOfRead = default(double?), double? megabytesPerSecondOfWrite = default(double?), double? numberOfReadOperationsPerSecond = default(double?), double? numberOfWriteOperationsPerSecond = default(double?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceSummary AssessedSqlInstanceSummary(string instanceId = null, string instanceName = null, Azure.Core.ResourceIdentifier sqlInstanceSdsArmId = null, string sqlInstanceEntityId = null, string sqlEdition = null, string sqlVersion = null, bool? isClustered = default(bool?), bool? isHighAvailabilityEnabled = default(bool?), Azure.ResourceManager.Migration.Assessment.Models.SqlFciState? sqlFciState = default(Azure.ResourceManager.Migration.Assessment.Models.SqlFciState?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.AssessedSqlInstanceV2Data AssessedSqlInstanceV2Data(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, double? memoryInUseInMB = default(double?), bool? hasScanOccurred = default(bool?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? recommendedAzureSqlTargetType = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType?), Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability? recommendedSuitability = default(Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability?), Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails azureSqlMISuitabilityDetails = null, Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails azureSqlDBSuitabilityDetails = null, Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2IaasSuitabilityDetails azureSqlVmSuitabilityDetails = null, System.Collections.Generic.IEnumerable storageTypeBasedDetails = null, Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus productSupportStatus = null, Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadata fciMetadata = null, Azure.ResourceManager.Migration.Assessment.Models.SqlAvailabilityReplicaSummary availabilityReplicaSummary = null, bool? isClustered = default(bool?), bool? isHighAvailabilityEnabled = default(bool?), System.Collections.Generic.IEnumerable recommendedTargetReasonings = null, Azure.Core.ResourceIdentifier machineArmId = null, string machineName = null, string instanceName = null, Azure.Core.ResourceIdentifier sqlInstanceSdsArmId = null, string sqlEdition = null, string sqlVersion = null, int? numberOfCoresAllocated = default(int?), double? percentageCoresUtilization = default(double?), System.Collections.Generic.IEnumerable logicalDisks = null, Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceDatabaseSummary databaseSummary = null, double? confidenceRatingInPercentage = default(double?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? sizingCriterion = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.AssessedSqlMachineData AssessedSqlMachineData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string biosGuid = null, string fqdn = null, System.Collections.Generic.IEnumerable sqlInstances = null, Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail? suitabilityDetail = default(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail?), Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation? suitabilityExplanation = default(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation?), Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize? recommendedVmSize = default(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize?), Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily? recommendedVmFamily = default(Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily?), Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus productSupportStatus = null, int? recommendedVmSizeNumberOfCores = default(int?), double? recommendedVmSizeMegabytesOfMemory = default(double?), double? monthlyComputeCost = default(double?), System.Collections.Generic.IReadOnlyDictionary disks = null, System.Collections.Generic.IReadOnlyDictionary networkAdapters = null, double? monthlyBandwidthCost = default(double?), double? monthlyStorageCost = default(double?), System.Collections.Generic.IEnumerable costComponents = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? securitySuitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?), System.Collections.Generic.IEnumerable migrationGuidelines = null, Azure.ResourceManager.Migration.Assessment.Models.MachineBootType? bootType = default(Azure.ResourceManager.Migration.Assessment.Models.MachineBootType?), string operatingSystemType = null, string operatingSystemName = null, string operatingSystemVersion = null, Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture? operatingSystemArchitecture = default(Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), string displayName = null, Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType? typePropertiesType = default(Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType?), string description = null, Azure.Core.ResourceIdentifier datacenterMachineArmId = null, Azure.Core.ResourceIdentifier datacenterManagementServerArmId = null, string datacenterManagementServerName = null, double? megabytesOfMemory = default(double?), int? numberOfCores = default(int?), double? confidenceRatingInPercentage = default(double?), double? percentageCoresUtilization = default(double?), double? percentageMemoryUtilization = default(double?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? suitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? sizingCriterion = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.AssessedSqlRecommendedEntityData AssessedSqlRecommendedEntityData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string machineName = null, string instanceName = null, Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus productSupportStatus = null, int? dbCount = default(int?), int? discoveredDBCount = default(int?), bool? hasScanOccurred = default(bool?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? recommendedAzureSqlTargetType = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType?), Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability? recommendedSuitability = default(Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability?), Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails azureSqlMISuitabilityDetails = null, Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails azureSqlDBSuitabilityDetails = null, Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2IaasSuitabilityDetails azureSqlVmSuitabilityDetails = null, Azure.Core.ResourceIdentifier assessedSqlEntityArmId = null, bool? isClustered = default(bool?), bool? isHighAvailabilityEnabled = default(bool?), string sqlEdition = null, string sqlVersion = null, Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? sizingCriterion = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentErrorSummary AssessmentErrorSummary(Azure.ResourceManager.Migration.Assessment.Models.AssessmentType? assessmentType = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentType?), int? count = default(int?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentReportDownloadUri AssessmentReportDownloadUri(System.Uri assessmentReportUri = null, System.DateTimeOffset expireOn = default(System.DateTimeOffset)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsAssessedDisk AvsAssessedDisk(string name = null, string displayName = null, double? gigabytesProvisioned = default(double?), double? megabytesPerSecondOfRead = default(double?), double? megabytesPerSecondOfWrite = default(double?), double? numberOfReadOperationsPerSecond = default(double?), double? numberOfWriteOperationsPerSecond = default(double?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsAssessedNetworkAdapter AvsAssessedNetworkAdapter(string macAddress = null, System.Collections.Generic.IEnumerable ipAddresses = null, string displayName = null, double? megabytesPerSecondReceived = default(double?), double? megabytesPerSecondTransmitted = default(double?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDto AzureManagedDiskSkuDto(Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType? diskType = default(Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType?), Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize? diskSize = default(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize?), Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskRedundancy? diskRedundancy = default(Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskRedundancy?), double? storageCost = default(double?), double? recommendedSizeInGib = default(double?), double? recommendedThroughputInMbps = default(double?), double? recommendedIops = default(double?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlIaasSkuDto AzureSqlIaasSkuDto(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSkuDto virtualMachineSize = null, System.Collections.Generic.IEnumerable dataDiskSizes = null, System.Collections.Generic.IEnumerable logDiskSizes = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? azureSqlTargetType = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPaasSkuDto AzureSqlPaasSkuDto(Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier? azureSqlServiceTier = default(Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier? azureSqlComputeTier = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration? azureSqlHardwareGeneration = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration?), double? storageMaxSizeInMB = default(double?), double? predictedDataSizeInMB = default(double?), double? predictedLogSizeInMB = default(double?), int? cores = default(int?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? azureSqlTargetType = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSkuDto AzureVmSkuDto(Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily? azureVmFamily = default(Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily?), int? cores = default(int?), Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize? azureSkuName = default(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize?), int? availableCores = default(int?), int? maxNetworkInterfaces = default(int?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.CostComponent CostComponent(Azure.ResourceManager.Migration.Assessment.Models.CostComponentName? name = default(Azure.ResourceManager.Migration.Assessment.Models.CostComponentName?), double? value = default(double?), string description = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.ImpactedAssessmentObject ImpactedAssessmentObject(string objectName = null, string objectType = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentData MigrationAssessmentAssessmentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? provisioningState = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState?), System.Collections.Generic.IReadOnlyDictionary assessmentErrorSummary = null, double? monthlyUltraStorageCost = default(double?), System.Collections.Generic.IEnumerable costComponents = null, string eaSubscriptionId = null, Azure.ResourceManager.Migration.Assessment.Models.AzurePricingTier? azurePricingTier = default(Azure.ResourceManager.Migration.Assessment.Models.AzurePricingTier?), Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy? azureStorageRedundancy = default(Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy?), Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance? reservedInstance = default(Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance?), Azure.ResourceManager.Migration.Assessment.Models.AzureHybridUseBenefit? azureHybridUseBenefit = default(Azure.ResourceManager.Migration.Assessment.Models.AzureHybridUseBenefit?), System.Collections.Generic.IEnumerable azureDiskTypes = null, System.Collections.Generic.IEnumerable azureVmFamilies = null, System.Collections.Generic.IReadOnlyDictionary distributionBySupportStatus = null, System.Collections.Generic.IReadOnlyDictionary distributionByServicePackInsight = null, System.Collections.Generic.IReadOnlyDictionary distributionByOSName = null, double? monthlyComputeCost = default(double?), double? monthlyBandwidthCost = default(double?), double? monthlyStorageCost = default(double?), double? monthlyPremiumStorageCost = default(double?), double? monthlyStandardSsdStorageCost = default(double?), System.Collections.Generic.IReadOnlyDictionary suitabilitySummary = null, int? numberOfMachines = default(int?), Azure.ResourceManager.Migration.Assessment.Models.VmUptime vmUptime = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType? groupType = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentType? assessmentType = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentType?), Azure.Core.AzureLocation? azureLocation = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode? azureOfferCode = default(Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode?), Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency? currency = default(Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency?), double? scalingFactor = default(double?), Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization? percentile = default(Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange? timeRange = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange?), System.DateTimeOffset? perfDataStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? perfDataEndOn = default(System.DateTimeOffset?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage? stage = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage?), double? discountPercentage = default(double?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? sizingCriterion = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion?), double? confidenceRatingInPercentage = default(double?), System.DateTimeOffset? pricesQueriedOn = default(System.DateTimeOffset?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus? status = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus?), string schemaVersion = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentOptionData MigrationAssessmentAssessmentOptionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable vmFamilies = null, System.Collections.Generic.IEnumerable reservedInstanceVmFamilies = null, System.Collections.Generic.IEnumerable reservedInstanceSupportedLocations = null, System.Collections.Generic.IEnumerable reservedInstanceSupportedCurrencies = null, System.Collections.Generic.IEnumerable reservedInstanceSupportedOffers = null, System.Collections.Generic.IEnumerable ultraDiskVmFamilies = null, System.Collections.Generic.IEnumerable premiumDiskVmFamilies = null, System.Collections.Generic.IEnumerable savingsPlanVmFamilies = null, System.Collections.Generic.IEnumerable savingsPlanSupportedLocations = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectData MigrationAssessmentAssessmentProjectData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? provisioningState = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState?), System.DateTimeOffset? createOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), string serviceEndpoint = null, string assessmentSolutionId = null, Azure.ResourceManager.Migration.Assessment.Models.AssessmentProjectStatus? projectStatus = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentProjectStatus?), string customerWorkspaceId = null, string customerWorkspaceLocation = null, string publicNetworkAccess = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.Core.ResourceIdentifier customerStorageAccountArmId = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAssessmentProjectSummaryData MigrationAssessmentAssessmentProjectSummaryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable errorSummaryAffectedEntities = null, int? numberOfPrivateEndpointConnections = default(int?), int? numberOfGroups = default(int?), int? numberOfMachines = default(int?), int? numberOfImportMachines = default(int?), int? numberOfAssessments = default(int?), System.DateTimeOffset? lastAssessedOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessedMachineData MigrationAssessmentAvsAssessedMachineData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable errors = null, System.Collections.Generic.IReadOnlyDictionary disks = null, System.Collections.Generic.IReadOnlyDictionary networkAdapters = null, double? storageInUseGB = default(double?), Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityExplanation? suitabilityExplanation = default(Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityExplanation?), Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail? suitabilityDetail = default(Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail?), Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType? typePropertiesType = default(Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType?), Azure.ResourceManager.Migration.Assessment.Models.MachineBootType? bootType = default(Azure.ResourceManager.Migration.Assessment.Models.MachineBootType?), string operatingSystemType = null, string operatingSystemName = null, string operatingSystemVersion = null, Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture? operatingSystemArchitecture = default(Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), string displayName = null, string description = null, Azure.Core.ResourceIdentifier datacenterMachineArmId = null, Azure.Core.ResourceIdentifier datacenterManagementServerArmId = null, string datacenterManagementServerName = null, double? megabytesOfMemory = default(double?), int? numberOfCores = default(int?), double? confidenceRatingInPercentage = default(double?), double? percentageCoresUtilization = default(double?), double? percentageMemoryUtilization = default(double?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? suitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentData MigrationAssessmentAvsAssessmentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? provisioningState = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState?), System.Collections.Generic.IReadOnlyDictionary assessmentErrorSummary = null, Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel? failuresToTolerateAndRaidLevel = default(Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel?), double? vcpuOversubscription = default(double?), Azure.ResourceManager.Migration.Assessment.Models.AvsNodeType? nodeType = default(Azure.ResourceManager.Migration.Assessment.Models.AvsNodeType?), Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance? reservedInstance = default(Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance?), double? totalMonthlyCost = default(double?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? suitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?), Azure.ResourceManager.Migration.Assessment.Models.AvsSuitabilityExplanation? suitabilityExplanation = default(Azure.ResourceManager.Migration.Assessment.Models.AvsSuitabilityExplanation?), int? numberOfNodes = default(int?), double? cpuUtilization = default(double?), double? ramUtilization = default(double?), double? storageUtilization = default(double?), double? totalCpuCores = default(double?), double? totalRamInGB = default(double?), double? totalStorageInGB = default(double?), int? numberOfMachines = default(int?), System.Collections.Generic.IReadOnlyDictionary suitabilitySummary = null, double? memOvercommit = default(double?), double? dedupeCompression = default(double?), string limitingFactor = null, bool? isStretchClusterEnabled = default(bool?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType? groupType = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentType? assessmentType = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentType?), Azure.Core.AzureLocation? azureLocation = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode? azureOfferCode = default(Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode?), Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency? currency = default(Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency?), double? scalingFactor = default(double?), Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization? percentile = default(Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange? timeRange = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange?), System.DateTimeOffset? perfDataStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? perfDataEndOn = default(System.DateTimeOffset?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage? stage = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage?), double? discountPercentage = default(double?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? sizingCriterion = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion?), double? confidenceRatingInPercentage = default(double?), System.DateTimeOffset? pricesQueriedOn = default(System.DateTimeOffset?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus? status = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus?), string schemaVersion = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentAvsAssessmentOptionData MigrationAssessmentAvsAssessmentOptionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable avsNodes = null, System.Collections.Generic.IEnumerable failuresToTolerateAndRaidLevelValues = null, System.Collections.Generic.IEnumerable reservedInstanceAvsNodes = null, System.Collections.Generic.IEnumerable reservedInstanceSupportedLocations = null, System.Collections.Generic.IEnumerable reservedInstanceSupportedCurrencies = null, System.Collections.Generic.IEnumerable reservedInstanceSupportedOffers = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentDisk MigrationAssessmentDisk(double? gigabytesAllocated = default(double?), string displayName = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentError MigrationAssessmentError(int? id = default(int?), string code = null, string runAsAccountId = null, string applianceName = null, string message = null, string summaryMessage = null, string agentScenario = null, string possibleCauses = null, string recommendedAction = null, string severity = null, System.Collections.Generic.IReadOnlyDictionary messageParameters = null, System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), string impactedAssessmentType = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentGroupData MigrationAssessmentGroupData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? provisioningState = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus? groupStatus = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus?), int? machineCount = default(int?), System.Collections.Generic.IEnumerable assessments = null, System.Collections.Generic.IEnumerable supportedAssessmentTypes = null, bool? areAssessmentsRunning = default(bool?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType? groupType = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentHyperVCollectorData MigrationAssessmentHyperVCollectorData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? provisioningState = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState?), Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentPropertiesBase agentProperties = null, string discoverySiteId = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentImportCollectorData MigrationAssessmentImportCollectorData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? provisioningState = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState?), string discoverySiteId = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentMachineData MigrationAssessmentMachineData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migration.Assessment.Models.WorkloadSummary workloadSummary = null, System.Collections.Generic.IEnumerable errors = null, Azure.ResourceManager.Migration.Assessment.Models.ProcessorInfo hostProcessor = null, Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus productSupportStatus = null, Azure.Core.ResourceIdentifier discoveryMachineArmId = null, Azure.Core.ResourceIdentifier datacenterManagementServerArmId = null, string datacenterManagementServerName = null, Azure.ResourceManager.Migration.Assessment.Models.MachineBootType? bootType = default(Azure.ResourceManager.Migration.Assessment.Models.MachineBootType?), string displayName = null, double? megabytesOfMemory = default(double?), int? numberOfCores = default(int?), string operatingSystemType = null, string operatingSystemName = null, string operatingSystemVersion = null, string description = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.Collections.Generic.IReadOnlyDictionary disks = null, System.Collections.Generic.IEnumerable groups = null, System.Collections.Generic.IReadOnlyDictionary networkAdapters = null, System.Collections.Generic.IEnumerable sqlInstances = null, System.Collections.Generic.IEnumerable webApplications = null, System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentNetworkAdapter MigrationAssessmentNetworkAdapter(string macAddress = null, System.Collections.Generic.IEnumerable ipAddresses = null, string displayName = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateEndpointConnectionData MigrationAssessmentPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable groupIds = null, Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentPrivateLinkResourceData MigrationAssessmentPrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentServerCollectorData MigrationAssessmentServerCollectorData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? provisioningState = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState?), Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentPropertiesBase agentProperties = null, string discoverySiteId = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentOptionData MigrationAssessmentSqlAssessmentOptionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable vmFamilies = null, System.Collections.Generic.IEnumerable reservedInstanceVmFamilies = null, System.Collections.Generic.IEnumerable premiumDiskVmFamilies = null, System.Collections.Generic.IEnumerable savingsPlanVmFamilies = null, System.Collections.Generic.IEnumerable savingsPlanSupportedLocations = null, System.Collections.Generic.IEnumerable savingsPlanSupportedLocationsForPaas = null, System.Collections.Generic.IEnumerable reservedInstanceSupportedLocationsForIaas = null, System.Collections.Generic.IEnumerable savingsPlanSupportedOffers = null, System.Collections.Generic.IEnumerable sqlSkus = null, System.Collections.Generic.IEnumerable reservedInstanceSqlTargets = null, System.Collections.Generic.IEnumerable reservedInstanceSupportedLocations = null, System.Collections.Generic.IEnumerable reservedInstanceSupportedCurrencies = null, System.Collections.Generic.IEnumerable reservedInstanceSupportedOffers = null, System.Collections.Generic.IEnumerable supportedOffers = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2Data MigrationAssessmentSqlAssessmentV2Data(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? provisioningState = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentOSLicense? osLicense = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentOSLicense?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentEnvironmentType? environmentType = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentEnvironmentType?), Azure.ResourceManager.Migration.Assessment.Models.EntityUptime entityUptime = null, Azure.ResourceManager.Migration.Assessment.Models.SqlOptimizationLogic? optimizationLogic = default(Azure.ResourceManager.Migration.Assessment.Models.SqlOptimizationLogic?), Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance? reservedInstanceForVm = default(Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance?), Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode? azureOfferCodeForVm = default(Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode?), string eaSubscriptionId = null, Azure.ResourceManager.Migration.Assessment.Models.SqlMISettings azureSqlManagedInstanceSettings = null, Azure.ResourceManager.Migration.Assessment.Models.SqlDBSettings azureSqlDatabaseSettings = null, System.Collections.Generic.IEnumerable azureSqlVmInstanceSeries = null, Azure.ResourceManager.Migration.Assessment.Models.MultiSubnetIntent? multiSubnetIntent = default(Azure.ResourceManager.Migration.Assessment.Models.MultiSubnetIntent?), Azure.ResourceManager.Migration.Assessment.Models.AsyncCommitModeIntent? asyncCommitModeIntent = default(Azure.ResourceManager.Migration.Assessment.Models.AsyncCommitModeIntent?), bool? isInternetAccessAvailable = default(bool?), Azure.Core.AzureLocation? disasterRecoveryLocation = default(Azure.Core.AzureLocation?), bool? enableHadrAssessment = default(bool?), Azure.ResourceManager.Migration.Assessment.Models.AzureSecurityOfferingType? azureSecurityOfferingType = default(Azure.ResourceManager.Migration.Assessment.Models.AzureSecurityOfferingType?), Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance? reservedInstance = default(Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance?), Azure.ResourceManager.Migration.Assessment.Models.SqlServerLicense? sqlServerLicense = default(Azure.ResourceManager.Migration.Assessment.Models.SqlServerLicense?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType? groupType = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentType? assessmentType = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentType?), Azure.Core.AzureLocation? azureLocation = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode? azureOfferCode = default(Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode?), Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency? currency = default(Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency?), double? scalingFactor = default(double?), Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization? percentile = default(Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange? timeRange = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange?), System.DateTimeOffset? perfDataStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? perfDataEndOn = default(System.DateTimeOffset?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage? stage = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage?), double? discountPercentage = default(double?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion? sizingCriterion = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion?), double? confidenceRatingInPercentage = default(double?), System.DateTimeOffset? pricesQueriedOn = default(System.DateTimeOffset?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus? status = default(Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus?), string schemaVersion = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlAssessmentV2SummaryData MigrationAssessmentSqlAssessmentV2SummaryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IReadOnlyDictionary assessmentSummary = null, System.Collections.Generic.IReadOnlyDictionary distributionBySupportStatus = null, System.Collections.Generic.IReadOnlyDictionary distributionByServicePackInsight = null, System.Collections.Generic.IReadOnlyDictionary distributionBySqlVersion = null, System.Collections.Generic.IReadOnlyDictionary distributionBySqlEdition = null, System.Collections.Generic.IReadOnlyDictionary instanceDistributionBySizingCriterion = null, System.Collections.Generic.IReadOnlyDictionary databaseDistributionBySizingCriterion = null, int? numberOfMachines = default(int?), int? numberOfSqlInstances = default(int?), int? numberOfSuccessfullyDiscoveredSqlInstances = default(int?), int? numberOfSqlDatabases = default(int?), int? numberOfFciInstances = default(int?), int? numberOfSqlAvailabilityGroups = default(int?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentSqlCollectorData MigrationAssessmentSqlCollectorData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? provisioningState = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState?), Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentPropertiesBase agentProperties = null, string discoverySiteId = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.MigrationAssessmentVMwareCollectorData MigrationAssessmentVMwareCollectorData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? provisioningState = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState?), Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentPropertiesBase agentProperties = null, string discoverySiteId = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationGuidelineContext MigrationGuidelineContext(string contextKey = null, string contextValue = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus ProductSupportStatus(string currentVersion = null, string servicePackStatus = null, string esuStatus = null, string supportStatus = null, int? eta = default(int?), string currentEsuYear = null, System.DateTimeOffset? mainstreamEndOn = default(System.DateTimeOffset?), System.DateTimeOffset? extendedSupportEndOn = default(System.DateTimeOffset?), System.DateTimeOffset? extendedSecurityUpdateYear1EndOn = default(System.DateTimeOffset?), System.DateTimeOffset? extendedSecurityUpdateYear2EndOn = default(System.DateTimeOffset?), System.DateTimeOffset? extendedSecurityUpdateYear3EndOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SharedResourcesDto SharedResourcesDto(System.Collections.Generic.IEnumerable sharedDataDisks = null, System.Collections.Generic.IEnumerable sharedLogDisks = null, System.Collections.Generic.IEnumerable sharedTempDBDisks = null, int? numberOfMounts = default(int?), Azure.ResourceManager.Migration.Assessment.Models.AzureQuorumWitnessDtoQuorumWitnessType? quorumWitnessType = default(Azure.ResourceManager.Migration.Assessment.Models.AzureQuorumWitnessDtoQuorumWitnessType?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlAssessedNetworkAdapter SqlAssessedNetworkAdapter(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? suitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?), Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail? suitabilityDetail = default(Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail?), Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation? suitabilityExplanation = default(Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation?), double? monthlyBandwidthCosts = default(double?), double? netGigabytesTransmittedPerMonth = default(double?), string name = null, string displayName = null, string macAddress = null, System.Collections.Generic.IEnumerable ipAddresses = null, double? megabytesPerSecondReceived = default(double?), double? megabytesPerSecondTransmitted = default(double?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssue SqlAssessmentMigrationIssue(string issueId = null, Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssueCategory? issueCategory = default(Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssueCategory?), System.Collections.Generic.IEnumerable impactedObjects = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2IaasSuitabilityDetails SqlAssessmentV2IaasSuitabilityDetails(Azure.ResourceManager.Migration.Assessment.Models.AzureSqlIaasSkuDto azureSqlSku = null, System.Collections.Generic.IEnumerable replicaAzureSqlSku = null, Azure.ResourceManager.Migration.Assessment.Models.SharedResourcesDto sharedResources = null, double? monthlyComputeCost = default(double?), double? monthlyStorageCost = default(double?), System.Collections.Generic.IEnumerable costComponents = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? securitySuitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?), bool? shouldProvisionReplicas = default(bool?), Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode? skuReplicationMode = default(Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode?), System.Collections.Generic.IEnumerable migrationGuidelines = null, System.Collections.Generic.IEnumerable recommendationReasonings = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? migrationTargetPlatform = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? suitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?), System.Collections.Generic.IEnumerable migrationIssues = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails SqlAssessmentV2PaasSuitabilityDetails(Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPaasSkuDto azureSqlSku = null, System.Collections.Generic.IEnumerable replicaAzureSqlSku = null, Azure.ResourceManager.Migration.Assessment.Models.SharedResourcesDto sharedResources = null, double? monthlyComputeCost = default(double?), double? monthlyStorageCost = default(double?), System.Collections.Generic.IEnumerable costComponents = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? securitySuitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?), bool? shouldProvisionReplicas = default(bool?), Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode? skuReplicationMode = default(Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode?), System.Collections.Generic.IEnumerable migrationGuidelines = null, System.Collections.Generic.IEnumerable recommendationReasonings = null, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? migrationTargetPlatform = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType?), Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? suitability = default(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability?), System.Collections.Generic.IEnumerable migrationIssues = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2SummaryDetails SqlAssessmentV2SummaryDetails(System.Collections.Generic.IReadOnlyDictionary suitabilitySummary = null, double? monthlyComputeCost = default(double?), double? monthlyStorageCost = default(double?), double? monthlyLicenseCost = default(double?), double? confidenceScore = default(double?), double? monthlySecurityCost = default(double?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlAvailabilityGroupDataOverview SqlAvailabilityGroupDataOverview(string availabilityGroupId = null, string availabilityGroupName = null, Azure.Core.ResourceIdentifier sqlAvailabilityGroupSdsArmId = null, string sqlAvailabilityGroupEntityId = null, string sqlAvailabilityReplicaId = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlAvailabilityReplicaSummary SqlAvailabilityReplicaSummary(int? numberOfSynchronousReadReplicas = default(int?), int? numberOfSynchronousNonReadReplicas = default(int?), int? numberOfAsynchronousReadReplicas = default(int?), int? numberOfAsynchronousNonReadReplicas = default(int?), int? numberOfPrimaryReplicas = default(int?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadata SqlFciMetadata(Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState? state = default(Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState?), bool? isMultiSubnet = default(bool?), int? fciSharedDiskCount = default(int?)) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuideline SqlMigrationGuideline(string guidelineId = null, Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuidelineCategory? migrationGuidelineCategory = default(Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuidelineCategory?), System.Collections.Generic.IEnumerable migrationGuidelineContext = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlRecommendationReasoning SqlRecommendationReasoning(string reasoningId = null, string reasoningString = null, string reasoningCategory = null, System.Collections.Generic.IEnumerable contextParameters = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlRecommendationReasoningContext SqlRecommendationReasoningContext(string contextKey = null, string contextValue = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.UltraDiskAssessmentConfig UltraDiskAssessmentConfig(string familyName = null, System.Collections.Generic.IEnumerable targetLocations = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.VmFamilyConfig VmFamilyConfig(string familyName = null, System.Collections.Generic.IEnumerable targetLocations = null, System.Collections.Generic.IEnumerable category = null) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.WorkloadSummary WorkloadSummary(int? oracleInstances = default(int?), int? springApps = default(int?)) { throw null; } + } + public partial class AssessedDataDisk : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssessedDataDisk() { } + public string DisplayName { get { throw null; } } + public double? GigabytesProvisioned { get { throw null; } } + public double? MegabytesPerSecondOfRead { get { throw null; } } + public double? MegabytesPerSecondOfWrite { get { throw null; } } + public double? MonthlyStorageCost { get { throw null; } } + public string Name { get { throw null; } } + public double? NumberOfReadOperationsPerSecond { get { throw null; } } + public double? NumberOfWriteOperationsPerSecond { get { throw null; } } + public double? RecommendDiskThroughputInMbps { get { throw null; } } + public double? RecommendedDiskIops { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize? RecommendedDiskSize { get { throw null; } } + public int? RecommendedDiskSizeGigabytes { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType? RecommendedDiskType { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? Suitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail? SuitabilityDetail { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation? SuitabilityExplanation { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedDataDisk System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedDataDisk System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedDisk : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssessedDisk() { } + public string DisplayName { get { throw null; } } + public int? GigabytesForRecommendedDiskSize { get { throw null; } } + public double? GigabytesProvisioned { get { throw null; } } + public double? MegabytesPerSecondOfRead { get { throw null; } } + public double? MegabytesPerSecondOfWrite { get { throw null; } } + public double? MonthlyStorageCost { get { throw null; } } + public string Name { get { throw null; } } + public double? NumberOfReadOperationsPerSecond { get { throw null; } } + public double? NumberOfWriteOperationsPerSecond { get { throw null; } } + public double? RecommendDiskThroughputInMbps { get { throw null; } } + public double? RecommendedDiskIops { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize? RecommendedDiskSize { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType? RecommendedDiskType { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? Suitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail? SuitabilityDetail { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation? SuitabilityExplanation { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedDisk System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedDisk System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AssessedMachineType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AssessedMachineType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType AssessedMachine { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType AvsAssessedMachine { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType SqlAssessedMachine { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType 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.Migration.Assessment.Models.AssessedMachineType left, Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType left, Azure.ResourceManager.Migration.Assessment.Models.AssessedMachineType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AssessedNetworkAdapter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssessedNetworkAdapter() { } + public string DisplayName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList IPAddresses { get { throw null; } } + public string MacAddress { get { throw null; } } + public double? MegabytesPerSecondReceived { get { throw null; } } + public double? MegabytesPerSecondTransmitted { get { throw null; } } + public double? MonthlyBandwidthCosts { get { throw null; } } + public double? NetGigabytesTransmittedPerMonth { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? Suitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail? SuitabilityDetail { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation? SuitabilityExplanation { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedNetworkAdapter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedNetworkAdapter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedSqlInstanceDatabaseSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssessedSqlInstanceDatabaseSummary() { } + public double? LargestDatabaseSizeInMB { get { throw null; } } + public int? NumberOfUserDatabases { get { throw null; } } + public double? TotalDatabaseSizeInMB { get { throw null; } } + public int? TotalDiscoveredUserDatabases { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceDatabaseSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceDatabaseSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedSqlInstanceDiskDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssessedSqlInstanceDiskDetails() { } + public string DiskId { get { throw null; } } + public double? DiskSizeInMB { get { throw null; } } + public double? MegabytesPerSecondOfRead { get { throw null; } } + public double? MegabytesPerSecondOfWrite { get { throw null; } } + public double? NumberOfReadOperationsPerSecond { get { throw null; } } + public double? NumberOfWriteOperationsPerSecond { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceDiskDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceDiskDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedSqlInstanceStorageDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssessedSqlInstanceStorageDetails() { } + public double? DiskSizeInMB { get { throw null; } } + public double? MegabytesPerSecondOfRead { get { throw null; } } + public double? MegabytesPerSecondOfWrite { get { throw null; } } + public double? NumberOfReadOperationsPerSecond { get { throw null; } } + public double? NumberOfWriteOperationsPerSecond { get { throw null; } } + public string StorageType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceStorageDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceStorageDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AssessedSqlInstanceSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssessedSqlInstanceSummary() { } + public string InstanceId { get { throw null; } } + public string InstanceName { get { throw null; } } + public bool? IsClustered { get { throw null; } } + public bool? IsHighAvailabilityEnabled { get { throw null; } } + public string SqlEdition { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlFciState? SqlFciState { get { throw null; } } + public string SqlInstanceEntityId { get { throw null; } } + public Azure.Core.ResourceIdentifier SqlInstanceSdsArmId { get { throw null; } } + public string SqlVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessedSqlInstanceSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AssessmentEnvironmentType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AssessmentEnvironmentType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentEnvironmentType Production { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentEnvironmentType Test { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AssessmentEnvironmentType 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.Migration.Assessment.Models.AssessmentEnvironmentType left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentEnvironmentType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AssessmentEnvironmentType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AssessmentEnvironmentType left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentEnvironmentType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AssessmentErrorSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssessmentErrorSummary() { } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentType? AssessmentType { get { throw null; } } + public int? Count { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessmentErrorSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessmentErrorSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AssessmentProjectStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AssessmentProjectStatus(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentProjectStatus Active { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentProjectStatus Inactive { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AssessmentProjectStatus 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.Migration.Assessment.Models.AssessmentProjectStatus left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentProjectStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AssessmentProjectStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AssessmentProjectStatus left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentProjectStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AssessmentReportDownloadUri : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AssessmentReportDownloadUri() { } + public System.Uri AssessmentReportUri { get { throw null; } } + public System.DateTimeOffset ExpireOn { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessmentReportDownloadUri System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AssessmentReportDownloadUri System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AssessmentSizingCriterion : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AssessmentSizingCriterion(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion AsOnPremises { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion PerformanceBased { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion 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.Migration.Assessment.Models.AssessmentSizingCriterion left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentSizingCriterion right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AssessmentStage : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AssessmentStage(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage Approved { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage InProgress { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage UnderReview { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage 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.Migration.Assessment.Models.AssessmentStage left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentStage right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AssessmentStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AssessmentStatus(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus Completed { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus Created { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus Deleted { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus Invalid { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus OutDated { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus OutOfSync { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus Running { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus Updated { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus 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.Migration.Assessment.Models.AssessmentStatus left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AssessmentTimeRange : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AssessmentTimeRange(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange Custom { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange Day { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange Month { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange Week { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange 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.Migration.Assessment.Models.AssessmentTimeRange left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentTimeRange right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AssessmentType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AssessmentType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentType AvsAssessment { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentType MachineAssessment { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentType SqlAssessment { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentType Unknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AssessmentType WebAppAssessment { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AssessmentType 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.Migration.Assessment.Models.AssessmentType left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AssessmentType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AssessmentType left, Azure.ResourceManager.Migration.Assessment.Models.AssessmentType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AsyncCommitModeIntent : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AsyncCommitModeIntent(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AsyncCommitModeIntent DisasterRecovery { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AsyncCommitModeIntent HighAvailability { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AsyncCommitModeIntent None { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AsyncCommitModeIntent 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.Migration.Assessment.Models.AsyncCommitModeIntent left, Azure.ResourceManager.Migration.Assessment.Models.AsyncCommitModeIntent right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AsyncCommitModeIntent (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AsyncCommitModeIntent left, Azure.ResourceManager.Migration.Assessment.Models.AsyncCommitModeIntent right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AvsAssessedDisk : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvsAssessedDisk() { } + public string DisplayName { get { throw null; } } + public double? GigabytesProvisioned { get { throw null; } } + public double? MegabytesPerSecondOfRead { get { throw null; } } + public double? MegabytesPerSecondOfWrite { get { throw null; } } + public string Name { get { throw null; } } + public double? NumberOfReadOperationsPerSecond { get { throw null; } } + public double? NumberOfWriteOperationsPerSecond { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AvsAssessedDisk System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AvsAssessedDisk System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AvsAssessedNetworkAdapter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AvsAssessedNetworkAdapter() { } + public string DisplayName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList IPAddresses { get { throw null; } } + public string MacAddress { get { throw null; } } + public double? MegabytesPerSecondReceived { get { throw null; } } + public double? MegabytesPerSecondTransmitted { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AvsAssessedNetworkAdapter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AvsAssessedNetworkAdapter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AvsNodeType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AvsNodeType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsNodeType AV36 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsNodeType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AvsNodeType 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.Migration.Assessment.Models.AvsNodeType left, Azure.ResourceManager.Migration.Assessment.Models.AvsNodeType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AvsNodeType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AvsNodeType left, Azure.ResourceManager.Migration.Assessment.Models.AvsNodeType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AvsSkuConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AvsSkuConfig() { } + public Azure.ResourceManager.Migration.Assessment.Models.AvsNodeType? NodeType { get { throw null; } set { } } + public System.Collections.Generic.IList TargetLocations { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AvsSkuConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AvsSkuConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AvsSuitabilityExplanation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AvsSuitabilityExplanation(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsSuitabilityExplanation NotApplicable { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsSuitabilityExplanation Unknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsSuitabilityExplanation UnsupportedLocationForSelectedNode { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AvsSuitabilityExplanation 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.Migration.Assessment.Models.AvsSuitabilityExplanation left, Azure.ResourceManager.Migration.Assessment.Models.AvsSuitabilityExplanation right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AvsSuitabilityExplanation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AvsSuitabilityExplanation left, Azure.ResourceManager.Migration.Assessment.Models.AvsSuitabilityExplanation right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AvsVmSuitabilityDetail : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AvsVmSuitabilityDetail(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail None { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail PercentageOfCoresUtilizedMissing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail PercentageOfCoresUtilizedOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail PercentageOfMemoryUtilizedMissing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail PercentageOfMemoryUtilizedOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail PercentageOfStorageUtilizedOutOfRange { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail 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.Migration.Assessment.Models.AvsVmSuitabilityDetail left, Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail left, Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityDetail right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AvsVmSuitabilityExplanation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AvsVmSuitabilityExplanation(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityExplanation IPV6NotSupported { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityExplanation NotApplicable { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityExplanation Unknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityExplanation UnsupportedOperatingSystem { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityExplanation 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.Migration.Assessment.Models.AvsVmSuitabilityExplanation left, Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityExplanation right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityExplanation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityExplanation left, Azure.ResourceManager.Migration.Assessment.Models.AvsVmSuitabilityExplanation right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureCurrency : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureCurrency(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency ARS { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency AUD { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency BRL { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency CAD { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency CHF { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency CNY { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency DKK { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency EUR { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency GBP { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency HKD { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency IdR { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency INR { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency JPY { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency KRW { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency MXN { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency MYR { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency NOK { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency NZD { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency RUB { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency SAR { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency SEK { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency TRY { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency TWD { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency Unknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency USD { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency ZAR { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency 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.Migration.Assessment.Models.AzureCurrency left, Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency left, Azure.ResourceManager.Migration.Assessment.Models.AzureCurrency right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureDiskSize : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureDiskSize(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP1 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP10 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP15 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP20 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP30 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP40 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP50 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP6 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP60 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP70 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumP80 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize PremiumV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardS10 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardS15 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardS20 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardS30 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardS4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardS40 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardS50 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardS6 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardS60 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardS70 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardS80 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE1 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE10 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE15 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE20 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE30 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE40 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE50 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE6 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE60 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE70 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize StandardSsdE80 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize Ultra { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize 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.Migration.Assessment.Models.AzureDiskSize left, Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize left, Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureDiskSuitabilityDetail : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureDiskSuitabilityDetail(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail DiskGigabytesConsumedMissing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail DiskGigabytesConsumedOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail DiskGigabytesProvisionedMissing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail DiskGigabytesProvisionedOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail MegabytesPerSecondOfReadMissing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail MegabytesPerSecondOfReadOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail MegabytesPerSecondOfWriteMissing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail MegabytesPerSecondOfWriteOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail None { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail NumberOfReadOperationsPerSecondMissing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail NumberOfReadOperationsPerSecondOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail NumberOfWriteOperationsPerSecondMissing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail NumberOfWriteOperationsPerSecondOutOfRange { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail 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.Migration.Assessment.Models.AzureDiskSuitabilityDetail left, Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail left, Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityDetail right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureDiskSuitabilityExplanation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureDiskSuitabilityExplanation(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation DiskSizeGreaterThanSupported { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation InternalErrorOccurredForDiskEvaluation { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation NoDiskSizeFoundForSelectedRedundancy { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation NoDiskSizeFoundInSelectedLocation { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation NoEAPriceFoundForDiskSize { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation NoSuitableDiskSizeForIops { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation NoSuitableDiskSizeForThroughput { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation NotApplicable { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation 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.Migration.Assessment.Models.AzureDiskSuitabilityExplanation left, Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation left, Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSuitabilityExplanation right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureDiskType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureDiskType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType Premium { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType PremiumV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType Standard { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType StandardOrPremium { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType StandardSsd { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType Ultra { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType 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.Migration.Assessment.Models.AzureDiskType left, Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType left, Azure.ResourceManager.Migration.Assessment.Models.AzureDiskType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureHybridUseBenefit : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureHybridUseBenefit(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureHybridUseBenefit No { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureHybridUseBenefit Unknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureHybridUseBenefit Yes { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureHybridUseBenefit 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.Migration.Assessment.Models.AzureHybridUseBenefit left, Azure.ResourceManager.Migration.Assessment.Models.AzureHybridUseBenefit right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureHybridUseBenefit (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureHybridUseBenefit left, Azure.ResourceManager.Migration.Assessment.Models.AzureHybridUseBenefit right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AzureManagedDiskSkuDto : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AzureManagedDiskSkuDto() { } + public Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskRedundancy? DiskRedundancy { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureDiskSize? DiskSize { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType? DiskType { get { throw null; } } + public double? RecommendedIops { get { throw null; } } + public double? RecommendedSizeInGib { get { throw null; } } + public double? RecommendedThroughputInMbps { get { throw null; } } + public double? StorageCost { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDto System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDto System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureManagedDiskSkuDtoDiskRedundancy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureManagedDiskSkuDtoDiskRedundancy(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskRedundancy Lrs { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskRedundancy Unknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskRedundancy Zrs { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskRedundancy 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.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskRedundancy left, Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskRedundancy right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskRedundancy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskRedundancy left, Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskRedundancy right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureManagedDiskSkuDtoDiskType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureManagedDiskSkuDtoDiskType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType Premium { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType PremiumV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType Standard { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType StandardOrPremium { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType StandardSsd { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType Ultra { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType 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.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType left, Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType left, Azure.ResourceManager.Migration.Assessment.Models.AzureManagedDiskSkuDtoDiskType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureNetworkAdapterSuitabilityDetail : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureNetworkAdapterSuitabilityDetail(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail MegabytesOfDataRecievedMissing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail MegabytesOfDataRecievedOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail MegabytesOfDataTransmittedMissing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail MegabytesOfDataTransmittedOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail None { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail 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.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail left, Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail left, Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureNetworkAdapterSuitabilityExplanation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureNetworkAdapterSuitabilityExplanation(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation InternalErrorOccurred { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation NotApplicable { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation 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.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation left, Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation left, Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureOfferCode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureOfferCode(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode EA { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0003P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0022P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0023P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0025P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0029P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0036P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0044P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0059P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0060P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0062P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0063P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0064P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0111P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0120P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0121P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0122P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0123P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0124P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0125P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0126P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0127P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0128P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0129P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0130P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0144P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0148P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0149P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZR0243P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZRDE0003P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZRDE0044P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSAZRUSGOV0003P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSMCAZR0044P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSMCAZR0059P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSMCAZR0060P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSMCAZR0063P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSMCAZR0120P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSMCAZR0121P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSMCAZR0125P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode MSMCAZR0128P { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode SavingsPlan1Year { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode SavingsPlan3Year { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode 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.Migration.Assessment.Models.AzureOfferCode left, Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode left, Azure.ResourceManager.Migration.Assessment.Models.AzureOfferCode right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzurePricingTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzurePricingTier(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzurePricingTier Basic { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzurePricingTier Standard { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzurePricingTier 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.Migration.Assessment.Models.AzurePricingTier left, Azure.ResourceManager.Migration.Assessment.Models.AzurePricingTier right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzurePricingTier (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzurePricingTier left, Azure.ResourceManager.Migration.Assessment.Models.AzurePricingTier right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureQuorumWitnessDtoQuorumWitnessType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureQuorumWitnessDtoQuorumWitnessType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureQuorumWitnessDtoQuorumWitnessType Cloud { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureQuorumWitnessDtoQuorumWitnessType Disk { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureQuorumWitnessDtoQuorumWitnessType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureQuorumWitnessDtoQuorumWitnessType 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.Migration.Assessment.Models.AzureQuorumWitnessDtoQuorumWitnessType left, Azure.ResourceManager.Migration.Assessment.Models.AzureQuorumWitnessDtoQuorumWitnessType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureQuorumWitnessDtoQuorumWitnessType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureQuorumWitnessDtoQuorumWitnessType left, Azure.ResourceManager.Migration.Assessment.Models.AzureQuorumWitnessDtoQuorumWitnessType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureReservedInstance : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureReservedInstance(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance None { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance RI1Year { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance RI3Year { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance 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.Migration.Assessment.Models.AzureReservedInstance left, Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance left, Azure.ResourceManager.Migration.Assessment.Models.AzureReservedInstance right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureSecurityOfferingType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureSecurityOfferingType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSecurityOfferingType MDC { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSecurityOfferingType NO { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureSecurityOfferingType 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.Migration.Assessment.Models.AzureSecurityOfferingType left, Azure.ResourceManager.Migration.Assessment.Models.AzureSecurityOfferingType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureSecurityOfferingType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureSecurityOfferingType left, Azure.ResourceManager.Migration.Assessment.Models.AzureSecurityOfferingType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureSqlDataBaseType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureSqlDataBaseType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlDataBaseType Automatic { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlDataBaseType ElasticPool { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlDataBaseType SingleDatabase { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlDataBaseType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureSqlDataBaseType 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.Migration.Assessment.Models.AzureSqlDataBaseType left, Azure.ResourceManager.Migration.Assessment.Models.AzureSqlDataBaseType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureSqlDataBaseType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureSqlDataBaseType left, Azure.ResourceManager.Migration.Assessment.Models.AzureSqlDataBaseType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AzureSqlIaasSkuDto : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AzureSqlIaasSkuDto() { } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? AzureSqlTargetType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList DataDiskSizes { get { throw null; } } + public System.Collections.Generic.IReadOnlyList LogDiskSizes { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureVmSkuDto VirtualMachineSize { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AzureSqlIaasSkuDto System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AzureSqlIaasSkuDto System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureSqlInstanceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureSqlInstanceType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlInstanceType Automatic { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlInstanceType InstancePools { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlInstanceType SingleInstance { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlInstanceType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureSqlInstanceType 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.Migration.Assessment.Models.AzureSqlInstanceType left, Azure.ResourceManager.Migration.Assessment.Models.AzureSqlInstanceType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureSqlInstanceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureSqlInstanceType left, Azure.ResourceManager.Migration.Assessment.Models.AzureSqlInstanceType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AzureSqlPaasSkuDto : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AzureSqlPaasSkuDto() { } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier? AzureSqlComputeTier { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration? AzureSqlHardwareGeneration { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier? AzureSqlServiceTier { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? AzureSqlTargetType { get { throw null; } } + public int? Cores { get { throw null; } } + public double? PredictedDataSizeInMB { get { throw null; } } + public double? PredictedLogSizeInMB { get { throw null; } } + public double? StorageMaxSizeInMB { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPaasSkuDto System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPaasSkuDto System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureSqlPurchaseModel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureSqlPurchaseModel(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPurchaseModel Dtu { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPurchaseModel Unknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPurchaseModel VCore { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPurchaseModel 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.Migration.Assessment.Models.AzureSqlPurchaseModel left, Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPurchaseModel right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPurchaseModel (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPurchaseModel left, Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPurchaseModel right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureSqlServiceTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureSqlServiceTier(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier Automatic { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier BusinessCritical { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier GeneralPurpose { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier HyperScale { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier 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.Migration.Assessment.Models.AzureSqlServiceTier left, Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier left, Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureStorageRedundancy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureStorageRedundancy(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy GeoRedundant { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy LocallyRedundant { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy ReadAccessGeoRedundant { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy Unknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy ZoneRedundant { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy 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.Migration.Assessment.Models.AzureStorageRedundancy left, Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy left, Azure.ResourceManager.Migration.Assessment.Models.AzureStorageRedundancy right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureVmFamily : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureVmFamily(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Av2Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily BasicA0A4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Dadsv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Dasv4Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Dasv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Dav4Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily DCSeries { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Ddsv4Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Ddsv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Ddv4Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Ddv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily DSeries { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily DSSeries { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily DSv2Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Dsv3Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Dsv4Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Dsv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Dv2Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Dv3Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Dv4Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Dv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Eadsv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Easv4Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Easv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Eav4Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Ebdsv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Ebsv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Edsv4Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Edsv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Edv4Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Edv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Esv3Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Esv4Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Esv5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Ev3Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Ev4Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Ev5Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily FSeries { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily FsSeries { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Fsv2Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily GSeries { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily GSSeries { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily HSeries { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily LsSeries { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Lsv2Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Mdsv2Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily MSeries { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Msv2Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Mv2Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily StandardA0A7 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily StandardA8A11 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily 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.Migration.Assessment.Models.AzureVmFamily left, Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily left, Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureVmSize : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureVmSize(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize BasicA0 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize BasicA1 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize BasicA2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize BasicA3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize BasicA4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA0 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA1 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA10 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA11 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA1V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA2MV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA2V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA4MV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA4V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA6 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA7 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA8 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA8MV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA8V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardA9 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD1 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD11 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD11V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD12 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD12V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD13 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD13V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD14 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD14V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD15V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD16V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD1V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD2V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD32V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD3V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD48AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD48AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD48AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD48AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD48DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD48DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD48DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD48DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD48SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD48SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD48V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD48V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD4V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD5V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD64V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD8V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD96AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD96AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD96AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD96AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD96DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD96DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD96SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardD96V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDC2S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDC4S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS1 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS11 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS111V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS11V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS12 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS121V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS122V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS12V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS13 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS132V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS134V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS13V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS14 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS144V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS148V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS14V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS15V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS1V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS2V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS3V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS4V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardDS5V2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE104IdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE104IdV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE104IsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE104IV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE164AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE164AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE164AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE164DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE164DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE164SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE164SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE164SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE168AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE168AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE168AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE168DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE168DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE168SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE168SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE168SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16BdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16BsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE16V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE20V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2BdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2BsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE2V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE3216AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE3216AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE3216AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE3216DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE3216DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE3216SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE3216SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE3216SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE328AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE328AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE328AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE328DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE328DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE328SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE328SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE328SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32BdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32BsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE32V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE42AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE42AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE42AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE42DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE42DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE42SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE42SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE42SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48BdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48BsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE48V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4BdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4BsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE4V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6416AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6416AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6416AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6416DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6416DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6416SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6416SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6416SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6432AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6432AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6432AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6432DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6432DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6432SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6432SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE6432SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64BdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64BsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64IsV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64IV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE64V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE80IdsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE80IsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE82AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE82AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE82AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE82DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE82DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE82SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE82SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE82SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE84AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE84AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE84AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE84DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE84DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE84SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE84SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE84SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8BdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8BsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8DsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8DV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8SV3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8SV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8V3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8V4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE8V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE9624AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE9624AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE9624AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE9624DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE9624SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE9648AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE9648AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE9648AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE9648DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE9648SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE96AdsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE96AsV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE96AsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE96AV4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE96DsV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE96DV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE96SV5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardE96V5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF1 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF16 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF16S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF16SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF1S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF2S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF2SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF32SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF48SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF4S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF4SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF64SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF72SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF8 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF8S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardF8SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardG1 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardG2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardG3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardG4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardG5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardGS1 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardGS2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardGS3 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardGS4 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardGS44 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardGS48 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardGS5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardGS516 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardGS58 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardH16 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardH16M { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardH16Mr { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardH16R { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardH8 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardH8M { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardL16S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardL16SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardL32S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardL32SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardL48SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardL4S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardL64SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardL80SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardL8S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardL8SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM128 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM12832Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM12864Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM128DmsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM128DsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM128M { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM128Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM128MsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM128S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM128SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM164Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM168Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM16Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM192IdmsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM192IdsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM192ImsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM192IsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM208MsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM208SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM3216Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM328Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM32DmsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM32Ls { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM32Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM32MsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM32Ts { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM416208MsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM416208SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM416MsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM416SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM64 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM6416Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM6432Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM64DmsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM64DsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM64Ls { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM64M { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM64Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM64MsV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM64S { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM64SV2 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM82Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM84Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize StandardM8Ms { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize 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.Migration.Assessment.Models.AzureVmSize left, Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize left, Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AzureVmSkuDto : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AzureVmSkuDto() { } + public int? AvailableCores { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureVmSize? AzureSkuName { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureVmFamily? AzureVmFamily { get { throw null; } } + public int? Cores { get { throw null; } } + public int? MaxNetworkInterfaces { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AzureVmSkuDto System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.AzureVmSkuDto System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureVmSuitabilityDetail : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureVmSuitabilityDetail(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail CannotReportBandwidthCosts { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail CannotReportComputeCost { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail CannotReportStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail None { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail PercentageOfCoresUtilizedMissing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail PercentageOfCoresUtilizedOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail PercentageOfMemoryUtilizedMissing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail PercentageOfMemoryUtilizedOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail RecommendedSizeHasLessNetworkAdapters { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail 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.Migration.Assessment.Models.AzureVmSuitabilityDetail left, Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail left, Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityDetail right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureVmSuitabilityExplanation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureVmSuitabilityExplanation(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation BootTypeNotSupported { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation BootTypeUnknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation CheckCentOSVersion { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation CheckCoreOSLinuxVersion { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation CheckDebianLinuxVersion { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation CheckOpenSuseLinuxVersion { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation CheckOracleLinuxVersion { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation CheckRedHatLinuxVersion { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation CheckSuseLinuxVersion { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation CheckUbuntuLinuxVersion { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation CheckWindowsServer2008R2Version { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation EndorsedWithConditionsLinuxDistributions { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation GuestOperatingSystemArchitectureNotSupported { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation GuestOperatingSystemNotSupported { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation GuestOperatingSystemUnknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation InternalErrorOccurredDuringComputeEvaluation { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation InternalErrorOccurredDuringNetworkEvaluation { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation InternalErrorOccurredDuringStorageEvaluation { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation MoreDisksThanSupported { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation NoEAPriceFoundForVmSize { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation NoGuestOperatingSystemConditionallySupported { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation NoSuitableVmSizeFound { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation NotApplicable { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation NoVmSizeForBasicPricingTier { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation NoVmSizeForSelectedAzureLocation { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation NoVmSizeForSelectedPricingTier { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation NoVmSizeForStandardPricingTier { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation NoVmSizeFoundForOfferCurrencyReservedInstance { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation NoVmSizeInSelectedFamilyFound { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation NoVmSizeSupportsNetworkPerformance { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation NoVmSizeSupportsStoragePerformance { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation OneOrMoreAdaptersNotSuitable { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation OneOrMoreDisksNotSuitable { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation UnendorsedLinuxDistributions { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation Unknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation WindowsClientVersionsConditionallySupported { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation WindowsOSNoLongerUnderMSSupport { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation WindowsServerVersionConditionallySupported { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation WindowsServerVersionsSupportedWithCaveat { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation 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.Migration.Assessment.Models.AzureVmSuitabilityExplanation left, Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation left, Azure.ResourceManager.Migration.Assessment.Models.AzureVmSuitabilityExplanation right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CollectorAgentPropertiesBase : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CollectorAgentPropertiesBase() { } + public string Id { get { throw null; } set { } } + public System.DateTimeOffset? LastHeartbeatOn { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentSpnPropertiesBase SpnDetails { get { throw null; } set { } } + public string Version { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentPropertiesBase System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentPropertiesBase System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CollectorAgentSpnPropertiesBase : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CollectorAgentSpnPropertiesBase() { } + public string ApplicationId { get { throw null; } set { } } + public string Audience { get { throw null; } set { } } + public string Authority { get { throw null; } set { } } + public string ObjectId { get { throw null; } set { } } + public System.Guid? TenantId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentSpnPropertiesBase System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.CollectorAgentSpnPropertiesBase System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CompatibilityLevel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CompatibilityLevel(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel CompatLevel100 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel CompatLevel110 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel CompatLevel120 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel CompatLevel130 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel CompatLevel140 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel CompatLevel150 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel CompatLevel80 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel CompatLevel90 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel 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.Migration.Assessment.Models.CompatibilityLevel left, Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel left, Azure.ResourceManager.Migration.Assessment.Models.CompatibilityLevel right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CostComponent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CostComponent() { } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.CostComponentName? Name { get { throw null; } } + public double? Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.CostComponent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.CostComponent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CostComponentName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CostComponentName(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.CostComponentName MonthlyAzureHybridCostSavings { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.CostComponentName MonthlyPremiumV2StorageCost { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.CostComponentName MonthlySecurityCost { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.CostComponentName Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.CostComponentName 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.Migration.Assessment.Models.CostComponentName left, Azure.ResourceManager.Migration.Assessment.Models.CostComponentName right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.CostComponentName (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.CostComponentName left, Azure.ResourceManager.Migration.Assessment.Models.CostComponentName right) { throw null; } + public override string ToString() { throw null; } + } + public partial class EntityUptime : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EntityUptime() { } + public int? DaysPerMonth { get { throw null; } set { } } + public int? HoursPerDay { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.EntityUptime System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.EntityUptime System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FttAndRaidLevel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FttAndRaidLevel(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel Ftt1Raid1 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel Ftt1Raid5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel Ftt2Raid1 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel Ftt2Raid6 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel Ftt3Raid1 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel 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.Migration.Assessment.Models.FttAndRaidLevel left, Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel left, Azure.ResourceManager.Migration.Assessment.Models.FttAndRaidLevel right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct GuestOperatingSystemArchitecture : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public GuestOperatingSystemArchitecture(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture Unknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture X64 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture X86 { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture 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.Migration.Assessment.Models.GuestOperatingSystemArchitecture left, Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture left, Azure.ResourceManager.Migration.Assessment.Models.GuestOperatingSystemArchitecture right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ImpactedAssessmentObject : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ImpactedAssessmentObject() { } + public string ObjectName { get { throw null; } } + public string ObjectType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.ImpactedAssessmentObject System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.ImpactedAssessmentObject System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MachineBootType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MachineBootType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MachineBootType Bios { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MachineBootType Efi { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MachineBootType NotSpecified { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MachineBootType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MachineBootType 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.Migration.Assessment.Models.MachineBootType left, Azure.ResourceManager.Migration.Assessment.Models.MachineBootType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MachineBootType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MachineBootType left, Azure.ResourceManager.Migration.Assessment.Models.MachineBootType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MigrateGroupUpdateContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrateGroupUpdateContent() { } + public Azure.ETag? ETag { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateProperties Properties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrateGroupUpdateOperationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrateGroupUpdateOperationType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateOperationType Add { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateOperationType Remove { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateOperationType 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.Migration.Assessment.Models.MigrateGroupUpdateOperationType left, Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateOperationType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateOperationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateOperationType left, Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateOperationType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MigrateGroupUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrateGroupUpdateProperties() { } + public System.Collections.Generic.IList Machines { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateOperationType? OperationType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrateGroupUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentAssessmentProjectPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentAssessmentProjectPatch() { } + public string AssessmentSolutionId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier CustomerStorageAccountArmId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier CustomerWorkspaceId { get { throw null; } set { } } + public string CustomerWorkspaceLocation { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AssessmentProjectStatus? ProjectStatus { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState? ProvisioningState { get { throw null; } set { } } + public string PublicNetworkAccess { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentAssessmentProjectPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentAssessmentProjectPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationAssessmentCloudSuitability : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationAssessmentCloudSuitability(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability ConditionallySuitable { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability NotSuitable { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability ReadinessUnknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability Suitable { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability 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.Migration.Assessment.Models.MigrationAssessmentCloudSuitability left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationAssessmentComputeTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationAssessmentComputeTier(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier Automatic { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier Provisioned { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier Serverless { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier 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.Migration.Assessment.Models.MigrationAssessmentComputeTier left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MigrationAssessmentDisk : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MigrationAssessmentDisk() { } + public string DisplayName { get { throw null; } } + public double? GigabytesAllocated { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentDisk System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentDisk System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MigrationAssessmentError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MigrationAssessmentError() { } + public string AgentScenario { get { throw null; } } + public string ApplianceName { get { throw null; } } + public string Code { get { throw null; } } + public int? Id { get { throw null; } } + public string ImpactedAssessmentType { get { throw null; } } + public string Message { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary MessageParameters { get { throw null; } } + public string PossibleCauses { get { throw null; } } + public string RecommendedAction { get { throw null; } } + public string RunAsAccountId { get { throw null; } } + public string Severity { get { throw null; } } + public string SummaryMessage { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationAssessmentGroupStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationAssessmentGroupStatus(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus Completed { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus Created { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus Invalid { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus Running { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus Updated { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus 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.Migration.Assessment.Models.MigrationAssessmentGroupStatus left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationAssessmentGroupType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationAssessmentGroupType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType Default { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType Import { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType 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.Migration.Assessment.Models.MigrationAssessmentGroupType left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentGroupType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationAssessmentHardwareGeneration : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationAssessmentHardwareGeneration(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration Automatic { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration DCSeries { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration Fsv2Series { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration Gen5 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration MSeries { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration 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.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MigrationAssessmentNetworkAdapter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MigrationAssessmentNetworkAdapter() { } + public string DisplayName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList IPAddresses { get { throw null; } } + public string MacAddress { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentNetworkAdapter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentNetworkAdapter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationAssessmentOSLicense : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationAssessmentOSLicense(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentOSLicense No { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentOSLicense Unknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentOSLicense Yes { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentOSLicense 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.Migration.Assessment.Models.MigrationAssessmentOSLicense left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentOSLicense right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentOSLicense (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentOSLicense left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentOSLicense right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationAssessmentPrivateEndpointConnectionProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationAssessmentPrivateEndpointConnectionProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState 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.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointConnectionProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationAssessmentPrivateEndpointServiceConnectionStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationAssessmentPrivateEndpointServiceConnectionStatus(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointServiceConnectionStatus Approved { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointServiceConnectionStatus Pending { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointServiceConnectionStatus Rejected { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointServiceConnectionStatus 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.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointServiceConnectionStatus left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointServiceConnectionStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointServiceConnectionStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointServiceConnectionStatus left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointServiceConnectionStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MigrationAssessmentPrivateLinkServiceConnectionState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MigrationAssessmentPrivateLinkServiceConnectionState() { } + public string ActionsRequired { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateEndpointServiceConnectionStatus? Status { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateLinkServiceConnectionState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentPrivateLinkServiceConnectionState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationAssessmentProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationAssessmentProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState 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.Migration.Assessment.Models.MigrationAssessmentProvisioningState left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationAssessmentTargetType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationAssessmentTargetType(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType AzureSqlDatabase { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType AzureSqlManagedInstance { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType AzureSqlVirtualMachine { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType AzureVirtualMachine { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType Recommended { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType 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.Migration.Assessment.Models.MigrationAssessmentTargetType left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType left, Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MigrationGuidelineContext : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MigrationGuidelineContext() { } + public string ContextKey { get { throw null; } } + public string ContextValue { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrationGuidelineContext System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.MigrationGuidelineContext System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MultiSubnetIntent : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MultiSubnetIntent(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.MultiSubnetIntent DisasterRecovery { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MultiSubnetIntent HighAvailability { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.MultiSubnetIntent None { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.MultiSubnetIntent 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.Migration.Assessment.Models.MultiSubnetIntent left, Azure.ResourceManager.Migration.Assessment.Models.MultiSubnetIntent right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.MultiSubnetIntent (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.MultiSubnetIntent left, Azure.ResourceManager.Migration.Assessment.Models.MultiSubnetIntent right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PercentileOfUtilization : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PercentileOfUtilization(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization Percentile50 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization Percentile90 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization Percentile95 { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization Percentile99 { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization 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.Migration.Assessment.Models.PercentileOfUtilization left, Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization left, Azure.ResourceManager.Migration.Assessment.Models.PercentileOfUtilization right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ProcessorInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ProcessorInfo() { } + public string Name { get { throw null; } set { } } + public int? NumberOfCoresPerSocket { get { throw null; } set { } } + public int? NumberOfSockets { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.ProcessorInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.ProcessorInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProductSupportStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ProductSupportStatus() { } + public string CurrentEsuYear { get { throw null; } } + public string CurrentVersion { get { throw null; } } + public string EsuStatus { get { throw null; } } + public int? Eta { get { throw null; } } + public System.DateTimeOffset? ExtendedSecurityUpdateYear1EndOn { get { throw null; } } + public System.DateTimeOffset? ExtendedSecurityUpdateYear2EndOn { get { throw null; } } + public System.DateTimeOffset? ExtendedSecurityUpdateYear3EndOn { get { throw null; } } + public System.DateTimeOffset? ExtendedSupportEndOn { get { throw null; } } + public System.DateTimeOffset? MainstreamEndOn { get { throw null; } } + public string ServicePackStatus { get { throw null; } } + public string SupportStatus { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.ProductSupportStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct RecommendedSuitability : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public RecommendedSuitability(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability ConditionallySuitableForSqlDB { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability ConditionallySuitableForSqlMI { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability ConditionallySuitableForSqlVm { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability ConditionallySuitableForVm { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability NotSuitable { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability PotentiallySuitableForVm { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability ReadinessUnknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability SuitableForSqlDB { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability SuitableForSqlMI { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability SuitableForSqlVm { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability SuitableForVm { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability 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.Migration.Assessment.Models.RecommendedSuitability left, Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability left, Azure.ResourceManager.Migration.Assessment.Models.RecommendedSuitability right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SharedResourcesDto : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SharedResourcesDto() { } + public int? NumberOfMounts { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureQuorumWitnessDtoQuorumWitnessType? QuorumWitnessType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SharedDataDisks { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SharedLogDisks { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SharedTempDBDisks { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SharedResourcesDto System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SharedResourcesDto System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SkuReplicationMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SkuReplicationMode(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode ActiveGeoReplication { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode FailoverGroupInstance { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode NotApplicable { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode 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.Migration.Assessment.Models.SkuReplicationMode left, Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode left, Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SqlAssessedNetworkAdapter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SqlAssessedNetworkAdapter() { } + public string DisplayName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList IPAddresses { get { throw null; } } + public string MacAddress { get { throw null; } } + public double? MegabytesPerSecondReceived { get { throw null; } } + public double? MegabytesPerSecondTransmitted { get { throw null; } } + public double? MonthlyBandwidthCosts { get { throw null; } } + public string Name { get { throw null; } } + public double? NetGigabytesTransmittedPerMonth { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? Suitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityDetail? SuitabilityDetail { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureNetworkAdapterSuitabilityExplanation? SuitabilityExplanation { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAssessedNetworkAdapter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAssessedNetworkAdapter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SqlAssessmentMigrationIssue : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SqlAssessmentMigrationIssue() { } + public System.Collections.Generic.IReadOnlyList ImpactedObjects { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssueCategory? IssueCategory { get { throw null; } } + public string IssueId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssue System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssue System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SqlAssessmentMigrationIssueCategory : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SqlAssessmentMigrationIssueCategory(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssueCategory Internal { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssueCategory Issue { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssueCategory Warning { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssueCategory 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.Migration.Assessment.Models.SqlAssessmentMigrationIssueCategory left, Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssueCategory right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssueCategory (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssueCategory left, Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentMigrationIssueCategory right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SqlAssessmentV2IaasSuitabilityDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SqlAssessmentV2IaasSuitabilityDetails() { } + public Azure.ResourceManager.Migration.Assessment.Models.AzureSqlIaasSkuDto AzureSqlSku { get { throw null; } } + public System.Collections.Generic.IReadOnlyList CostComponents { get { throw null; } } + public System.Collections.Generic.IReadOnlyList MigrationGuidelines { get { throw null; } } + public System.Collections.Generic.IReadOnlyList MigrationIssues { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? MigrationTargetPlatform { get { throw null; } } + public double? MonthlyComputeCost { get { throw null; } } + public double? MonthlyStorageCost { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RecommendationReasonings { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ReplicaAzureSqlSku { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? SecuritySuitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SharedResourcesDto SharedResources { get { throw null; } } + public bool? ShouldProvisionReplicas { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode? SkuReplicationMode { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? Suitability { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2IaasSuitabilityDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2IaasSuitabilityDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SqlAssessmentV2PaasSuitabilityDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SqlAssessmentV2PaasSuitabilityDetails() { } + public Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPaasSkuDto AzureSqlSku { get { throw null; } } + public System.Collections.Generic.IReadOnlyList CostComponents { get { throw null; } } + public System.Collections.Generic.IReadOnlyList MigrationGuidelines { get { throw null; } } + public System.Collections.Generic.IReadOnlyList MigrationIssues { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? MigrationTargetPlatform { get { throw null; } } + public double? MonthlyComputeCost { get { throw null; } } + public double? MonthlyStorageCost { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RecommendationReasonings { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ReplicaAzureSqlSku { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? SecuritySuitability { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SharedResourcesDto SharedResources { get { throw null; } } + public bool? ShouldProvisionReplicas { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SkuReplicationMode? SkuReplicationMode { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentCloudSuitability? Suitability { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2PaasSuitabilityDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SqlAssessmentV2SummaryDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SqlAssessmentV2SummaryDetails() { } + public double? ConfidenceScore { get { throw null; } } + public double? MonthlyComputeCost { get { throw null; } } + public double? MonthlyLicenseCost { get { throw null; } } + public double? MonthlySecurityCost { get { throw null; } } + public double? MonthlyStorageCost { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary SuitabilitySummary { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2SummaryDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAssessmentV2SummaryDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SqlAvailabilityGroupDataOverview : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SqlAvailabilityGroupDataOverview() { } + public string AvailabilityGroupId { get { throw null; } } + public string AvailabilityGroupName { get { throw null; } } + public string SqlAvailabilityGroupEntityId { get { throw null; } } + public Azure.Core.ResourceIdentifier SqlAvailabilityGroupSdsArmId { get { throw null; } } + public string SqlAvailabilityReplicaId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAvailabilityGroupDataOverview System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAvailabilityGroupDataOverview System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SqlAvailabilityReplicaSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SqlAvailabilityReplicaSummary() { } + public int? NumberOfAsynchronousNonReadReplicas { get { throw null; } } + public int? NumberOfAsynchronousReadReplicas { get { throw null; } } + public int? NumberOfPrimaryReplicas { get { throw null; } } + public int? NumberOfSynchronousNonReadReplicas { get { throw null; } } + public int? NumberOfSynchronousReadReplicas { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAvailabilityReplicaSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlAvailabilityReplicaSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SqlDBSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SqlDBSettings() { } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier? AzureSqlComputeTier { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureSqlDataBaseType? AzureSqlDataBaseType { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureSqlPurchaseModel? AzureSqlPurchaseModel { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier? AzureSqlServiceTier { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlDBSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlDBSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SqlFciMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SqlFciMetadata() { } + public int? FciSharedDiskCount { get { throw null; } } + public bool? IsMultiSubnet { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState? State { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SqlFciMetadataState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SqlFciMetadataState(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState Failed { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState Inherited { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState Initializing { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState Offline { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState OfflinePending { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState Online { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState OnlinePending { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState Pending { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState 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.Migration.Assessment.Models.SqlFciMetadataState left, Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState left, Azure.ResourceManager.Migration.Assessment.Models.SqlFciMetadataState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SqlFciState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SqlFciState(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciState Active { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciState NotApplicable { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciState Passive { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlFciState Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.SqlFciState 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.Migration.Assessment.Models.SqlFciState left, Azure.ResourceManager.Migration.Assessment.Models.SqlFciState right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.SqlFciState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.SqlFciState left, Azure.ResourceManager.Migration.Assessment.Models.SqlFciState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SqlMigrationGuideline : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SqlMigrationGuideline() { } + public string GuidelineId { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuidelineCategory? MigrationGuidelineCategory { get { throw null; } } + public System.Collections.Generic.IReadOnlyList MigrationGuidelineContext { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuideline System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuideline System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SqlMigrationGuidelineCategory : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SqlMigrationGuidelineCategory(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuidelineCategory AvailabilityGroupGuideline { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuidelineCategory FailoverCluterInstanceGuideLine { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuidelineCategory General { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuidelineCategory Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuidelineCategory 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.Migration.Assessment.Models.SqlMigrationGuidelineCategory left, Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuidelineCategory right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuidelineCategory (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuidelineCategory left, Azure.ResourceManager.Migration.Assessment.Models.SqlMigrationGuidelineCategory right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SqlMISettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SqlMISettings() { } + public Azure.ResourceManager.Migration.Assessment.Models.AzureSqlInstanceType? AzureSqlInstanceType { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier? AzureSqlServiceTier { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlMISettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlMISettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SqlOptimizationLogic : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SqlOptimizationLogic(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlOptimizationLogic MinimizeCost { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlOptimizationLogic ModernizeToAzureSqlDB { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlOptimizationLogic ModernizeToAzureSqlMI { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlOptimizationLogic ModernizeToPaaS { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.SqlOptimizationLogic 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.Migration.Assessment.Models.SqlOptimizationLogic left, Azure.ResourceManager.Migration.Assessment.Models.SqlOptimizationLogic right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.SqlOptimizationLogic (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.SqlOptimizationLogic left, Azure.ResourceManager.Migration.Assessment.Models.SqlOptimizationLogic right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SqlPaaSTargetConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SqlPaaSTargetConfig() { } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentComputeTier? ComputeTier { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentHardwareGeneration? HardwareGeneration { get { throw null; } set { } } + public Azure.ResourceManager.Migration.Assessment.Models.AzureSqlServiceTier? ServiceTier { get { throw null; } set { } } + public System.Collections.Generic.IList TargetLocations { get { throw null; } } + public Azure.ResourceManager.Migration.Assessment.Models.MigrationAssessmentTargetType? TargetType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlPaaSTargetConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlPaaSTargetConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SqlRecommendationReasoning : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SqlRecommendationReasoning() { } + public System.Collections.Generic.IReadOnlyList ContextParameters { get { throw null; } } + public string ReasoningCategory { get { throw null; } } + public string ReasoningId { get { throw null; } } + public string ReasoningString { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlRecommendationReasoning System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlRecommendationReasoning System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SqlRecommendationReasoningContext : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SqlRecommendationReasoningContext() { } + public string ContextKey { get { throw null; } } + public string ContextValue { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlRecommendationReasoningContext System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.SqlRecommendationReasoningContext System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SqlServerLicense : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SqlServerLicense(string value) { throw null; } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlServerLicense No { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlServerLicense Unknown { get { throw null; } } + public static Azure.ResourceManager.Migration.Assessment.Models.SqlServerLicense Yes { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migration.Assessment.Models.SqlServerLicense 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.Migration.Assessment.Models.SqlServerLicense left, Azure.ResourceManager.Migration.Assessment.Models.SqlServerLicense right) { throw null; } + public static implicit operator Azure.ResourceManager.Migration.Assessment.Models.SqlServerLicense (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migration.Assessment.Models.SqlServerLicense left, Azure.ResourceManager.Migration.Assessment.Models.SqlServerLicense right) { throw null; } + public override string ToString() { throw null; } + } + public partial class UltraDiskAssessmentConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal UltraDiskAssessmentConfig() { } + public string FamilyName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList TargetLocations { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.UltraDiskAssessmentConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.UltraDiskAssessmentConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VmFamilyConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VmFamilyConfig() { } + public System.Collections.Generic.IReadOnlyList Category { get { throw null; } } + public string FamilyName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList TargetLocations { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.VmFamilyConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.VmFamilyConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VmUptime : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VmUptime() { } + public int? DaysPerMonth { get { throw null; } set { } } + public int? HoursPerDay { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.VmUptime System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.VmUptime System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WorkloadSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WorkloadSummary() { } + public int? OracleInstances { get { throw null; } } + public int? SpringApps { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.WorkloadSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migration.Assessment.Models.WorkloadSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/assets.json b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/assets.json new file mode 100644 index 000000000000..b8fb6de8e22f --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/assets.json @@ -0,0 +1,6 @@ +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/migration.assessment/Azure.ResourceManager.Migration.Assessment", + "Tag": "net/migration.assessment/Azure.ResourceManager.Migration.Assessment_1035c2eaca" +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Azure.ResourceManager.Migration.Assessment.Samples.csproj b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Azure.ResourceManager.Migration.Assessment.Samples.csproj new file mode 100644 index 000000000000..5f5b0dee6797 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Azure.ResourceManager.Migration.Assessment.Samples.csproj @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedMachineCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedMachineCollection.cs new file mode 100644 index 000000000000..30ebf2c594b5 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedMachineCollection.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_AssessedMachineCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedMachinesOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedMachinesOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentResource created on azure + // for more information of creating MigrationAssessmentAssessmentResource, please refer to the document of MigrationAssessmentAssessmentResource + string subscriptionId = "D8E1C413-E65F-40C0-8A7E-743D6B7A6AE9"; + string resourceGroupName = "rgopenapi"; + string projectName = "pavqtntysjn"; + string groupName = "smawqdmhfngray"; + string assessmentName = "qjlumxyqsitd"; + ResourceIdentifier migrationAssessmentAssessmentResourceId = MigrationAssessmentAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentAssessmentResource migrationAssessmentAssessment = client.GetMigrationAssessmentAssessmentResource(migrationAssessmentAssessmentResourceId); + + // get the collection of this AssessedMachineResource + AssessedMachineCollection collection = migrationAssessmentAssessment.GetAssessedMachines(); + + // invoke the operation + string assessedMachineName = "oqxjeheiipjmuo"; + AssessedMachineResource result = await collection.GetAsync(assessedMachineName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedMachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AssessedMachinesOperationsListByAssessmentMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedMachinesOperations_ListByAssessment_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedMachinesOperations_ListByAssessment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentResource created on azure + // for more information of creating MigrationAssessmentAssessmentResource, please refer to the document of MigrationAssessmentAssessmentResource + string subscriptionId = "D8E1C413-E65F-40C0-8A7E-743D6B7A6AE9"; + string resourceGroupName = "rgopenapi"; + string projectName = "sloqixzfjk"; + string groupName = "kjuepxerwseq"; + string assessmentName = "rhzcmubwrrkhtocsibu"; + ResourceIdentifier migrationAssessmentAssessmentResourceId = MigrationAssessmentAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentAssessmentResource migrationAssessmentAssessment = client.GetMigrationAssessmentAssessmentResource(migrationAssessmentAssessmentResourceId); + + // get the collection of this AssessedMachineResource + AssessedMachineCollection collection = migrationAssessmentAssessment.GetAssessedMachines(); + + // invoke the operation and iterate over the result + string filter = "sbkdovsfqldhdb"; + int? pageSize = 10; + string continuationToken = "hbyseetshbplfkjmpjhsiurqgt"; + int? totalRecordCount = 25; + await foreach (AssessedMachineResource item in collection.GetAllAsync(filter: filter, pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedMachineData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AssessedMachinesOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedMachinesOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentResource created on azure + // for more information of creating MigrationAssessmentAssessmentResource, please refer to the document of MigrationAssessmentAssessmentResource + string subscriptionId = "D8E1C413-E65F-40C0-8A7E-743D6B7A6AE9"; + string resourceGroupName = "rgopenapi"; + string projectName = "pavqtntysjn"; + string groupName = "smawqdmhfngray"; + string assessmentName = "qjlumxyqsitd"; + ResourceIdentifier migrationAssessmentAssessmentResourceId = MigrationAssessmentAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentAssessmentResource migrationAssessmentAssessment = client.GetMigrationAssessmentAssessmentResource(migrationAssessmentAssessmentResourceId); + + // get the collection of this AssessedMachineResource + AssessedMachineCollection collection = migrationAssessmentAssessment.GetAssessedMachines(); + + // invoke the operation + string assessedMachineName = "oqxjeheiipjmuo"; + bool result = await collection.ExistsAsync(assessedMachineName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AssessedMachinesOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedMachinesOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentResource created on azure + // for more information of creating MigrationAssessmentAssessmentResource, please refer to the document of MigrationAssessmentAssessmentResource + string subscriptionId = "D8E1C413-E65F-40C0-8A7E-743D6B7A6AE9"; + string resourceGroupName = "rgopenapi"; + string projectName = "pavqtntysjn"; + string groupName = "smawqdmhfngray"; + string assessmentName = "qjlumxyqsitd"; + ResourceIdentifier migrationAssessmentAssessmentResourceId = MigrationAssessmentAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentAssessmentResource migrationAssessmentAssessment = client.GetMigrationAssessmentAssessmentResource(migrationAssessmentAssessmentResourceId); + + // get the collection of this AssessedMachineResource + AssessedMachineCollection collection = migrationAssessmentAssessment.GetAssessedMachines(); + + // invoke the operation + string assessedMachineName = "oqxjeheiipjmuo"; + NullableResponse response = await collection.GetIfExistsAsync(assessedMachineName); + AssessedMachineResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedMachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedMachineResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedMachineResource.cs new file mode 100644 index 000000000000..1b288d14de71 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedMachineResource.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_AssessedMachineResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedMachinesOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedMachinesOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessedMachineResource created on azure + // for more information of creating AssessedMachineResource, please refer to the document of AssessedMachineResource + string subscriptionId = "D8E1C413-E65F-40C0-8A7E-743D6B7A6AE9"; + string resourceGroupName = "rgopenapi"; + string projectName = "pavqtntysjn"; + string groupName = "smawqdmhfngray"; + string assessmentName = "qjlumxyqsitd"; + string assessedMachineName = "oqxjeheiipjmuo"; + ResourceIdentifier assessedMachineResourceId = AssessedMachineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, assessedMachineName); + AssessedMachineResource assessedMachine = client.GetAssessedMachineResource(assessedMachineResourceId); + + // invoke the operation + AssessedMachineResource result = await assessedMachine.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedMachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedSqlDatabaseV2Collection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedSqlDatabaseV2Collection.cs new file mode 100644 index 000000000000..21af6dd4f408 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedSqlDatabaseV2Collection.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_AssessedSqlDatabaseV2Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedSqlDatabaseV2OperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedSqlDatabaseV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlDatabaseV2Operations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2Resource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2Resource, please refer to the document of MigrationAssessmentSqlAssessmentV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2ResourceId = MigrationAssessmentSqlAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentSqlAssessmentV2Resource migrationAssessmentSqlAssessmentV2 = client.GetMigrationAssessmentSqlAssessmentV2Resource(migrationAssessmentSqlAssessmentV2ResourceId); + + // get the collection of this AssessedSqlDatabaseV2Resource + AssessedSqlDatabaseV2Collection collection = migrationAssessmentSqlAssessmentV2.GetAssessedSqlDatabaseV2s(); + + // invoke the operation + string assessedSqlDatabaseName = "858eb860-9e07-417c-91b6-bca1bffb3bf5"; + AssessedSqlDatabaseV2Resource result = await collection.GetAsync(assessedSqlDatabaseName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlDatabaseV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AssessedSqlDatabaseV2OperationsListBySqlAssessmentV2MaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedSqlDatabaseV2Operations_ListBySqlAssessmentV2_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlDatabaseV2Operations_ListBySqlAssessmentV2" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2Resource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2Resource, please refer to the document of MigrationAssessmentSqlAssessmentV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2ResourceId = MigrationAssessmentSqlAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentSqlAssessmentV2Resource migrationAssessmentSqlAssessmentV2 = client.GetMigrationAssessmentSqlAssessmentV2Resource(migrationAssessmentSqlAssessmentV2ResourceId); + + // get the collection of this AssessedSqlDatabaseV2Resource + AssessedSqlDatabaseV2Collection collection = migrationAssessmentSqlAssessmentV2.GetAssessedSqlDatabaseV2s(); + + // invoke the operation and iterate over the result + string filter = "(contains(Properties/DatabaseName,'adv130'))"; + int? pageSize = 23; + string continuationToken = null; + int? totalRecordCount = 1; + await foreach (AssessedSqlDatabaseV2Resource item in collection.GetAllAsync(filter: filter, pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlDatabaseV2Data resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AssessedSqlDatabaseV2OperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedSqlDatabaseV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlDatabaseV2Operations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2Resource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2Resource, please refer to the document of MigrationAssessmentSqlAssessmentV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2ResourceId = MigrationAssessmentSqlAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentSqlAssessmentV2Resource migrationAssessmentSqlAssessmentV2 = client.GetMigrationAssessmentSqlAssessmentV2Resource(migrationAssessmentSqlAssessmentV2ResourceId); + + // get the collection of this AssessedSqlDatabaseV2Resource + AssessedSqlDatabaseV2Collection collection = migrationAssessmentSqlAssessmentV2.GetAssessedSqlDatabaseV2s(); + + // invoke the operation + string assessedSqlDatabaseName = "858eb860-9e07-417c-91b6-bca1bffb3bf5"; + bool result = await collection.ExistsAsync(assessedSqlDatabaseName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AssessedSqlDatabaseV2OperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedSqlDatabaseV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlDatabaseV2Operations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2Resource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2Resource, please refer to the document of MigrationAssessmentSqlAssessmentV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2ResourceId = MigrationAssessmentSqlAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentSqlAssessmentV2Resource migrationAssessmentSqlAssessmentV2 = client.GetMigrationAssessmentSqlAssessmentV2Resource(migrationAssessmentSqlAssessmentV2ResourceId); + + // get the collection of this AssessedSqlDatabaseV2Resource + AssessedSqlDatabaseV2Collection collection = migrationAssessmentSqlAssessmentV2.GetAssessedSqlDatabaseV2s(); + + // invoke the operation + string assessedSqlDatabaseName = "858eb860-9e07-417c-91b6-bca1bffb3bf5"; + NullableResponse response = await collection.GetIfExistsAsync(assessedSqlDatabaseName); + AssessedSqlDatabaseV2Resource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlDatabaseV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedSqlDatabaseV2Resource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedSqlDatabaseV2Resource.cs new file mode 100644 index 000000000000..e36229f0160e --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedSqlDatabaseV2Resource.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_AssessedSqlDatabaseV2Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedSqlDatabaseV2OperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedSqlDatabaseV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlDatabaseV2Operations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessedSqlDatabaseV2Resource created on azure + // for more information of creating AssessedSqlDatabaseV2Resource, please refer to the document of AssessedSqlDatabaseV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + string assessedSqlDatabaseName = "858eb860-9e07-417c-91b6-bca1bffb3bf5"; + ResourceIdentifier assessedSqlDatabaseV2ResourceId = AssessedSqlDatabaseV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, assessedSqlDatabaseName); + AssessedSqlDatabaseV2Resource assessedSqlDatabaseV2 = client.GetAssessedSqlDatabaseV2Resource(assessedSqlDatabaseV2ResourceId); + + // invoke the operation + AssessedSqlDatabaseV2Resource result = await assessedSqlDatabaseV2.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlDatabaseV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedSqlInstanceV2Collection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedSqlInstanceV2Collection.cs new file mode 100644 index 000000000000..9966c36e896b --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedSqlInstanceV2Collection.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_AssessedSqlInstanceV2Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedSqlInstanceV2OperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedSqlInstanceV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlInstanceV2Operations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2Resource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2Resource, please refer to the document of MigrationAssessmentSqlAssessmentV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2ResourceId = MigrationAssessmentSqlAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentSqlAssessmentV2Resource migrationAssessmentSqlAssessmentV2 = client.GetMigrationAssessmentSqlAssessmentV2Resource(migrationAssessmentSqlAssessmentV2ResourceId); + + // get the collection of this AssessedSqlInstanceV2Resource + AssessedSqlInstanceV2Collection collection = migrationAssessmentSqlAssessmentV2.GetAssessedSqlInstanceV2s(); + + // invoke the operation + string assessedSqlInstanceName = "3c6574cf-b4e1-4fdc-93db-6bbcc570dda2"; + AssessedSqlInstanceV2Resource result = await collection.GetAsync(assessedSqlInstanceName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlInstanceV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AssessedSqlInstanceV2OperationsListBySqlAssessmentV2MaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedSqlInstanceV2Operations_ListBySqlAssessmentV2_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlInstanceV2Operations_ListBySqlAssessmentV2" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2Resource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2Resource, please refer to the document of MigrationAssessmentSqlAssessmentV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2ResourceId = MigrationAssessmentSqlAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentSqlAssessmentV2Resource migrationAssessmentSqlAssessmentV2 = client.GetMigrationAssessmentSqlAssessmentV2Resource(migrationAssessmentSqlAssessmentV2ResourceId); + + // get the collection of this AssessedSqlInstanceV2Resource + AssessedSqlInstanceV2Collection collection = migrationAssessmentSqlAssessmentV2.GetAssessedSqlInstanceV2s(); + + // invoke the operation and iterate over the result + string filter = "(contains(Properties/InstanceName,'MSSQLSERVER'))"; + int? pageSize = 23; + string continuationToken = null; + int? totalRecordCount = 1; + await foreach (AssessedSqlInstanceV2Resource item in collection.GetAllAsync(filter: filter, pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlInstanceV2Data resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AssessedSqlInstanceV2OperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedSqlInstanceV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlInstanceV2Operations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2Resource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2Resource, please refer to the document of MigrationAssessmentSqlAssessmentV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2ResourceId = MigrationAssessmentSqlAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentSqlAssessmentV2Resource migrationAssessmentSqlAssessmentV2 = client.GetMigrationAssessmentSqlAssessmentV2Resource(migrationAssessmentSqlAssessmentV2ResourceId); + + // get the collection of this AssessedSqlInstanceV2Resource + AssessedSqlInstanceV2Collection collection = migrationAssessmentSqlAssessmentV2.GetAssessedSqlInstanceV2s(); + + // invoke the operation + string assessedSqlInstanceName = "3c6574cf-b4e1-4fdc-93db-6bbcc570dda2"; + bool result = await collection.ExistsAsync(assessedSqlInstanceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AssessedSqlInstanceV2OperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedSqlInstanceV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlInstanceV2Operations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2Resource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2Resource, please refer to the document of MigrationAssessmentSqlAssessmentV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2ResourceId = MigrationAssessmentSqlAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentSqlAssessmentV2Resource migrationAssessmentSqlAssessmentV2 = client.GetMigrationAssessmentSqlAssessmentV2Resource(migrationAssessmentSqlAssessmentV2ResourceId); + + // get the collection of this AssessedSqlInstanceV2Resource + AssessedSqlInstanceV2Collection collection = migrationAssessmentSqlAssessmentV2.GetAssessedSqlInstanceV2s(); + + // invoke the operation + string assessedSqlInstanceName = "3c6574cf-b4e1-4fdc-93db-6bbcc570dda2"; + NullableResponse response = await collection.GetIfExistsAsync(assessedSqlInstanceName); + AssessedSqlInstanceV2Resource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlInstanceV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedSqlInstanceV2Resource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedSqlInstanceV2Resource.cs new file mode 100644 index 000000000000..2623cd2b2c45 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedSqlInstanceV2Resource.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_AssessedSqlInstanceV2Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedSqlInstanceV2OperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedSqlInstanceV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlInstanceV2Operations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessedSqlInstanceV2Resource created on azure + // for more information of creating AssessedSqlInstanceV2Resource, please refer to the document of AssessedSqlInstanceV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + string assessedSqlInstanceName = "3c6574cf-b4e1-4fdc-93db-6bbcc570dda2"; + ResourceIdentifier assessedSqlInstanceV2ResourceId = AssessedSqlInstanceV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, assessedSqlInstanceName); + AssessedSqlInstanceV2Resource assessedSqlInstanceV2 = client.GetAssessedSqlInstanceV2Resource(assessedSqlInstanceV2ResourceId); + + // invoke the operation + AssessedSqlInstanceV2Resource result = await assessedSqlInstanceV2.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlInstanceV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedSqlMachineCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedSqlMachineCollection.cs new file mode 100644 index 000000000000..aa23a683fdf1 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedSqlMachineCollection.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_AssessedSqlMachineCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedSqlMachinesOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedSqlMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlMachinesOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2Resource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2Resource, please refer to the document of MigrationAssessmentSqlAssessmentV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2ResourceId = MigrationAssessmentSqlAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentSqlAssessmentV2Resource migrationAssessmentSqlAssessmentV2 = client.GetMigrationAssessmentSqlAssessmentV2Resource(migrationAssessmentSqlAssessmentV2ResourceId); + + // get the collection of this AssessedSqlMachineResource + AssessedSqlMachineCollection collection = migrationAssessmentSqlAssessmentV2.GetAssessedSqlMachines(); + + // invoke the operation + string assessedSqlMachineName = "cc64c9dc-b38e-435d-85ad-d509df5d92c6"; + AssessedSqlMachineResource result = await collection.GetAsync(assessedSqlMachineName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlMachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AssessedSqlMachinesOperationsListBySqlAssessmentV2MaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedSqlMachinesOperations_ListBySqlAssessmentV2_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlMachinesOperations_ListBySqlAssessmentV2" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2Resource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2Resource, please refer to the document of MigrationAssessmentSqlAssessmentV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2ResourceId = MigrationAssessmentSqlAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentSqlAssessmentV2Resource migrationAssessmentSqlAssessmentV2 = client.GetMigrationAssessmentSqlAssessmentV2Resource(migrationAssessmentSqlAssessmentV2ResourceId); + + // get the collection of this AssessedSqlMachineResource + AssessedSqlMachineCollection collection = migrationAssessmentSqlAssessmentV2.GetAssessedSqlMachines(); + + // invoke the operation and iterate over the result + string filter = "(contains(Properties/DisplayName,'SQLHAVM17'))"; + int? pageSize = 23; + string continuationToken = null; + int? totalRecordCount = 1; + await foreach (AssessedSqlMachineResource item in collection.GetAllAsync(filter: filter, pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlMachineData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AssessedSqlMachinesOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedSqlMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlMachinesOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2Resource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2Resource, please refer to the document of MigrationAssessmentSqlAssessmentV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2ResourceId = MigrationAssessmentSqlAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentSqlAssessmentV2Resource migrationAssessmentSqlAssessmentV2 = client.GetMigrationAssessmentSqlAssessmentV2Resource(migrationAssessmentSqlAssessmentV2ResourceId); + + // get the collection of this AssessedSqlMachineResource + AssessedSqlMachineCollection collection = migrationAssessmentSqlAssessmentV2.GetAssessedSqlMachines(); + + // invoke the operation + string assessedSqlMachineName = "cc64c9dc-b38e-435d-85ad-d509df5d92c6"; + bool result = await collection.ExistsAsync(assessedSqlMachineName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AssessedSqlMachinesOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedSqlMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlMachinesOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2Resource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2Resource, please refer to the document of MigrationAssessmentSqlAssessmentV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2ResourceId = MigrationAssessmentSqlAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentSqlAssessmentV2Resource migrationAssessmentSqlAssessmentV2 = client.GetMigrationAssessmentSqlAssessmentV2Resource(migrationAssessmentSqlAssessmentV2ResourceId); + + // get the collection of this AssessedSqlMachineResource + AssessedSqlMachineCollection collection = migrationAssessmentSqlAssessmentV2.GetAssessedSqlMachines(); + + // invoke the operation + string assessedSqlMachineName = "cc64c9dc-b38e-435d-85ad-d509df5d92c6"; + NullableResponse response = await collection.GetIfExistsAsync(assessedSqlMachineName); + AssessedSqlMachineResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlMachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedSqlMachineResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedSqlMachineResource.cs new file mode 100644 index 000000000000..edfc208f4680 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedSqlMachineResource.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_AssessedSqlMachineResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedSqlMachinesOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedSqlMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlMachinesOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessedSqlMachineResource created on azure + // for more information of creating AssessedSqlMachineResource, please refer to the document of AssessedSqlMachineResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + string assessedSqlMachineName = "cc64c9dc-b38e-435d-85ad-d509df5d92c6"; + ResourceIdentifier assessedSqlMachineResourceId = AssessedSqlMachineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, assessedSqlMachineName); + AssessedSqlMachineResource assessedSqlMachine = client.GetAssessedSqlMachineResource(assessedSqlMachineResourceId); + + // invoke the operation + AssessedSqlMachineResource result = await assessedSqlMachine.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlMachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedSqlRecommendedEntityCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedSqlRecommendedEntityCollection.cs new file mode 100644 index 000000000000..26427b6fbd36 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedSqlRecommendedEntityCollection.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_AssessedSqlRecommendedEntityCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedSqlRecommendedEntityOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedSqlRecommendedEntityOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlRecommendedEntityOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2Resource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2Resource, please refer to the document of MigrationAssessmentSqlAssessmentV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2ResourceId = MigrationAssessmentSqlAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentSqlAssessmentV2Resource migrationAssessmentSqlAssessmentV2 = client.GetMigrationAssessmentSqlAssessmentV2Resource(migrationAssessmentSqlAssessmentV2ResourceId); + + // get the collection of this AssessedSqlRecommendedEntityResource + AssessedSqlRecommendedEntityCollection collection = migrationAssessmentSqlAssessmentV2.GetAssessedSqlRecommendedEntities(); + + // invoke the operation + string recommendedAssessedEntityName = "cc64c9dc-b38e-435d-85ad-d509df5d92c6"; + AssessedSqlRecommendedEntityResource result = await collection.GetAsync(recommendedAssessedEntityName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlRecommendedEntityData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AssessedSqlRecommendedEntityOperationsListBySqlAssessmentV2MaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedSqlRecommendedEntityOperations_ListBySqlAssessmentV2_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlRecommendedEntityOperations_ListBySqlAssessmentV2" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2Resource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2Resource, please refer to the document of MigrationAssessmentSqlAssessmentV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2ResourceId = MigrationAssessmentSqlAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentSqlAssessmentV2Resource migrationAssessmentSqlAssessmentV2 = client.GetMigrationAssessmentSqlAssessmentV2Resource(migrationAssessmentSqlAssessmentV2ResourceId); + + // get the collection of this AssessedSqlRecommendedEntityResource + AssessedSqlRecommendedEntityCollection collection = migrationAssessmentSqlAssessmentV2.GetAssessedSqlRecommendedEntities(); + + // invoke the operation and iterate over the result + string filter = "(contains(Properties/InstanceName,'MSSQLSERVER'))"; + int? pageSize = 23; + string continuationToken = null; + int? totalRecordCount = 1; + await foreach (AssessedSqlRecommendedEntityResource item in collection.GetAllAsync(filter: filter, pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlRecommendedEntityData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AssessedSqlRecommendedEntityOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedSqlRecommendedEntityOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlRecommendedEntityOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2Resource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2Resource, please refer to the document of MigrationAssessmentSqlAssessmentV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2ResourceId = MigrationAssessmentSqlAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentSqlAssessmentV2Resource migrationAssessmentSqlAssessmentV2 = client.GetMigrationAssessmentSqlAssessmentV2Resource(migrationAssessmentSqlAssessmentV2ResourceId); + + // get the collection of this AssessedSqlRecommendedEntityResource + AssessedSqlRecommendedEntityCollection collection = migrationAssessmentSqlAssessmentV2.GetAssessedSqlRecommendedEntities(); + + // invoke the operation + string recommendedAssessedEntityName = "cc64c9dc-b38e-435d-85ad-d509df5d92c6"; + bool result = await collection.ExistsAsync(recommendedAssessedEntityName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AssessedSqlRecommendedEntityOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedSqlRecommendedEntityOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlRecommendedEntityOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2Resource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2Resource, please refer to the document of MigrationAssessmentSqlAssessmentV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2ResourceId = MigrationAssessmentSqlAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentSqlAssessmentV2Resource migrationAssessmentSqlAssessmentV2 = client.GetMigrationAssessmentSqlAssessmentV2Resource(migrationAssessmentSqlAssessmentV2ResourceId); + + // get the collection of this AssessedSqlRecommendedEntityResource + AssessedSqlRecommendedEntityCollection collection = migrationAssessmentSqlAssessmentV2.GetAssessedSqlRecommendedEntities(); + + // invoke the operation + string recommendedAssessedEntityName = "cc64c9dc-b38e-435d-85ad-d509df5d92c6"; + NullableResponse response = await collection.GetIfExistsAsync(recommendedAssessedEntityName); + AssessedSqlRecommendedEntityResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlRecommendedEntityData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedSqlRecommendedEntityResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedSqlRecommendedEntityResource.cs new file mode 100644 index 000000000000..de76ea8bfd2b --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_AssessedSqlRecommendedEntityResource.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_AssessedSqlRecommendedEntityResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedSqlRecommendedEntityOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessedSqlRecommendedEntityOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlRecommendedEntityOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessedSqlRecommendedEntityResource created on azure + // for more information of creating AssessedSqlRecommendedEntityResource, please refer to the document of AssessedSqlRecommendedEntityResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + string recommendedAssessedEntityName = "cc64c9dc-b38e-435d-85ad-d509df5d92c6"; + ResourceIdentifier assessedSqlRecommendedEntityResourceId = AssessedSqlRecommendedEntityResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, recommendedAssessedEntityName); + AssessedSqlRecommendedEntityResource assessedSqlRecommendedEntity = client.GetAssessedSqlRecommendedEntityResource(assessedSqlRecommendedEntityResourceId); + + // invoke the operation + AssessedSqlRecommendedEntityResource result = await assessedSqlRecommendedEntity.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlRecommendedEntityData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAssessmentCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAssessmentCollection.cs new file mode 100644 index 000000000000..884f30535a9b --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAssessmentCollection.cs @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migration.Assessment.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentAssessmentCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_AssessmentsOperationsCreateMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentsOperations_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentGroupResource created on azure + // for more information of creating MigrationAssessmentGroupResource, please refer to the document of MigrationAssessmentGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + ResourceIdentifier migrationAssessmentGroupResourceId = MigrationAssessmentGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName); + MigrationAssessmentGroupResource migrationAssessmentGroup = client.GetMigrationAssessmentGroupResource(migrationAssessmentGroupResourceId); + + // get the collection of this MigrationAssessmentAssessmentResource + MigrationAssessmentAssessmentCollection collection = migrationAssessmentGroup.GetMigrationAssessmentAssessments(); + + // invoke the operation + string assessmentName = "asm1"; + MigrationAssessmentAssessmentData data = new MigrationAssessmentAssessmentData + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + EASubscriptionId = "kwsu", + AzurePricingTier = AzurePricingTier.Standard, + AzureStorageRedundancy = AzureStorageRedundancy.Unknown, + ReservedInstance = AzureReservedInstance.None, + AzureHybridUseBenefit = AzureHybridUseBenefit.Unknown, + AzureDiskTypes = { AzureDiskType.Premium, AzureDiskType.StandardSsd }, + AzureVmFamilies = { AzureVmFamily.DSeries, AzureVmFamily.Lsv2Series, AzureVmFamily.MSeries, AzureVmFamily.Mdsv2Series, AzureVmFamily.Msv2Series, AzureVmFamily.Mv2Series }, + VmUptime = new VmUptime + { + DaysPerMonth = 13, + HoursPerDay = 26, + }, + AzureLocation = new AzureLocation("njxbwdtsxzhichsnk"), + AzureOfferCode = AzureOfferCode.Unknown, + Currency = AzureCurrency.Unknown, + ScalingFactor = 24, + Percentile = PercentileOfUtilization.Percentile50, + TimeRange = AssessmentTimeRange.Day, + PerfDataStartOn = DateTimeOffset.Parse("2023-09-26T09:36:48.491Z"), + PerfDataEndOn = DateTimeOffset.Parse("2023-09-26T09:36:48.491Z"), + DiscountPercentage = 6, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, assessmentName, data); + MigrationAssessmentAssessmentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessmentsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentGroupResource created on azure + // for more information of creating MigrationAssessmentGroupResource, please refer to the document of MigrationAssessmentGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + ResourceIdentifier migrationAssessmentGroupResourceId = MigrationAssessmentGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName); + MigrationAssessmentGroupResource migrationAssessmentGroup = client.GetMigrationAssessmentGroupResource(migrationAssessmentGroupResourceId); + + // get the collection of this MigrationAssessmentAssessmentResource + MigrationAssessmentAssessmentCollection collection = migrationAssessmentGroup.GetMigrationAssessmentAssessments(); + + // invoke the operation + string assessmentName = "asm1"; + MigrationAssessmentAssessmentResource result = await collection.GetAsync(assessmentName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AssessmentsOperationsListByGroupMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentsOperations_ListByGroup_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentsOperations_ListByGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentGroupResource created on azure + // for more information of creating MigrationAssessmentGroupResource, please refer to the document of MigrationAssessmentGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + ResourceIdentifier migrationAssessmentGroupResourceId = MigrationAssessmentGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName); + MigrationAssessmentGroupResource migrationAssessmentGroup = client.GetMigrationAssessmentGroupResource(migrationAssessmentGroupResourceId); + + // get the collection of this MigrationAssessmentAssessmentResource + MigrationAssessmentAssessmentCollection collection = migrationAssessmentGroup.GetMigrationAssessmentAssessments(); + + // invoke the operation and iterate over the result + await foreach (MigrationAssessmentAssessmentResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAssessmentData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AssessmentsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentGroupResource created on azure + // for more information of creating MigrationAssessmentGroupResource, please refer to the document of MigrationAssessmentGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + ResourceIdentifier migrationAssessmentGroupResourceId = MigrationAssessmentGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName); + MigrationAssessmentGroupResource migrationAssessmentGroup = client.GetMigrationAssessmentGroupResource(migrationAssessmentGroupResourceId); + + // get the collection of this MigrationAssessmentAssessmentResource + MigrationAssessmentAssessmentCollection collection = migrationAssessmentGroup.GetMigrationAssessmentAssessments(); + + // invoke the operation + string assessmentName = "asm1"; + bool result = await collection.ExistsAsync(assessmentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AssessmentsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentGroupResource created on azure + // for more information of creating MigrationAssessmentGroupResource, please refer to the document of MigrationAssessmentGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + ResourceIdentifier migrationAssessmentGroupResourceId = MigrationAssessmentGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName); + MigrationAssessmentGroupResource migrationAssessmentGroup = client.GetMigrationAssessmentGroupResource(migrationAssessmentGroupResourceId); + + // get the collection of this MigrationAssessmentAssessmentResource + MigrationAssessmentAssessmentCollection collection = migrationAssessmentGroup.GetMigrationAssessmentAssessments(); + + // invoke the operation + string assessmentName = "asm1"; + NullableResponse response = await collection.GetIfExistsAsync(assessmentName); + MigrationAssessmentAssessmentResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAssessmentOptionCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAssessmentOptionCollection.cs new file mode 100644 index 000000000000..423778118449 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAssessmentOptionCollection.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentAssessmentOptionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessmentOptionsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentOptionsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentAssessmentOptionResource + MigrationAssessmentAssessmentOptionCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentAssessmentOptions(); + + // invoke the operation + string assessmentOptionsName = "default"; + MigrationAssessmentAssessmentOptionResource result = await collection.GetAsync(assessmentOptionsName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AssessmentOptionsOperationsListByAssessmentProjectMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentOptionsOperations_ListByAssessmentProject_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentOptionsOperations_ListByAssessmentProject" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "A926B99C-7F4C-4556-871E-20CB8C6ADB56"; + string resourceGroupName = "rgmigrate"; + string projectName = "fhodvffhuoqwbysrrqbizete"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentAssessmentOptionResource + MigrationAssessmentAssessmentOptionCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentAssessmentOptions(); + + // invoke the operation and iterate over the result + await foreach (MigrationAssessmentAssessmentOptionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAssessmentOptionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AssessmentOptionsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentOptionsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentAssessmentOptionResource + MigrationAssessmentAssessmentOptionCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentAssessmentOptions(); + + // invoke the operation + string assessmentOptionsName = "default"; + bool result = await collection.ExistsAsync(assessmentOptionsName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AssessmentOptionsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentOptionsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentAssessmentOptionResource + MigrationAssessmentAssessmentOptionCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentAssessmentOptions(); + + // invoke the operation + string assessmentOptionsName = "default"; + NullableResponse response = await collection.GetIfExistsAsync(assessmentOptionsName); + MigrationAssessmentAssessmentOptionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAssessmentOptionResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAssessmentOptionResource.cs new file mode 100644 index 000000000000..b02d85452ef9 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAssessmentOptionResource.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentAssessmentOptionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessmentOptionsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentOptionsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentOptionResource created on azure + // for more information of creating MigrationAssessmentAssessmentOptionResource, please refer to the document of MigrationAssessmentAssessmentOptionResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string assessmentOptionsName = "default"; + ResourceIdentifier migrationAssessmentAssessmentOptionResourceId = MigrationAssessmentAssessmentOptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentOptionsName); + MigrationAssessmentAssessmentOptionResource migrationAssessmentAssessmentOption = client.GetMigrationAssessmentAssessmentOptionResource(migrationAssessmentAssessmentOptionResourceId); + + // invoke the operation + MigrationAssessmentAssessmentOptionResource result = await migrationAssessmentAssessmentOption.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAssessmentProjectCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAssessmentProjectCollection.cs new file mode 100644 index 000000000000..85f5260c2dc2 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAssessmentProjectCollection.cs @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentAssessmentProjectCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_AssessmentProjectsOperationsCreateMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentProjectsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProjectsOperations_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MigrationAssessmentAssessmentProjectResource + MigrationAssessmentAssessmentProjectCollection collection = resourceGroupResource.GetMigrationAssessmentAssessmentProjects(); + + // invoke the operation + string projectName = "sakanwar1204project"; + MigrationAssessmentAssessmentProjectData data = new MigrationAssessmentAssessmentProjectData(new AzureLocation("southeastasia")) + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + AssessmentSolutionId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa", + ProjectStatus = AssessmentProjectStatus.Active, + CustomerWorkspaceId = null, + CustomerWorkspaceLocation = null, + PublicNetworkAccess = "Disabled", + CustomerStorageAccountArmId = new ResourceIdentifier("/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa"), + Tags = +{ +["Migrate Project"] = "sakanwar-PE-SEA" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, projectName, data); + MigrationAssessmentAssessmentProjectResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAssessmentProjectData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessmentProjectsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentProjectsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProjectsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MigrationAssessmentAssessmentProjectResource + MigrationAssessmentAssessmentProjectCollection collection = resourceGroupResource.GetMigrationAssessmentAssessmentProjects(); + + // invoke the operation + string projectName = "sakanwar1204project"; + MigrationAssessmentAssessmentProjectResource result = await collection.GetAsync(projectName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAssessmentProjectData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AssessmentProjectsOperationsListByResourceGroupMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentProjectsOperations_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProjectsOperations_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MigrationAssessmentAssessmentProjectResource + MigrationAssessmentAssessmentProjectCollection collection = resourceGroupResource.GetMigrationAssessmentAssessmentProjects(); + + // invoke the operation and iterate over the result + await foreach (MigrationAssessmentAssessmentProjectResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAssessmentProjectData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AssessmentProjectsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentProjectsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProjectsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MigrationAssessmentAssessmentProjectResource + MigrationAssessmentAssessmentProjectCollection collection = resourceGroupResource.GetMigrationAssessmentAssessmentProjects(); + + // invoke the operation + string projectName = "sakanwar1204project"; + bool result = await collection.ExistsAsync(projectName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AssessmentProjectsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentProjectsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProjectsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MigrationAssessmentAssessmentProjectResource + MigrationAssessmentAssessmentProjectCollection collection = resourceGroupResource.GetMigrationAssessmentAssessmentProjects(); + + // invoke the operation + string projectName = "sakanwar1204project"; + NullableResponse response = await collection.GetIfExistsAsync(projectName); + MigrationAssessmentAssessmentProjectResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAssessmentProjectData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAssessmentProjectResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAssessmentProjectResource.cs new file mode 100644 index 000000000000..069c225aced6 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAssessmentProjectResource.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migration.Assessment.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentAssessmentProjectResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessmentProjectsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentProjectsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProjectsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // invoke the operation + MigrationAssessmentAssessmentProjectResource result = await migrationAssessmentAssessmentProject.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAssessmentProjectData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_AssessmentProjectsOperationsDeleteMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentProjectsOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProjectsOperations_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "A926B99C-7F4C-4556-871E-20CB8C6ADB56"; + string resourceGroupName = "rgmigrate"; + string projectName = "zqrsyncwahgydqvwuchkfd"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // invoke the operation + await migrationAssessmentAssessmentProject.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_AssessmentProjectsOperationsUpdateMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentProjectsOperations_Update_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProjectsOperations_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // invoke the operation + MigrationAssessmentAssessmentProjectPatch patch = new MigrationAssessmentAssessmentProjectPatch + { + Tags = +{ +["Migrate Project"] = "sakanwar-PE-SEA" +}, + AssessmentSolutionId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa", + ProjectStatus = AssessmentProjectStatus.Active, + CustomerWorkspaceId = null, + CustomerWorkspaceLocation = null, + PublicNetworkAccess = "Disabled", + CustomerStorageAccountArmId = new ResourceIdentifier("/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa"), + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + }; + ArmOperation lro = await migrationAssessmentAssessmentProject.UpdateAsync(WaitUntil.Completed, patch); + MigrationAssessmentAssessmentProjectResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAssessmentProjectData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAssessmentProjectSummaryCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAssessmentProjectSummaryCollection.cs new file mode 100644 index 000000000000..f32c97abb37d --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAssessmentProjectSummaryCollection.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentAssessmentProjectSummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessmentProjectSummaryOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentProjectSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProjectSummaryOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "piyushapp1"; + string projectName = "PiyushApp15328project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentAssessmentProjectSummaryResource + MigrationAssessmentAssessmentProjectSummaryCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentAssessmentProjectSummaries(); + + // invoke the operation + string projectSummaryName = "default"; + MigrationAssessmentAssessmentProjectSummaryResource result = await collection.GetAsync(projectSummaryName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAssessmentProjectSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AssessmentProjectSummaryOperationsListByAssessmentProjectMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentProjectSummaryOperations_ListByAssessmentProject_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProjectSummaryOperations_ListByAssessmentProject" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "piyushapp1"; + string projectName = "PiyushApp15328project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentAssessmentProjectSummaryResource + MigrationAssessmentAssessmentProjectSummaryCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentAssessmentProjectSummaries(); + + // invoke the operation and iterate over the result + await foreach (MigrationAssessmentAssessmentProjectSummaryResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAssessmentProjectSummaryData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AssessmentProjectSummaryOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentProjectSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProjectSummaryOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "piyushapp1"; + string projectName = "PiyushApp15328project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentAssessmentProjectSummaryResource + MigrationAssessmentAssessmentProjectSummaryCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentAssessmentProjectSummaries(); + + // invoke the operation + string projectSummaryName = "default"; + bool result = await collection.ExistsAsync(projectSummaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AssessmentProjectSummaryOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentProjectSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProjectSummaryOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "piyushapp1"; + string projectName = "PiyushApp15328project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentAssessmentProjectSummaryResource + MigrationAssessmentAssessmentProjectSummaryCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentAssessmentProjectSummaries(); + + // invoke the operation + string projectSummaryName = "default"; + NullableResponse response = await collection.GetIfExistsAsync(projectSummaryName); + MigrationAssessmentAssessmentProjectSummaryResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAssessmentProjectSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAssessmentProjectSummaryResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAssessmentProjectSummaryResource.cs new file mode 100644 index 000000000000..aedf7b35e8c9 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAssessmentProjectSummaryResource.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentAssessmentProjectSummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessmentProjectSummaryOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentProjectSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProjectSummaryOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectSummaryResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectSummaryResource, please refer to the document of MigrationAssessmentAssessmentProjectSummaryResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "piyushapp1"; + string projectName = "PiyushApp15328project"; + string projectSummaryName = "default"; + ResourceIdentifier migrationAssessmentAssessmentProjectSummaryResourceId = MigrationAssessmentAssessmentProjectSummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, projectSummaryName); + MigrationAssessmentAssessmentProjectSummaryResource migrationAssessmentAssessmentProjectSummary = client.GetMigrationAssessmentAssessmentProjectSummaryResource(migrationAssessmentAssessmentProjectSummaryResourceId); + + // invoke the operation + MigrationAssessmentAssessmentProjectSummaryResource result = await migrationAssessmentAssessmentProjectSummary.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAssessmentProjectSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAssessmentResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAssessmentResource.cs new file mode 100644 index 000000000000..09de07c0a698 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAssessmentResource.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migration.Assessment.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentAssessmentResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessmentsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentResource created on azure + // for more information of creating MigrationAssessmentAssessmentResource, please refer to the document of MigrationAssessmentAssessmentResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + string assessmentName = "asm1"; + ResourceIdentifier migrationAssessmentAssessmentResourceId = MigrationAssessmentAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentAssessmentResource migrationAssessmentAssessment = client.GetMigrationAssessmentAssessmentResource(migrationAssessmentAssessmentResourceId); + + // invoke the operation + MigrationAssessmentAssessmentResource result = await migrationAssessmentAssessment.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_AssessmentsOperationsDeleteMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentsOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentsOperations_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentResource created on azure + // for more information of creating MigrationAssessmentAssessmentResource, please refer to the document of MigrationAssessmentAssessmentResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + string assessmentName = "asm1"; + ResourceIdentifier migrationAssessmentAssessmentResourceId = MigrationAssessmentAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentAssessmentResource migrationAssessmentAssessment = client.GetMigrationAssessmentAssessmentResource(migrationAssessmentAssessmentResourceId); + + // invoke the operation + await migrationAssessmentAssessment.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_AssessmentsOperationsCreateMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentsOperations_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentResource created on azure + // for more information of creating MigrationAssessmentAssessmentResource, please refer to the document of MigrationAssessmentAssessmentResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + string assessmentName = "asm1"; + ResourceIdentifier migrationAssessmentAssessmentResourceId = MigrationAssessmentAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentAssessmentResource migrationAssessmentAssessment = client.GetMigrationAssessmentAssessmentResource(migrationAssessmentAssessmentResourceId); + + // invoke the operation + MigrationAssessmentAssessmentData data = new MigrationAssessmentAssessmentData + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + EASubscriptionId = "kwsu", + AzurePricingTier = AzurePricingTier.Standard, + AzureStorageRedundancy = AzureStorageRedundancy.Unknown, + ReservedInstance = AzureReservedInstance.None, + AzureHybridUseBenefit = AzureHybridUseBenefit.Unknown, + AzureDiskTypes = { AzureDiskType.Premium, AzureDiskType.StandardSsd }, + AzureVmFamilies = { AzureVmFamily.DSeries, AzureVmFamily.Lsv2Series, AzureVmFamily.MSeries, AzureVmFamily.Mdsv2Series, AzureVmFamily.Msv2Series, AzureVmFamily.Mv2Series }, + VmUptime = new VmUptime + { + DaysPerMonth = 13, + HoursPerDay = 26, + }, + AzureLocation = new AzureLocation("njxbwdtsxzhichsnk"), + AzureOfferCode = AzureOfferCode.Unknown, + Currency = AzureCurrency.Unknown, + ScalingFactor = 24, + Percentile = PercentileOfUtilization.Percentile50, + TimeRange = AssessmentTimeRange.Day, + PerfDataStartOn = DateTimeOffset.Parse("2023-09-26T09:36:48.491Z"), + PerfDataEndOn = DateTimeOffset.Parse("2023-09-26T09:36:48.491Z"), + DiscountPercentage = 6, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased, + }; + ArmOperation lro = await migrationAssessmentAssessment.UpdateAsync(WaitUntil.Completed, data); + MigrationAssessmentAssessmentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task DownloadUrl_AssessmentsOperationsDownloadUrlMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentsOperations_DownloadUrl_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentsOperations_DownloadUrl" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentResource created on azure + // for more information of creating MigrationAssessmentAssessmentResource, please refer to the document of MigrationAssessmentAssessmentResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + string assessmentName = "asm1"; + ResourceIdentifier migrationAssessmentAssessmentResourceId = MigrationAssessmentAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentAssessmentResource migrationAssessmentAssessment = client.GetMigrationAssessmentAssessmentResource(migrationAssessmentAssessmentResourceId); + + // invoke the operation + BinaryData body = BinaryData.FromObjectAsJson(new object()); + ArmOperation lro = await migrationAssessmentAssessment.DownloadUrlAsync(WaitUntil.Completed, body); + AssessmentReportDownloadUri result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAvsAssessedMachineCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAvsAssessedMachineCollection.cs new file mode 100644 index 000000000000..fffb65a31789 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAvsAssessedMachineCollection.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentAvsAssessedMachineCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsAssessedMachinesOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AvsAssessedMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessedMachinesOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAvsAssessmentResource created on azure + // for more information of creating MigrationAssessmentAvsAssessmentResource, please refer to the document of MigrationAssessmentAvsAssessmentResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + string assessmentName = "asm2"; + ResourceIdentifier migrationAssessmentAvsAssessmentResourceId = MigrationAssessmentAvsAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentAvsAssessmentResource migrationAssessmentAvsAssessment = client.GetMigrationAssessmentAvsAssessmentResource(migrationAssessmentAvsAssessmentResourceId); + + // get the collection of this MigrationAssessmentAvsAssessedMachineResource + MigrationAssessmentAvsAssessedMachineCollection collection = migrationAssessmentAvsAssessment.GetMigrationAssessmentAvsAssessedMachines(); + + // invoke the operation + string avsAssessedMachineName = "b6d6fc6f-796f-4c16-96af-a6d22e0f12f7"; + MigrationAssessmentAvsAssessedMachineResource result = await collection.GetAsync(avsAssessedMachineName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAvsAssessedMachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AvsAssessedMachinesOperationsListByAvsAssessmentMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AvsAssessedMachinesOperations_ListByAvsAssessment_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessedMachinesOperations_ListByAvsAssessment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAvsAssessmentResource created on azure + // for more information of creating MigrationAssessmentAvsAssessmentResource, please refer to the document of MigrationAssessmentAvsAssessmentResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + string assessmentName = "asm2"; + ResourceIdentifier migrationAssessmentAvsAssessmentResourceId = MigrationAssessmentAvsAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentAvsAssessmentResource migrationAssessmentAvsAssessment = client.GetMigrationAssessmentAvsAssessmentResource(migrationAssessmentAvsAssessmentResourceId); + + // get the collection of this MigrationAssessmentAvsAssessedMachineResource + MigrationAssessmentAvsAssessedMachineCollection collection = migrationAssessmentAvsAssessment.GetMigrationAssessmentAvsAssessedMachines(); + + // invoke the operation and iterate over the result + string filter = "ujmwhhuloficljxcjyc"; + int? pageSize = 6; + string continuationToken = "qwrjeiukbcicfrkqlqsfukfc"; + int? totalRecordCount = 19; + await foreach (MigrationAssessmentAvsAssessedMachineResource item in collection.GetAllAsync(filter: filter, pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAvsAssessedMachineData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AvsAssessedMachinesOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AvsAssessedMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessedMachinesOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAvsAssessmentResource created on azure + // for more information of creating MigrationAssessmentAvsAssessmentResource, please refer to the document of MigrationAssessmentAvsAssessmentResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + string assessmentName = "asm2"; + ResourceIdentifier migrationAssessmentAvsAssessmentResourceId = MigrationAssessmentAvsAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentAvsAssessmentResource migrationAssessmentAvsAssessment = client.GetMigrationAssessmentAvsAssessmentResource(migrationAssessmentAvsAssessmentResourceId); + + // get the collection of this MigrationAssessmentAvsAssessedMachineResource + MigrationAssessmentAvsAssessedMachineCollection collection = migrationAssessmentAvsAssessment.GetMigrationAssessmentAvsAssessedMachines(); + + // invoke the operation + string avsAssessedMachineName = "b6d6fc6f-796f-4c16-96af-a6d22e0f12f7"; + bool result = await collection.ExistsAsync(avsAssessedMachineName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AvsAssessedMachinesOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AvsAssessedMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessedMachinesOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAvsAssessmentResource created on azure + // for more information of creating MigrationAssessmentAvsAssessmentResource, please refer to the document of MigrationAssessmentAvsAssessmentResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + string assessmentName = "asm2"; + ResourceIdentifier migrationAssessmentAvsAssessmentResourceId = MigrationAssessmentAvsAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentAvsAssessmentResource migrationAssessmentAvsAssessment = client.GetMigrationAssessmentAvsAssessmentResource(migrationAssessmentAvsAssessmentResourceId); + + // get the collection of this MigrationAssessmentAvsAssessedMachineResource + MigrationAssessmentAvsAssessedMachineCollection collection = migrationAssessmentAvsAssessment.GetMigrationAssessmentAvsAssessedMachines(); + + // invoke the operation + string avsAssessedMachineName = "b6d6fc6f-796f-4c16-96af-a6d22e0f12f7"; + NullableResponse response = await collection.GetIfExistsAsync(avsAssessedMachineName); + MigrationAssessmentAvsAssessedMachineResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAvsAssessedMachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAvsAssessedMachineResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAvsAssessedMachineResource.cs new file mode 100644 index 000000000000..cdea5205cd65 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAvsAssessedMachineResource.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentAvsAssessedMachineResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsAssessedMachinesOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AvsAssessedMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessedMachinesOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAvsAssessedMachineResource created on azure + // for more information of creating MigrationAssessmentAvsAssessedMachineResource, please refer to the document of MigrationAssessmentAvsAssessedMachineResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + string assessmentName = "asm2"; + string avsAssessedMachineName = "b6d6fc6f-796f-4c16-96af-a6d22e0f12f7"; + ResourceIdentifier migrationAssessmentAvsAssessedMachineResourceId = MigrationAssessmentAvsAssessedMachineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, avsAssessedMachineName); + MigrationAssessmentAvsAssessedMachineResource migrationAssessmentAvsAssessedMachine = client.GetMigrationAssessmentAvsAssessedMachineResource(migrationAssessmentAvsAssessedMachineResourceId); + + // invoke the operation + MigrationAssessmentAvsAssessedMachineResource result = await migrationAssessmentAvsAssessedMachine.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAvsAssessedMachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAvsAssessmentCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAvsAssessmentCollection.cs new file mode 100644 index 000000000000..0fdc0edfbf0c --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAvsAssessmentCollection.cs @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migration.Assessment.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentAvsAssessmentCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_AvsAssessmentsOperationsCreateMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AvsAssessmentsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentsOperations_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentGroupResource created on azure + // for more information of creating MigrationAssessmentGroupResource, please refer to the document of MigrationAssessmentGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + ResourceIdentifier migrationAssessmentGroupResourceId = MigrationAssessmentGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName); + MigrationAssessmentGroupResource migrationAssessmentGroup = client.GetMigrationAssessmentGroupResource(migrationAssessmentGroupResourceId); + + // get the collection of this MigrationAssessmentAvsAssessmentResource + MigrationAssessmentAvsAssessmentCollection collection = migrationAssessmentGroup.GetMigrationAssessmentAvsAssessments(); + + // invoke the operation + string assessmentName = "asm2"; + MigrationAssessmentAvsAssessmentData data = new MigrationAssessmentAvsAssessmentData + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + FailuresToTolerateAndRaidLevel = FttAndRaidLevel.Ftt1Raid1, + VcpuOversubscription = 4, + NodeType = AvsNodeType.AV36, + ReservedInstance = AzureReservedInstance.RI3Year, + MemOvercommit = 1, + DedupeCompression = 1.5, + IsStretchClusterEnabled = true, + AzureLocation = new AzureLocation("EastUs"), + AzureOfferCode = AzureOfferCode.MSAZR0003P, + Currency = AzureCurrency.USD, + ScalingFactor = 1, + Percentile = PercentileOfUtilization.Percentile95, + TimeRange = AssessmentTimeRange.Day, + PerfDataStartOn = DateTimeOffset.Parse("2023-09-25T13:35:56.5671462Z"), + PerfDataEndOn = DateTimeOffset.Parse("2023-09-26T13:35:56.5671462Z"), + DiscountPercentage = 0, + SizingCriterion = AssessmentSizingCriterion.AsOnPremises, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, assessmentName, data); + MigrationAssessmentAvsAssessmentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAvsAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsAssessmentsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AvsAssessmentsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentGroupResource created on azure + // for more information of creating MigrationAssessmentGroupResource, please refer to the document of MigrationAssessmentGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + ResourceIdentifier migrationAssessmentGroupResourceId = MigrationAssessmentGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName); + MigrationAssessmentGroupResource migrationAssessmentGroup = client.GetMigrationAssessmentGroupResource(migrationAssessmentGroupResourceId); + + // get the collection of this MigrationAssessmentAvsAssessmentResource + MigrationAssessmentAvsAssessmentCollection collection = migrationAssessmentGroup.GetMigrationAssessmentAvsAssessments(); + + // invoke the operation + string assessmentName = "asm2"; + MigrationAssessmentAvsAssessmentResource result = await collection.GetAsync(assessmentName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAvsAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AvsAssessmentsOperationsListByGroupMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AvsAssessmentsOperations_ListByGroup_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentsOperations_ListByGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentGroupResource created on azure + // for more information of creating MigrationAssessmentGroupResource, please refer to the document of MigrationAssessmentGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + ResourceIdentifier migrationAssessmentGroupResourceId = MigrationAssessmentGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName); + MigrationAssessmentGroupResource migrationAssessmentGroup = client.GetMigrationAssessmentGroupResource(migrationAssessmentGroupResourceId); + + // get the collection of this MigrationAssessmentAvsAssessmentResource + MigrationAssessmentAvsAssessmentCollection collection = migrationAssessmentGroup.GetMigrationAssessmentAvsAssessments(); + + // invoke the operation and iterate over the result + await foreach (MigrationAssessmentAvsAssessmentResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAvsAssessmentData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AvsAssessmentsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AvsAssessmentsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentGroupResource created on azure + // for more information of creating MigrationAssessmentGroupResource, please refer to the document of MigrationAssessmentGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + ResourceIdentifier migrationAssessmentGroupResourceId = MigrationAssessmentGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName); + MigrationAssessmentGroupResource migrationAssessmentGroup = client.GetMigrationAssessmentGroupResource(migrationAssessmentGroupResourceId); + + // get the collection of this MigrationAssessmentAvsAssessmentResource + MigrationAssessmentAvsAssessmentCollection collection = migrationAssessmentGroup.GetMigrationAssessmentAvsAssessments(); + + // invoke the operation + string assessmentName = "asm2"; + bool result = await collection.ExistsAsync(assessmentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AvsAssessmentsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AvsAssessmentsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentGroupResource created on azure + // for more information of creating MigrationAssessmentGroupResource, please refer to the document of MigrationAssessmentGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + ResourceIdentifier migrationAssessmentGroupResourceId = MigrationAssessmentGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName); + MigrationAssessmentGroupResource migrationAssessmentGroup = client.GetMigrationAssessmentGroupResource(migrationAssessmentGroupResourceId); + + // get the collection of this MigrationAssessmentAvsAssessmentResource + MigrationAssessmentAvsAssessmentCollection collection = migrationAssessmentGroup.GetMigrationAssessmentAvsAssessments(); + + // invoke the operation + string assessmentName = "asm2"; + NullableResponse response = await collection.GetIfExistsAsync(assessmentName); + MigrationAssessmentAvsAssessmentResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAvsAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAvsAssessmentOptionCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAvsAssessmentOptionCollection.cs new file mode 100644 index 000000000000..a8f51d76a71d --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAvsAssessmentOptionCollection.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentAvsAssessmentOptionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsAssessmentOptionsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AvsAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentOptionsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentAvsAssessmentOptionResource + MigrationAssessmentAvsAssessmentOptionCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentAvsAssessmentOptions(); + + // invoke the operation + string avsAssessmentOptionsName = "default"; + MigrationAssessmentAvsAssessmentOptionResource result = await collection.GetAsync(avsAssessmentOptionsName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAvsAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AvsAssessmentOptionsOperationsListByAssessmentProjectMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AvsAssessmentOptionsOperations_ListByAssessmentProject_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentOptionsOperations_ListByAssessmentProject" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentAvsAssessmentOptionResource + MigrationAssessmentAvsAssessmentOptionCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentAvsAssessmentOptions(); + + // invoke the operation and iterate over the result + await foreach (MigrationAssessmentAvsAssessmentOptionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAvsAssessmentOptionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AvsAssessmentOptionsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AvsAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentOptionsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentAvsAssessmentOptionResource + MigrationAssessmentAvsAssessmentOptionCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentAvsAssessmentOptions(); + + // invoke the operation + string avsAssessmentOptionsName = "default"; + bool result = await collection.ExistsAsync(avsAssessmentOptionsName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AvsAssessmentOptionsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AvsAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentOptionsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentAvsAssessmentOptionResource + MigrationAssessmentAvsAssessmentOptionCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentAvsAssessmentOptions(); + + // invoke the operation + string avsAssessmentOptionsName = "default"; + NullableResponse response = await collection.GetIfExistsAsync(avsAssessmentOptionsName); + MigrationAssessmentAvsAssessmentOptionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAvsAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAvsAssessmentOptionResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAvsAssessmentOptionResource.cs new file mode 100644 index 000000000000..e958fe7d0c21 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAvsAssessmentOptionResource.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentAvsAssessmentOptionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsAssessmentOptionsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AvsAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentOptionsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAvsAssessmentOptionResource created on azure + // for more information of creating MigrationAssessmentAvsAssessmentOptionResource, please refer to the document of MigrationAssessmentAvsAssessmentOptionResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string avsAssessmentOptionsName = "default"; + ResourceIdentifier migrationAssessmentAvsAssessmentOptionResourceId = MigrationAssessmentAvsAssessmentOptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, avsAssessmentOptionsName); + MigrationAssessmentAvsAssessmentOptionResource migrationAssessmentAvsAssessmentOption = client.GetMigrationAssessmentAvsAssessmentOptionResource(migrationAssessmentAvsAssessmentOptionResourceId); + + // invoke the operation + MigrationAssessmentAvsAssessmentOptionResource result = await migrationAssessmentAvsAssessmentOption.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAvsAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAvsAssessmentResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAvsAssessmentResource.cs new file mode 100644 index 000000000000..11d05e966090 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentAvsAssessmentResource.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migration.Assessment.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentAvsAssessmentResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsAssessmentsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AvsAssessmentsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAvsAssessmentResource created on azure + // for more information of creating MigrationAssessmentAvsAssessmentResource, please refer to the document of MigrationAssessmentAvsAssessmentResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + string assessmentName = "asm2"; + ResourceIdentifier migrationAssessmentAvsAssessmentResourceId = MigrationAssessmentAvsAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentAvsAssessmentResource migrationAssessmentAvsAssessment = client.GetMigrationAssessmentAvsAssessmentResource(migrationAssessmentAvsAssessmentResourceId); + + // invoke the operation + MigrationAssessmentAvsAssessmentResource result = await migrationAssessmentAvsAssessment.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAvsAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_AvsAssessmentsOperationsDeleteMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AvsAssessmentsOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentsOperations_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAvsAssessmentResource created on azure + // for more information of creating MigrationAssessmentAvsAssessmentResource, please refer to the document of MigrationAssessmentAvsAssessmentResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + string assessmentName = "asm2"; + ResourceIdentifier migrationAssessmentAvsAssessmentResourceId = MigrationAssessmentAvsAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentAvsAssessmentResource migrationAssessmentAvsAssessment = client.GetMigrationAssessmentAvsAssessmentResource(migrationAssessmentAvsAssessmentResourceId); + + // invoke the operation + await migrationAssessmentAvsAssessment.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_AvsAssessmentsOperationsCreateMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AvsAssessmentsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentsOperations_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAvsAssessmentResource created on azure + // for more information of creating MigrationAssessmentAvsAssessmentResource, please refer to the document of MigrationAssessmentAvsAssessmentResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + string assessmentName = "asm2"; + ResourceIdentifier migrationAssessmentAvsAssessmentResourceId = MigrationAssessmentAvsAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentAvsAssessmentResource migrationAssessmentAvsAssessment = client.GetMigrationAssessmentAvsAssessmentResource(migrationAssessmentAvsAssessmentResourceId); + + // invoke the operation + MigrationAssessmentAvsAssessmentData data = new MigrationAssessmentAvsAssessmentData + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + FailuresToTolerateAndRaidLevel = FttAndRaidLevel.Ftt1Raid1, + VcpuOversubscription = 4, + NodeType = AvsNodeType.AV36, + ReservedInstance = AzureReservedInstance.RI3Year, + MemOvercommit = 1, + DedupeCompression = 1.5, + IsStretchClusterEnabled = true, + AzureLocation = new AzureLocation("EastUs"), + AzureOfferCode = AzureOfferCode.MSAZR0003P, + Currency = AzureCurrency.USD, + ScalingFactor = 1, + Percentile = PercentileOfUtilization.Percentile95, + TimeRange = AssessmentTimeRange.Day, + PerfDataStartOn = DateTimeOffset.Parse("2023-09-25T13:35:56.5671462Z"), + PerfDataEndOn = DateTimeOffset.Parse("2023-09-26T13:35:56.5671462Z"), + DiscountPercentage = 0, + SizingCriterion = AssessmentSizingCriterion.AsOnPremises, + }; + ArmOperation lro = await migrationAssessmentAvsAssessment.UpdateAsync(WaitUntil.Completed, data); + MigrationAssessmentAvsAssessmentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAvsAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task DownloadUrl_AvsAssessmentsOperationsDownloadUrlMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AvsAssessmentsOperations_DownloadUrl_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentsOperations_DownloadUrl" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAvsAssessmentResource created on azure + // for more information of creating MigrationAssessmentAvsAssessmentResource, please refer to the document of MigrationAssessmentAvsAssessmentResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + string assessmentName = "asm2"; + ResourceIdentifier migrationAssessmentAvsAssessmentResourceId = MigrationAssessmentAvsAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentAvsAssessmentResource migrationAssessmentAvsAssessment = client.GetMigrationAssessmentAvsAssessmentResource(migrationAssessmentAvsAssessmentResourceId); + + // invoke the operation + BinaryData body = BinaryData.FromObjectAsJson(new object()); + ArmOperation lro = await migrationAssessmentAvsAssessment.DownloadUrlAsync(WaitUntil.Completed, body); + AssessmentReportDownloadUri result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentGroupCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentGroupCollection.cs new file mode 100644 index 000000000000..8a1f51e82e57 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentGroupCollection.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migration.Assessment.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentGroupCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_GroupsOperationsCreateMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/GroupsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "GroupsOperations_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentGroupResource + MigrationAssessmentGroupCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentGroups(); + + // invoke the operation + string groupName = "kuchatur-test"; + MigrationAssessmentGroupData data = new MigrationAssessmentGroupData + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + GroupType = MigrationAssessmentGroupType.Default, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, groupName, data); + MigrationAssessmentGroupResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GroupsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/GroupsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "GroupsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentGroupResource + MigrationAssessmentGroupCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentGroups(); + + // invoke the operation + string groupName = "kuchatur-test"; + MigrationAssessmentGroupResource result = await collection.GetAsync(groupName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_GroupsOperationsListByAssessmentProjectMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/GroupsOperations_ListByAssessmentProject_MaximumSet_Gen.json + // this example is just showing the usage of "GroupsOperations_ListByAssessmentProject" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentGroupResource + MigrationAssessmentGroupCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentGroups(); + + // invoke the operation and iterate over the result + await foreach (MigrationAssessmentGroupResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentGroupData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GroupsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/GroupsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "GroupsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentGroupResource + MigrationAssessmentGroupCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentGroups(); + + // invoke the operation + string groupName = "kuchatur-test"; + bool result = await collection.ExistsAsync(groupName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GroupsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/GroupsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "GroupsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentGroupResource + MigrationAssessmentGroupCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentGroups(); + + // invoke the operation + string groupName = "kuchatur-test"; + NullableResponse response = await collection.GetIfExistsAsync(groupName); + MigrationAssessmentGroupResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentGroupResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentGroupResource.cs new file mode 100644 index 000000000000..b12acb4f2276 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentGroupResource.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migration.Assessment.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentGroupResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GroupsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/GroupsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "GroupsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentGroupResource created on azure + // for more information of creating MigrationAssessmentGroupResource, please refer to the document of MigrationAssessmentGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + ResourceIdentifier migrationAssessmentGroupResourceId = MigrationAssessmentGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName); + MigrationAssessmentGroupResource migrationAssessmentGroup = client.GetMigrationAssessmentGroupResource(migrationAssessmentGroupResourceId); + + // invoke the operation + MigrationAssessmentGroupResource result = await migrationAssessmentGroup.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_GroupsOperationsDeleteMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/GroupsOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "GroupsOperations_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentGroupResource created on azure + // for more information of creating MigrationAssessmentGroupResource, please refer to the document of MigrationAssessmentGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + ResourceIdentifier migrationAssessmentGroupResourceId = MigrationAssessmentGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName); + MigrationAssessmentGroupResource migrationAssessmentGroup = client.GetMigrationAssessmentGroupResource(migrationAssessmentGroupResourceId); + + // invoke the operation + await migrationAssessmentGroup.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_GroupsOperationsCreateMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/GroupsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "GroupsOperations_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentGroupResource created on azure + // for more information of creating MigrationAssessmentGroupResource, please refer to the document of MigrationAssessmentGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + ResourceIdentifier migrationAssessmentGroupResourceId = MigrationAssessmentGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName); + MigrationAssessmentGroupResource migrationAssessmentGroup = client.GetMigrationAssessmentGroupResource(migrationAssessmentGroupResourceId); + + // invoke the operation + MigrationAssessmentGroupData data = new MigrationAssessmentGroupData + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + GroupType = MigrationAssessmentGroupType.Default, + }; + ArmOperation lro = await migrationAssessmentGroup.UpdateAsync(WaitUntil.Completed, data); + MigrationAssessmentGroupResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task UpdateMachines_GroupsOperationsUpdateMachinesMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/GroupsOperations_UpdateMachines_MaximumSet_Gen.json + // this example is just showing the usage of "GroupsOperations_UpdateMachines" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentGroupResource created on azure + // for more information of creating MigrationAssessmentGroupResource, please refer to the document of MigrationAssessmentGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string groupName = "kuchatur-test"; + ResourceIdentifier migrationAssessmentGroupResourceId = MigrationAssessmentGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName); + MigrationAssessmentGroupResource migrationAssessmentGroup = client.GetMigrationAssessmentGroupResource(migrationAssessmentGroupResourceId); + + // invoke the operation + MigrateGroupUpdateContent content = new MigrateGroupUpdateContent + { + ETag = new ETag("*"), + Properties = new MigrateGroupUpdateProperties + { + OperationType = MigrateGroupUpdateOperationType.Add, + Machines = { "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawrg/providers/Microsoft.Migrate/assessmentprojects/app18700project/machines/18895660-c5e5-4247-8cfc-cd24e1fe57f3" }, + }, + }; + ArmOperation lro = await migrationAssessmentGroup.UpdateMachinesAsync(WaitUntil.Completed, content); + MigrationAssessmentGroupResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentHyperVCollectorCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentHyperVCollectorCollection.cs new file mode 100644 index 000000000000..f3dabbab7b1b --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentHyperVCollectorCollection.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migration.Assessment.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentHyperVCollectorCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_HypervCollectorsOperationsCreateMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/HypervCollectorsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "HypervCollectorsOperations_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentHyperVCollectorResource + MigrationAssessmentHyperVCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentHyperVCollectors(); + + // invoke the operation + string hyperVCollectorName = "test-697cecollector"; + MigrationAssessmentHyperVCollectorData data = new MigrationAssessmentHyperVCollectorData + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + AgentProperties = new CollectorAgentPropertiesBase + { + Id = "12f1d90f-b3fa-4926-8893-e56803a09af0", + Version = "2.0.1993.19", + LastHeartbeatOn = DateTimeOffset.Parse("2022-07-07T14:25:35.708325Z"), + SpnDetails = new CollectorAgentSpnPropertiesBase + { + Authority = "https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", + ApplicationId = "e3bd6eaa-980b-40ae-a30e-2a5069ba097c", + Audience = "e3bd6eaa-980b-40ae-a30e-2a5069ba097c", + ObjectId = "01b9f9e2-2d82-414c-adaa-09ce259b6b44", + TenantId = Guid.Parse("72f988bf-86f1-41af-91ab-2d7cd011db47"), + }, + }, + DiscoverySiteId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawRG/providers/Microsoft.OffAzure/HyperVSites/test-60527site", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, hyperVCollectorName, data); + MigrationAssessmentHyperVCollectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentHyperVCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_HypervCollectorsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/HypervCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HypervCollectorsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentHyperVCollectorResource + MigrationAssessmentHyperVCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentHyperVCollectors(); + + // invoke the operation + string hyperVCollectorName = "test-697cecollector"; + MigrationAssessmentHyperVCollectorResource result = await collection.GetAsync(hyperVCollectorName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentHyperVCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_HypervCollectorsOperationsListByAssessmentProjectMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/HypervCollectorsOperations_ListByAssessmentProject_MaximumSet_Gen.json + // this example is just showing the usage of "HypervCollectorsOperations_ListByAssessmentProject" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentHyperVCollectorResource + MigrationAssessmentHyperVCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentHyperVCollectors(); + + // invoke the operation and iterate over the result + await foreach (MigrationAssessmentHyperVCollectorResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentHyperVCollectorData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_HypervCollectorsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/HypervCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HypervCollectorsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentHyperVCollectorResource + MigrationAssessmentHyperVCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentHyperVCollectors(); + + // invoke the operation + string hyperVCollectorName = "test-697cecollector"; + bool result = await collection.ExistsAsync(hyperVCollectorName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_HypervCollectorsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/HypervCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HypervCollectorsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentHyperVCollectorResource + MigrationAssessmentHyperVCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentHyperVCollectors(); + + // invoke the operation + string hyperVCollectorName = "test-697cecollector"; + NullableResponse response = await collection.GetIfExistsAsync(hyperVCollectorName); + MigrationAssessmentHyperVCollectorResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentHyperVCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentHyperVCollectorResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentHyperVCollectorResource.cs new file mode 100644 index 000000000000..92896aecd84b --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentHyperVCollectorResource.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migration.Assessment.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentHyperVCollectorResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_HypervCollectorsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/HypervCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HypervCollectorsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentHyperVCollectorResource created on azure + // for more information of creating MigrationAssessmentHyperVCollectorResource, please refer to the document of MigrationAssessmentHyperVCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + string hyperVCollectorName = "test-697cecollector"; + ResourceIdentifier migrationAssessmentHyperVCollectorResourceId = MigrationAssessmentHyperVCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, hyperVCollectorName); + MigrationAssessmentHyperVCollectorResource migrationAssessmentHyperVCollector = client.GetMigrationAssessmentHyperVCollectorResource(migrationAssessmentHyperVCollectorResourceId); + + // invoke the operation + MigrationAssessmentHyperVCollectorResource result = await migrationAssessmentHyperVCollector.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentHyperVCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_HypervCollectorsOperationsDeleteMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/HypervCollectorsOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "HypervCollectorsOperations_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentHyperVCollectorResource created on azure + // for more information of creating MigrationAssessmentHyperVCollectorResource, please refer to the document of MigrationAssessmentHyperVCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + string hyperVCollectorName = "test-697cecollector"; + ResourceIdentifier migrationAssessmentHyperVCollectorResourceId = MigrationAssessmentHyperVCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, hyperVCollectorName); + MigrationAssessmentHyperVCollectorResource migrationAssessmentHyperVCollector = client.GetMigrationAssessmentHyperVCollectorResource(migrationAssessmentHyperVCollectorResourceId); + + // invoke the operation + await migrationAssessmentHyperVCollector.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_HypervCollectorsOperationsCreateMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/HypervCollectorsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "HypervCollectorsOperations_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentHyperVCollectorResource created on azure + // for more information of creating MigrationAssessmentHyperVCollectorResource, please refer to the document of MigrationAssessmentHyperVCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + string hyperVCollectorName = "test-697cecollector"; + ResourceIdentifier migrationAssessmentHyperVCollectorResourceId = MigrationAssessmentHyperVCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, hyperVCollectorName); + MigrationAssessmentHyperVCollectorResource migrationAssessmentHyperVCollector = client.GetMigrationAssessmentHyperVCollectorResource(migrationAssessmentHyperVCollectorResourceId); + + // invoke the operation + MigrationAssessmentHyperVCollectorData data = new MigrationAssessmentHyperVCollectorData + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + AgentProperties = new CollectorAgentPropertiesBase + { + Id = "12f1d90f-b3fa-4926-8893-e56803a09af0", + Version = "2.0.1993.19", + LastHeartbeatOn = DateTimeOffset.Parse("2022-07-07T14:25:35.708325Z"), + SpnDetails = new CollectorAgentSpnPropertiesBase + { + Authority = "https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", + ApplicationId = "e3bd6eaa-980b-40ae-a30e-2a5069ba097c", + Audience = "e3bd6eaa-980b-40ae-a30e-2a5069ba097c", + ObjectId = "01b9f9e2-2d82-414c-adaa-09ce259b6b44", + TenantId = Guid.Parse("72f988bf-86f1-41af-91ab-2d7cd011db47"), + }, + }, + DiscoverySiteId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawRG/providers/Microsoft.OffAzure/HyperVSites/test-60527site", + }; + ArmOperation lro = await migrationAssessmentHyperVCollector.UpdateAsync(WaitUntil.Completed, data); + MigrationAssessmentHyperVCollectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentHyperVCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentImportCollectorCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentImportCollectorCollection.cs new file mode 100644 index 000000000000..ee62acbf42be --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentImportCollectorCollection.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migration.Assessment.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentImportCollectorCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ImportCollectorsOperationsCreateMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ImportCollectorsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "ImportCollectorsOperations_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentImportCollectorResource + MigrationAssessmentImportCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentImportCollectors(); + + // invoke the operation + string importCollectorName = "importCollectore7d5"; + MigrationAssessmentImportCollectorData data = new MigrationAssessmentImportCollectorData + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + DiscoverySiteId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourcegroups/ayagrawRG/providers/microsoft.offazure/importsites/actualSEA37d4importSite", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, importCollectorName, data); + MigrationAssessmentImportCollectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentImportCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ImportCollectorsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ImportCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ImportCollectorsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentImportCollectorResource + MigrationAssessmentImportCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentImportCollectors(); + + // invoke the operation + string importCollectorName = "importCollectore7d5"; + MigrationAssessmentImportCollectorResource result = await collection.GetAsync(importCollectorName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentImportCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ImportCollectorsOperationsListByAssessmentProjectMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ImportCollectorsOperations_ListByAssessmentProject_MaximumSet_Gen.json + // this example is just showing the usage of "ImportCollectorsOperations_ListByAssessmentProject" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentImportCollectorResource + MigrationAssessmentImportCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentImportCollectors(); + + // invoke the operation and iterate over the result + await foreach (MigrationAssessmentImportCollectorResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentImportCollectorData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_ImportCollectorsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ImportCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ImportCollectorsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentImportCollectorResource + MigrationAssessmentImportCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentImportCollectors(); + + // invoke the operation + string importCollectorName = "importCollectore7d5"; + bool result = await collection.ExistsAsync(importCollectorName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ImportCollectorsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ImportCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ImportCollectorsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentImportCollectorResource + MigrationAssessmentImportCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentImportCollectors(); + + // invoke the operation + string importCollectorName = "importCollectore7d5"; + NullableResponse response = await collection.GetIfExistsAsync(importCollectorName); + MigrationAssessmentImportCollectorResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentImportCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentImportCollectorResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentImportCollectorResource.cs new file mode 100644 index 000000000000..34afb5849311 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentImportCollectorResource.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migration.Assessment.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentImportCollectorResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ImportCollectorsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ImportCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ImportCollectorsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentImportCollectorResource created on azure + // for more information of creating MigrationAssessmentImportCollectorResource, please refer to the document of MigrationAssessmentImportCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + string importCollectorName = "importCollectore7d5"; + ResourceIdentifier migrationAssessmentImportCollectorResourceId = MigrationAssessmentImportCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, importCollectorName); + MigrationAssessmentImportCollectorResource migrationAssessmentImportCollector = client.GetMigrationAssessmentImportCollectorResource(migrationAssessmentImportCollectorResourceId); + + // invoke the operation + MigrationAssessmentImportCollectorResource result = await migrationAssessmentImportCollector.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentImportCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_ImportCollectorsOperationsDeleteMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ImportCollectorsOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "ImportCollectorsOperations_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentImportCollectorResource created on azure + // for more information of creating MigrationAssessmentImportCollectorResource, please refer to the document of MigrationAssessmentImportCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + string importCollectorName = "importCollectore7d5"; + ResourceIdentifier migrationAssessmentImportCollectorResourceId = MigrationAssessmentImportCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, importCollectorName); + MigrationAssessmentImportCollectorResource migrationAssessmentImportCollector = client.GetMigrationAssessmentImportCollectorResource(migrationAssessmentImportCollectorResourceId); + + // invoke the operation + await migrationAssessmentImportCollector.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ImportCollectorsOperationsCreateMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ImportCollectorsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "ImportCollectorsOperations_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentImportCollectorResource created on azure + // for more information of creating MigrationAssessmentImportCollectorResource, please refer to the document of MigrationAssessmentImportCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + string importCollectorName = "importCollectore7d5"; + ResourceIdentifier migrationAssessmentImportCollectorResourceId = MigrationAssessmentImportCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, importCollectorName); + MigrationAssessmentImportCollectorResource migrationAssessmentImportCollector = client.GetMigrationAssessmentImportCollectorResource(migrationAssessmentImportCollectorResourceId); + + // invoke the operation + MigrationAssessmentImportCollectorData data = new MigrationAssessmentImportCollectorData + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + DiscoverySiteId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourcegroups/ayagrawRG/providers/microsoft.offazure/importsites/actualSEA37d4importSite", + }; + ArmOperation lro = await migrationAssessmentImportCollector.UpdateAsync(WaitUntil.Completed, data); + MigrationAssessmentImportCollectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentImportCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentMachineCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentMachineCollection.cs new file mode 100644 index 000000000000..9f653a46f0f7 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentMachineCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentMachineCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_MachinesOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/MachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachinesOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentMachineResource + MigrationAssessmentMachineCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentMachines(); + + // invoke the operation + string machineName = "55082b89-99e2-4c40-b63f-d4f4d6ba961d"; + MigrationAssessmentMachineResource result = await collection.GetAsync(machineName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentMachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_MachinesOperationsListByAssessmentProjectMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/MachinesOperations_ListByAssessmentProject_MaximumSet_Gen.json + // this example is just showing the usage of "MachinesOperations_ListByAssessmentProject" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentMachineResource + MigrationAssessmentMachineCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentMachines(); + + // invoke the operation and iterate over the result + string filter = null; + int? pageSize = 1; + string continuationToken = null; + int? totalRecordCount = 1; + await foreach (MigrationAssessmentMachineResource item in collection.GetAllAsync(filter: filter, pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentMachineData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_MachinesOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/MachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachinesOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentMachineResource + MigrationAssessmentMachineCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentMachines(); + + // invoke the operation + string machineName = "55082b89-99e2-4c40-b63f-d4f4d6ba961d"; + bool result = await collection.ExistsAsync(machineName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_MachinesOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/MachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachinesOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentMachineResource + MigrationAssessmentMachineCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentMachines(); + + // invoke the operation + string machineName = "55082b89-99e2-4c40-b63f-d4f4d6ba961d"; + NullableResponse response = await collection.GetIfExistsAsync(machineName); + MigrationAssessmentMachineResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentMachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentMachineResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentMachineResource.cs new file mode 100644 index 000000000000..ce79846ae15e --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentMachineResource.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentMachineResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_MachinesOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/MachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachinesOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentMachineResource created on azure + // for more information of creating MigrationAssessmentMachineResource, please refer to the document of MigrationAssessmentMachineResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawrg"; + string projectName = "app18700project"; + string machineName = "55082b89-99e2-4c40-b63f-d4f4d6ba961d"; + ResourceIdentifier migrationAssessmentMachineResourceId = MigrationAssessmentMachineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, machineName); + MigrationAssessmentMachineResource migrationAssessmentMachine = client.GetMigrationAssessmentMachineResource(migrationAssessmentMachineResourceId); + + // invoke the operation + MigrationAssessmentMachineResource result = await migrationAssessmentMachine.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentMachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentPrivateEndpointConnectionCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentPrivateEndpointConnectionCollection.cs new file mode 100644 index 000000000000..bedf9ff31dcf --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentPrivateEndpointConnectionCollection.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migration.Assessment.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentPrivateEndpointConnectionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PrivateEndpointConnectionOperationsUpdateMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/PrivateEndpointConnectionOperations_Update_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnectionOperations_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentPrivateEndpointConnectionResource + MigrationAssessmentPrivateEndpointConnectionCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7"; + MigrationAssessmentPrivateEndpointConnectionData data = new MigrationAssessmentPrivateEndpointConnectionData + { + ConnectionState = new MigrationAssessmentPrivateLinkServiceConnectionState + { + Status = MigrationAssessmentPrivateEndpointServiceConnectionStatus.Approved, + Description = null, + ActionsRequired = "", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, privateEndpointConnectionName, data); + MigrationAssessmentPrivateEndpointConnectionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_PrivateEndpointConnectionOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/PrivateEndpointConnectionOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnectionOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentPrivateEndpointConnectionResource + MigrationAssessmentPrivateEndpointConnectionCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7"; + MigrationAssessmentPrivateEndpointConnectionResource result = await collection.GetAsync(privateEndpointConnectionName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_PrivateEndpointConnectionOperationsListByAssessmentProjectMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/PrivateEndpointConnectionOperations_ListByAssessmentProject_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnectionOperations_ListByAssessmentProject" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentPrivateEndpointConnectionResource + MigrationAssessmentPrivateEndpointConnectionCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentPrivateEndpointConnections(); + + // invoke the operation and iterate over the result + await foreach (MigrationAssessmentPrivateEndpointConnectionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentPrivateEndpointConnectionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_PrivateEndpointConnectionOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/PrivateEndpointConnectionOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnectionOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentPrivateEndpointConnectionResource + MigrationAssessmentPrivateEndpointConnectionCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7"; + bool result = await collection.ExistsAsync(privateEndpointConnectionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_PrivateEndpointConnectionOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/PrivateEndpointConnectionOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnectionOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentPrivateEndpointConnectionResource + MigrationAssessmentPrivateEndpointConnectionCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7"; + NullableResponse response = await collection.GetIfExistsAsync(privateEndpointConnectionName); + MigrationAssessmentPrivateEndpointConnectionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentPrivateEndpointConnectionResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentPrivateEndpointConnectionResource.cs new file mode 100644 index 000000000000..fc5e96c8deee --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentPrivateEndpointConnectionResource.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migration.Assessment.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentPrivateEndpointConnectionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_PrivateEndpointConnectionOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/PrivateEndpointConnectionOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnectionOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentPrivateEndpointConnectionResource created on azure + // for more information of creating MigrationAssessmentPrivateEndpointConnectionResource, please refer to the document of MigrationAssessmentPrivateEndpointConnectionResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + string privateEndpointConnectionName = "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7"; + ResourceIdentifier migrationAssessmentPrivateEndpointConnectionResourceId = MigrationAssessmentPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, privateEndpointConnectionName); + MigrationAssessmentPrivateEndpointConnectionResource migrationAssessmentPrivateEndpointConnection = client.GetMigrationAssessmentPrivateEndpointConnectionResource(migrationAssessmentPrivateEndpointConnectionResourceId); + + // invoke the operation + MigrationAssessmentPrivateEndpointConnectionResource result = await migrationAssessmentPrivateEndpointConnection.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_PrivateEndpointConnectionOperationsDeleteMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/PrivateEndpointConnectionOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnectionOperations_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentPrivateEndpointConnectionResource created on azure + // for more information of creating MigrationAssessmentPrivateEndpointConnectionResource, please refer to the document of MigrationAssessmentPrivateEndpointConnectionResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + string privateEndpointConnectionName = "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7"; + ResourceIdentifier migrationAssessmentPrivateEndpointConnectionResourceId = MigrationAssessmentPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, privateEndpointConnectionName); + MigrationAssessmentPrivateEndpointConnectionResource migrationAssessmentPrivateEndpointConnection = client.GetMigrationAssessmentPrivateEndpointConnectionResource(migrationAssessmentPrivateEndpointConnectionResourceId); + + // invoke the operation + await migrationAssessmentPrivateEndpointConnection.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_PrivateEndpointConnectionOperationsUpdateMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/PrivateEndpointConnectionOperations_Update_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnectionOperations_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentPrivateEndpointConnectionResource created on azure + // for more information of creating MigrationAssessmentPrivateEndpointConnectionResource, please refer to the document of MigrationAssessmentPrivateEndpointConnectionResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + string privateEndpointConnectionName = "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7"; + ResourceIdentifier migrationAssessmentPrivateEndpointConnectionResourceId = MigrationAssessmentPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, privateEndpointConnectionName); + MigrationAssessmentPrivateEndpointConnectionResource migrationAssessmentPrivateEndpointConnection = client.GetMigrationAssessmentPrivateEndpointConnectionResource(migrationAssessmentPrivateEndpointConnectionResourceId); + + // invoke the operation + MigrationAssessmentPrivateEndpointConnectionData data = new MigrationAssessmentPrivateEndpointConnectionData + { + ConnectionState = new MigrationAssessmentPrivateLinkServiceConnectionState + { + Status = MigrationAssessmentPrivateEndpointServiceConnectionStatus.Approved, + Description = null, + ActionsRequired = "", + }, + }; + ArmOperation lro = await migrationAssessmentPrivateEndpointConnection.UpdateAsync(WaitUntil.Completed, data); + MigrationAssessmentPrivateEndpointConnectionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentPrivateLinkResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentPrivateLinkResource.cs new file mode 100644 index 000000000000..3d54e5dedd5c --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentPrivateLinkResource.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentPrivateLinkResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_PrivateLinkResourceOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/PrivateLinkResourceOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateLinkResourceOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentPrivateLinkResource created on azure + // for more information of creating MigrationAssessmentPrivateLinkResource, please refer to the document of MigrationAssessmentPrivateLinkResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + string privateLinkResourceName = "Default"; + ResourceIdentifier migrationAssessmentPrivateLinkResourceId = MigrationAssessmentPrivateLinkResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, privateLinkResourceName); + MigrationAssessmentPrivateLinkResource migrationAssessmentPrivateLinkResource = client.GetMigrationAssessmentPrivateLinkResource(migrationAssessmentPrivateLinkResourceId); + + // invoke the operation + MigrationAssessmentPrivateLinkResource result = await migrationAssessmentPrivateLinkResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentPrivateLinkResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentPrivateLinkResourceCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentPrivateLinkResourceCollection.cs new file mode 100644 index 000000000000..6dc18fbf7b90 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentPrivateLinkResourceCollection.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentPrivateLinkResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_PrivateLinkResourceOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/PrivateLinkResourceOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateLinkResourceOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentPrivateLinkResource + MigrationAssessmentPrivateLinkResourceCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentPrivateLinkResources(); + + // invoke the operation + string privateLinkResourceName = "Default"; + MigrationAssessmentPrivateLinkResource result = await collection.GetAsync(privateLinkResourceName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentPrivateLinkResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_PrivateLinkResourceOperationsListByAssessmentProjectMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/PrivateLinkResourceOperations_ListByAssessmentProject_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateLinkResourceOperations_ListByAssessmentProject" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentPrivateLinkResource + MigrationAssessmentPrivateLinkResourceCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentPrivateLinkResources(); + + // invoke the operation and iterate over the result + await foreach (MigrationAssessmentPrivateLinkResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentPrivateLinkResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_PrivateLinkResourceOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/PrivateLinkResourceOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateLinkResourceOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentPrivateLinkResource + MigrationAssessmentPrivateLinkResourceCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentPrivateLinkResources(); + + // invoke the operation + string privateLinkResourceName = "Default"; + bool result = await collection.ExistsAsync(privateLinkResourceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_PrivateLinkResourceOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/PrivateLinkResourceOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateLinkResourceOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentPrivateLinkResource + MigrationAssessmentPrivateLinkResourceCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentPrivateLinkResources(); + + // invoke the operation + string privateLinkResourceName = "Default"; + NullableResponse response = await collection.GetIfExistsAsync(privateLinkResourceName); + MigrationAssessmentPrivateLinkResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentPrivateLinkResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentServerCollectorCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentServerCollectorCollection.cs new file mode 100644 index 000000000000..12eb8aa78715 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentServerCollectorCollection.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migration.Assessment.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentServerCollectorCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ServerCollectorsOperationsCreateMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ServerCollectorsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "ServerCollectorsOperations_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentServerCollectorResource + MigrationAssessmentServerCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentServerCollectors(); + + // invoke the operation + string serverCollectorName = "walter389fcollector"; + MigrationAssessmentServerCollectorData data = new MigrationAssessmentServerCollectorData + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + AgentProperties = new CollectorAgentPropertiesBase + { + Id = "498e4965-bbb1-47c2-8613-345baff9c509", + Version = null, + LastHeartbeatOn = default, + SpnDetails = new CollectorAgentSpnPropertiesBase + { + Authority = "https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", + ApplicationId = "65153d2f-9afb-44e8-b3ca-1369150b7354", + Audience = "65153d2f-9afb-44e8-b3ca-1369150b7354", + ObjectId = "ddde6f96-87c8-420b-9d4d-f16a5090519e", + TenantId = Guid.Parse("72f988bf-86f1-41af-91ab-2d7cd011db47"), + }, + }, + DiscoverySiteId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawRG/providers/Microsoft.OffAzure/ServerSites/walter7155site", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serverCollectorName, data); + MigrationAssessmentServerCollectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentServerCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ServerCollectorsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ServerCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ServerCollectorsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentServerCollectorResource + MigrationAssessmentServerCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentServerCollectors(); + + // invoke the operation + string serverCollectorName = "walter389fcollector"; + MigrationAssessmentServerCollectorResource result = await collection.GetAsync(serverCollectorName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentServerCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ServerCollectorsOperationsListByAssessmentProjectMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ServerCollectorsOperations_ListByAssessmentProject_MaximumSet_Gen.json + // this example is just showing the usage of "ServerCollectorsOperations_ListByAssessmentProject" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentServerCollectorResource + MigrationAssessmentServerCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentServerCollectors(); + + // invoke the operation and iterate over the result + await foreach (MigrationAssessmentServerCollectorResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentServerCollectorData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_ServerCollectorsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ServerCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ServerCollectorsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentServerCollectorResource + MigrationAssessmentServerCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentServerCollectors(); + + // invoke the operation + string serverCollectorName = "walter389fcollector"; + bool result = await collection.ExistsAsync(serverCollectorName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ServerCollectorsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ServerCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ServerCollectorsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentServerCollectorResource + MigrationAssessmentServerCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentServerCollectors(); + + // invoke the operation + string serverCollectorName = "walter389fcollector"; + NullableResponse response = await collection.GetIfExistsAsync(serverCollectorName); + MigrationAssessmentServerCollectorResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentServerCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentServerCollectorResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentServerCollectorResource.cs new file mode 100644 index 000000000000..dde10552d5eb --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentServerCollectorResource.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migration.Assessment.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentServerCollectorResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ServerCollectorsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ServerCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ServerCollectorsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentServerCollectorResource created on azure + // for more information of creating MigrationAssessmentServerCollectorResource, please refer to the document of MigrationAssessmentServerCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + string serverCollectorName = "walter389fcollector"; + ResourceIdentifier migrationAssessmentServerCollectorResourceId = MigrationAssessmentServerCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, serverCollectorName); + MigrationAssessmentServerCollectorResource migrationAssessmentServerCollector = client.GetMigrationAssessmentServerCollectorResource(migrationAssessmentServerCollectorResourceId); + + // invoke the operation + MigrationAssessmentServerCollectorResource result = await migrationAssessmentServerCollector.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentServerCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_ServerCollectorsOperationsDeleteMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ServerCollectorsOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "ServerCollectorsOperations_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentServerCollectorResource created on azure + // for more information of creating MigrationAssessmentServerCollectorResource, please refer to the document of MigrationAssessmentServerCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + string serverCollectorName = "walter389fcollector"; + ResourceIdentifier migrationAssessmentServerCollectorResourceId = MigrationAssessmentServerCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, serverCollectorName); + MigrationAssessmentServerCollectorResource migrationAssessmentServerCollector = client.GetMigrationAssessmentServerCollectorResource(migrationAssessmentServerCollectorResourceId); + + // invoke the operation + await migrationAssessmentServerCollector.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ServerCollectorsOperationsCreateMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/ServerCollectorsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "ServerCollectorsOperations_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentServerCollectorResource created on azure + // for more information of creating MigrationAssessmentServerCollectorResource, please refer to the document of MigrationAssessmentServerCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + string serverCollectorName = "walter389fcollector"; + ResourceIdentifier migrationAssessmentServerCollectorResourceId = MigrationAssessmentServerCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, serverCollectorName); + MigrationAssessmentServerCollectorResource migrationAssessmentServerCollector = client.GetMigrationAssessmentServerCollectorResource(migrationAssessmentServerCollectorResourceId); + + // invoke the operation + MigrationAssessmentServerCollectorData data = new MigrationAssessmentServerCollectorData + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + AgentProperties = new CollectorAgentPropertiesBase + { + Id = "498e4965-bbb1-47c2-8613-345baff9c509", + Version = null, + LastHeartbeatOn = default, + SpnDetails = new CollectorAgentSpnPropertiesBase + { + Authority = "https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", + ApplicationId = "65153d2f-9afb-44e8-b3ca-1369150b7354", + Audience = "65153d2f-9afb-44e8-b3ca-1369150b7354", + ObjectId = "ddde6f96-87c8-420b-9d4d-f16a5090519e", + TenantId = Guid.Parse("72f988bf-86f1-41af-91ab-2d7cd011db47"), + }, + }, + DiscoverySiteId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawRG/providers/Microsoft.OffAzure/ServerSites/walter7155site", + }; + ArmOperation lro = await migrationAssessmentServerCollector.UpdateAsync(WaitUntil.Completed, data); + MigrationAssessmentServerCollectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentServerCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentSqlAssessmentOptionCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentSqlAssessmentOptionCollection.cs new file mode 100644 index 000000000000..546de62bc313 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentSqlAssessmentOptionCollection.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentSqlAssessmentOptionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SqlAssessmentOptionsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentOptionsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentSqlAssessmentOptionResource + MigrationAssessmentSqlAssessmentOptionCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentSqlAssessmentOptions(); + + // invoke the operation + string assessmentOptionsName = "default"; + MigrationAssessmentSqlAssessmentOptionResource result = await collection.GetAsync(assessmentOptionsName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentSqlAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_SqlAssessmentOptionsOperationsListByAssessmentProjectMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlAssessmentOptionsOperations_ListByAssessmentProject_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentOptionsOperations_ListByAssessmentProject" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentSqlAssessmentOptionResource + MigrationAssessmentSqlAssessmentOptionCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentSqlAssessmentOptions(); + + // invoke the operation and iterate over the result + await foreach (MigrationAssessmentSqlAssessmentOptionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentSqlAssessmentOptionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_SqlAssessmentOptionsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentOptionsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentSqlAssessmentOptionResource + MigrationAssessmentSqlAssessmentOptionCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentSqlAssessmentOptions(); + + // invoke the operation + string assessmentOptionsName = "default"; + bool result = await collection.ExistsAsync(assessmentOptionsName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SqlAssessmentOptionsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentOptionsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentSqlAssessmentOptionResource + MigrationAssessmentSqlAssessmentOptionCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentSqlAssessmentOptions(); + + // invoke the operation + string assessmentOptionsName = "default"; + NullableResponse response = await collection.GetIfExistsAsync(assessmentOptionsName); + MigrationAssessmentSqlAssessmentOptionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentSqlAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentSqlAssessmentOptionResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentSqlAssessmentOptionResource.cs new file mode 100644 index 000000000000..bd3c31c52db2 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentSqlAssessmentOptionResource.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentSqlAssessmentOptionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SqlAssessmentOptionsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentOptionsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentOptionResource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentOptionResource, please refer to the document of MigrationAssessmentSqlAssessmentOptionResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string assessmentOptionsName = "default"; + ResourceIdentifier migrationAssessmentSqlAssessmentOptionResourceId = MigrationAssessmentSqlAssessmentOptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentOptionsName); + MigrationAssessmentSqlAssessmentOptionResource migrationAssessmentSqlAssessmentOption = client.GetMigrationAssessmentSqlAssessmentOptionResource(migrationAssessmentSqlAssessmentOptionResourceId); + + // invoke the operation + MigrationAssessmentSqlAssessmentOptionResource result = await migrationAssessmentSqlAssessmentOption.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentSqlAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentSqlAssessmentV2Collection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentSqlAssessmentV2Collection.cs new file mode 100644 index 000000000000..c1c87b42e5bf --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentSqlAssessmentV2Collection.cs @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migration.Assessment.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentSqlAssessmentV2Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_SqlAssessmentV2OperationsCreateMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlAssessmentV2Operations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV2Operations_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentGroupResource created on azure + // for more information of creating MigrationAssessmentGroupResource, please refer to the document of MigrationAssessmentGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + ResourceIdentifier migrationAssessmentGroupResourceId = MigrationAssessmentGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName); + MigrationAssessmentGroupResource migrationAssessmentGroup = client.GetMigrationAssessmentGroupResource(migrationAssessmentGroupResourceId); + + // get the collection of this MigrationAssessmentSqlAssessmentV2Resource + MigrationAssessmentSqlAssessmentV2Collection collection = migrationAssessmentGroup.GetMigrationAssessmentSqlAssessmentV2s(); + + // invoke the operation + string assessmentName = "test_swagger_1"; + MigrationAssessmentSqlAssessmentV2Data data = new MigrationAssessmentSqlAssessmentV2Data + { + OSLicense = MigrationAssessmentOSLicense.Unknown, + EnvironmentType = AssessmentEnvironmentType.Production, + EntityUptime = new EntityUptime + { + DaysPerMonth = 30, + HoursPerDay = 24, + }, + OptimizationLogic = SqlOptimizationLogic.MinimizeCost, + ReservedInstanceForVm = AzureReservedInstance.None, + AzureOfferCodeForVm = AzureOfferCode.MSAZR0003P, + AzureSqlManagedInstanceSettings = new SqlMISettings + { + AzureSqlServiceTier = AzureSqlServiceTier.Automatic, + AzureSqlInstanceType = AzureSqlInstanceType.SingleInstance, + }, + AzureSqlDatabaseSettings = new SqlDBSettings + { + AzureSqlServiceTier = AzureSqlServiceTier.Automatic, + AzureSqlDataBaseType = AzureSqlDataBaseType.SingleDatabase, + AzureSqlComputeTier = MigrationAssessmentComputeTier.Automatic, + AzureSqlPurchaseModel = AzureSqlPurchaseModel.VCore, + }, + AzureSqlVmInstanceSeries = { AzureVmFamily.Eadsv5Series }, + MultiSubnetIntent = MultiSubnetIntent.DisasterRecovery, + AsyncCommitModeIntent = AsyncCommitModeIntent.DisasterRecovery, + DisasterRecoveryLocation = new AzureLocation("EastAsia"), + EnableHadrAssessment = true, + ReservedInstance = AzureReservedInstance.None, + SqlServerLicense = SqlServerLicense.Unknown, + AzureLocation = new AzureLocation("SoutheastAsia"), + AzureOfferCode = AzureOfferCode.MSAZR0003P, + Currency = AzureCurrency.USD, + ScalingFactor = 1, + Percentile = PercentileOfUtilization.Percentile95, + TimeRange = AssessmentTimeRange.Day, + DiscountPercentage = 0, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, assessmentName, data); + MigrationAssessmentSqlAssessmentV2Resource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentSqlAssessmentV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SqlAssessmentV2OperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlAssessmentV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV2Operations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentGroupResource created on azure + // for more information of creating MigrationAssessmentGroupResource, please refer to the document of MigrationAssessmentGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + ResourceIdentifier migrationAssessmentGroupResourceId = MigrationAssessmentGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName); + MigrationAssessmentGroupResource migrationAssessmentGroup = client.GetMigrationAssessmentGroupResource(migrationAssessmentGroupResourceId); + + // get the collection of this MigrationAssessmentSqlAssessmentV2Resource + MigrationAssessmentSqlAssessmentV2Collection collection = migrationAssessmentGroup.GetMigrationAssessmentSqlAssessmentV2s(); + + // invoke the operation + string assessmentName = "test_swagger_1"; + MigrationAssessmentSqlAssessmentV2Resource result = await collection.GetAsync(assessmentName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentSqlAssessmentV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_SqlAssessmentV2OperationsListByGroupMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlAssessmentV2Operations_ListByGroup_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV2Operations_ListByGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentGroupResource created on azure + // for more information of creating MigrationAssessmentGroupResource, please refer to the document of MigrationAssessmentGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + ResourceIdentifier migrationAssessmentGroupResourceId = MigrationAssessmentGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName); + MigrationAssessmentGroupResource migrationAssessmentGroup = client.GetMigrationAssessmentGroupResource(migrationAssessmentGroupResourceId); + + // get the collection of this MigrationAssessmentSqlAssessmentV2Resource + MigrationAssessmentSqlAssessmentV2Collection collection = migrationAssessmentGroup.GetMigrationAssessmentSqlAssessmentV2s(); + + // invoke the operation and iterate over the result + await foreach (MigrationAssessmentSqlAssessmentV2Resource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentSqlAssessmentV2Data resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_SqlAssessmentV2OperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlAssessmentV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV2Operations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentGroupResource created on azure + // for more information of creating MigrationAssessmentGroupResource, please refer to the document of MigrationAssessmentGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + ResourceIdentifier migrationAssessmentGroupResourceId = MigrationAssessmentGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName); + MigrationAssessmentGroupResource migrationAssessmentGroup = client.GetMigrationAssessmentGroupResource(migrationAssessmentGroupResourceId); + + // get the collection of this MigrationAssessmentSqlAssessmentV2Resource + MigrationAssessmentSqlAssessmentV2Collection collection = migrationAssessmentGroup.GetMigrationAssessmentSqlAssessmentV2s(); + + // invoke the operation + string assessmentName = "test_swagger_1"; + bool result = await collection.ExistsAsync(assessmentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SqlAssessmentV2OperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlAssessmentV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV2Operations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentGroupResource created on azure + // for more information of creating MigrationAssessmentGroupResource, please refer to the document of MigrationAssessmentGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + ResourceIdentifier migrationAssessmentGroupResourceId = MigrationAssessmentGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName); + MigrationAssessmentGroupResource migrationAssessmentGroup = client.GetMigrationAssessmentGroupResource(migrationAssessmentGroupResourceId); + + // get the collection of this MigrationAssessmentSqlAssessmentV2Resource + MigrationAssessmentSqlAssessmentV2Collection collection = migrationAssessmentGroup.GetMigrationAssessmentSqlAssessmentV2s(); + + // invoke the operation + string assessmentName = "test_swagger_1"; + NullableResponse response = await collection.GetIfExistsAsync(assessmentName); + MigrationAssessmentSqlAssessmentV2Resource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentSqlAssessmentV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentSqlAssessmentV2Resource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentSqlAssessmentV2Resource.cs new file mode 100644 index 000000000000..d2f13c21a6f2 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentSqlAssessmentV2Resource.cs @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migration.Assessment.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentSqlAssessmentV2Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SqlAssessmentV2OperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlAssessmentV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV2Operations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2Resource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2Resource, please refer to the document of MigrationAssessmentSqlAssessmentV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2ResourceId = MigrationAssessmentSqlAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentSqlAssessmentV2Resource migrationAssessmentSqlAssessmentV2 = client.GetMigrationAssessmentSqlAssessmentV2Resource(migrationAssessmentSqlAssessmentV2ResourceId); + + // invoke the operation + MigrationAssessmentSqlAssessmentV2Resource result = await migrationAssessmentSqlAssessmentV2.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentSqlAssessmentV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_SqlAssessmentV2OperationsDeleteMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlAssessmentV2Operations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV2Operations_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2Resource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2Resource, please refer to the document of MigrationAssessmentSqlAssessmentV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2ResourceId = MigrationAssessmentSqlAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentSqlAssessmentV2Resource migrationAssessmentSqlAssessmentV2 = client.GetMigrationAssessmentSqlAssessmentV2Resource(migrationAssessmentSqlAssessmentV2ResourceId); + + // invoke the operation + await migrationAssessmentSqlAssessmentV2.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_SqlAssessmentV2OperationsCreateMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlAssessmentV2Operations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV2Operations_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2Resource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2Resource, please refer to the document of MigrationAssessmentSqlAssessmentV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2ResourceId = MigrationAssessmentSqlAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentSqlAssessmentV2Resource migrationAssessmentSqlAssessmentV2 = client.GetMigrationAssessmentSqlAssessmentV2Resource(migrationAssessmentSqlAssessmentV2ResourceId); + + // invoke the operation + MigrationAssessmentSqlAssessmentV2Data data = new MigrationAssessmentSqlAssessmentV2Data + { + OSLicense = MigrationAssessmentOSLicense.Unknown, + EnvironmentType = AssessmentEnvironmentType.Production, + EntityUptime = new EntityUptime + { + DaysPerMonth = 30, + HoursPerDay = 24, + }, + OptimizationLogic = SqlOptimizationLogic.MinimizeCost, + ReservedInstanceForVm = AzureReservedInstance.None, + AzureOfferCodeForVm = AzureOfferCode.MSAZR0003P, + AzureSqlManagedInstanceSettings = new SqlMISettings + { + AzureSqlServiceTier = AzureSqlServiceTier.Automatic, + AzureSqlInstanceType = AzureSqlInstanceType.SingleInstance, + }, + AzureSqlDatabaseSettings = new SqlDBSettings + { + AzureSqlServiceTier = AzureSqlServiceTier.Automatic, + AzureSqlDataBaseType = AzureSqlDataBaseType.SingleDatabase, + AzureSqlComputeTier = MigrationAssessmentComputeTier.Automatic, + AzureSqlPurchaseModel = AzureSqlPurchaseModel.VCore, + }, + AzureSqlVmInstanceSeries = { AzureVmFamily.Eadsv5Series }, + MultiSubnetIntent = MultiSubnetIntent.DisasterRecovery, + AsyncCommitModeIntent = AsyncCommitModeIntent.DisasterRecovery, + DisasterRecoveryLocation = new AzureLocation("EastAsia"), + EnableHadrAssessment = true, + ReservedInstance = AzureReservedInstance.None, + SqlServerLicense = SqlServerLicense.Unknown, + AzureLocation = new AzureLocation("SoutheastAsia"), + AzureOfferCode = AzureOfferCode.MSAZR0003P, + Currency = AzureCurrency.USD, + ScalingFactor = 1, + Percentile = PercentileOfUtilization.Percentile95, + TimeRange = AssessmentTimeRange.Day, + DiscountPercentage = 0, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased, + }; + ArmOperation lro = await migrationAssessmentSqlAssessmentV2.UpdateAsync(WaitUntil.Completed, data); + MigrationAssessmentSqlAssessmentV2Resource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentSqlAssessmentV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task DownloadUrl_SqlAssessmentV2OperationsDownloadUrlMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlAssessmentV2Operations_DownloadUrl_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV2Operations_DownloadUrl" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2Resource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2Resource, please refer to the document of MigrationAssessmentSqlAssessmentV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2ResourceId = MigrationAssessmentSqlAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentSqlAssessmentV2Resource migrationAssessmentSqlAssessmentV2 = client.GetMigrationAssessmentSqlAssessmentV2Resource(migrationAssessmentSqlAssessmentV2ResourceId); + + // invoke the operation + BinaryData body = BinaryData.FromObjectAsJson(new object()); + ArmOperation lro = await migrationAssessmentSqlAssessmentV2.DownloadUrlAsync(WaitUntil.Completed, body); + AssessmentReportDownloadUri result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentSqlAssessmentV2SummaryCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentSqlAssessmentV2SummaryCollection.cs new file mode 100644 index 000000000000..a8bdb895b66f --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentSqlAssessmentV2SummaryCollection.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentSqlAssessmentV2SummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SqlAssessmentV2SummaryOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV2SummaryOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2Resource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2Resource, please refer to the document of MigrationAssessmentSqlAssessmentV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2ResourceId = MigrationAssessmentSqlAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentSqlAssessmentV2Resource migrationAssessmentSqlAssessmentV2 = client.GetMigrationAssessmentSqlAssessmentV2Resource(migrationAssessmentSqlAssessmentV2ResourceId); + + // get the collection of this MigrationAssessmentSqlAssessmentV2SummaryResource + MigrationAssessmentSqlAssessmentV2SummaryCollection collection = migrationAssessmentSqlAssessmentV2.GetMigrationAssessmentSqlAssessmentV2Summaries(); + + // invoke the operation + string summaryName = "default"; + MigrationAssessmentSqlAssessmentV2SummaryResource result = await collection.GetAsync(summaryName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentSqlAssessmentV2SummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_SqlAssessmentV2SummaryOperationsListBySqlAssessmentV2MaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlAssessmentV2SummaryOperations_ListBySqlAssessmentV2_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV2SummaryOperations_ListBySqlAssessmentV2" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2Resource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2Resource, please refer to the document of MigrationAssessmentSqlAssessmentV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2ResourceId = MigrationAssessmentSqlAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentSqlAssessmentV2Resource migrationAssessmentSqlAssessmentV2 = client.GetMigrationAssessmentSqlAssessmentV2Resource(migrationAssessmentSqlAssessmentV2ResourceId); + + // get the collection of this MigrationAssessmentSqlAssessmentV2SummaryResource + MigrationAssessmentSqlAssessmentV2SummaryCollection collection = migrationAssessmentSqlAssessmentV2.GetMigrationAssessmentSqlAssessmentV2Summaries(); + + // invoke the operation and iterate over the result + await foreach (MigrationAssessmentSqlAssessmentV2SummaryResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentSqlAssessmentV2SummaryData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_SqlAssessmentV2SummaryOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV2SummaryOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2Resource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2Resource, please refer to the document of MigrationAssessmentSqlAssessmentV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2ResourceId = MigrationAssessmentSqlAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentSqlAssessmentV2Resource migrationAssessmentSqlAssessmentV2 = client.GetMigrationAssessmentSqlAssessmentV2Resource(migrationAssessmentSqlAssessmentV2ResourceId); + + // get the collection of this MigrationAssessmentSqlAssessmentV2SummaryResource + MigrationAssessmentSqlAssessmentV2SummaryCollection collection = migrationAssessmentSqlAssessmentV2.GetMigrationAssessmentSqlAssessmentV2Summaries(); + + // invoke the operation + string summaryName = "default"; + bool result = await collection.ExistsAsync(summaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SqlAssessmentV2SummaryOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV2SummaryOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2Resource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2Resource, please refer to the document of MigrationAssessmentSqlAssessmentV2Resource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2ResourceId = MigrationAssessmentSqlAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + MigrationAssessmentSqlAssessmentV2Resource migrationAssessmentSqlAssessmentV2 = client.GetMigrationAssessmentSqlAssessmentV2Resource(migrationAssessmentSqlAssessmentV2ResourceId); + + // get the collection of this MigrationAssessmentSqlAssessmentV2SummaryResource + MigrationAssessmentSqlAssessmentV2SummaryCollection collection = migrationAssessmentSqlAssessmentV2.GetMigrationAssessmentSqlAssessmentV2Summaries(); + + // invoke the operation + string summaryName = "default"; + NullableResponse response = await collection.GetIfExistsAsync(summaryName); + MigrationAssessmentSqlAssessmentV2SummaryResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentSqlAssessmentV2SummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentSqlAssessmentV2SummaryResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentSqlAssessmentV2SummaryResource.cs new file mode 100644 index 000000000000..514dd09059ba --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentSqlAssessmentV2SummaryResource.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentSqlAssessmentV2SummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SqlAssessmentV2SummaryOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV2SummaryOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlAssessmentV2SummaryResource created on azure + // for more information of creating MigrationAssessmentSqlAssessmentV2SummaryResource, please refer to the document of MigrationAssessmentSqlAssessmentV2SummaryResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string groupName = "test_fci_hadr"; + string assessmentName = "test_swagger_1"; + string summaryName = "default"; + ResourceIdentifier migrationAssessmentSqlAssessmentV2SummaryResourceId = MigrationAssessmentSqlAssessmentV2SummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, summaryName); + MigrationAssessmentSqlAssessmentV2SummaryResource migrationAssessmentSqlAssessmentV2Summary = client.GetMigrationAssessmentSqlAssessmentV2SummaryResource(migrationAssessmentSqlAssessmentV2SummaryResourceId); + + // invoke the operation + MigrationAssessmentSqlAssessmentV2SummaryResource result = await migrationAssessmentSqlAssessmentV2Summary.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentSqlAssessmentV2SummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentSqlCollectorCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentSqlCollectorCollection.cs new file mode 100644 index 000000000000..f1aa95fea1e3 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentSqlCollectorCollection.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migration.Assessment.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentSqlCollectorCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_SqlCollectorOperationsCreateMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlCollectorOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "SqlCollectorOperations_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentSqlCollectorResource + MigrationAssessmentSqlCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentSqlCollectors(); + + // invoke the operation + string collectorName = "fci-test0c1esqlsitecollector"; + MigrationAssessmentSqlCollectorData data = new MigrationAssessmentSqlCollectorData + { + AgentProperties = new CollectorAgentPropertiesBase + { + Id = "630da710-4d44-41f7-a189-72fe3db5502b-agent", + Version = null, + LastHeartbeatOn = default, + SpnDetails = new CollectorAgentSpnPropertiesBase + { + Authority = "https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", + ApplicationId = "db9c4c3d-477c-4d5a-817b-318276713565", + Audience = "db9c4c3d-477c-4d5a-817b-318276713565", + ObjectId = "e50236ad-ad07-47d4-af71-ed7b52d200d5", + TenantId = Guid.Parse("72f988bf-86f1-41af-91ab-2d7cd011db47"), + }, + }, + DiscoverySiteId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/bansalankit-rg/providers/Microsoft.OffAzure/MasterSites/fci-ankit-test6065mastersite/SqlSites/fci-ankit-test6065sqlsites", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, collectorName, data); + MigrationAssessmentSqlCollectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentSqlCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SqlCollectorOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlCollectorOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlCollectorOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentSqlCollectorResource + MigrationAssessmentSqlCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentSqlCollectors(); + + // invoke the operation + string collectorName = "fci-test0c1esqlsitecollector"; + MigrationAssessmentSqlCollectorResource result = await collection.GetAsync(collectorName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentSqlCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_SqlCollectorOperationsListByAssessmentProjectMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlCollectorOperations_ListByAssessmentProject_MaximumSet_Gen.json + // this example is just showing the usage of "SqlCollectorOperations_ListByAssessmentProject" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentSqlCollectorResource + MigrationAssessmentSqlCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentSqlCollectors(); + + // invoke the operation and iterate over the result + await foreach (MigrationAssessmentSqlCollectorResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentSqlCollectorData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_SqlCollectorOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlCollectorOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlCollectorOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentSqlCollectorResource + MigrationAssessmentSqlCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentSqlCollectors(); + + // invoke the operation + string collectorName = "fci-test0c1esqlsitecollector"; + bool result = await collection.ExistsAsync(collectorName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SqlCollectorOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlCollectorOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlCollectorOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentSqlCollectorResource + MigrationAssessmentSqlCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentSqlCollectors(); + + // invoke the operation + string collectorName = "fci-test0c1esqlsitecollector"; + NullableResponse response = await collection.GetIfExistsAsync(collectorName); + MigrationAssessmentSqlCollectorResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentSqlCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentSqlCollectorResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentSqlCollectorResource.cs new file mode 100644 index 000000000000..818e1c56359d --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentSqlCollectorResource.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migration.Assessment.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentSqlCollectorResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SqlCollectorOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlCollectorOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlCollectorOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlCollectorResource created on azure + // for more information of creating MigrationAssessmentSqlCollectorResource, please refer to the document of MigrationAssessmentSqlCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string collectorName = "fci-test0c1esqlsitecollector"; + ResourceIdentifier migrationAssessmentSqlCollectorResourceId = MigrationAssessmentSqlCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, collectorName); + MigrationAssessmentSqlCollectorResource migrationAssessmentSqlCollector = client.GetMigrationAssessmentSqlCollectorResource(migrationAssessmentSqlCollectorResourceId); + + // invoke the operation + MigrationAssessmentSqlCollectorResource result = await migrationAssessmentSqlCollector.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentSqlCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_SqlCollectorOperationsDeleteMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlCollectorOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "SqlCollectorOperations_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlCollectorResource created on azure + // for more information of creating MigrationAssessmentSqlCollectorResource, please refer to the document of MigrationAssessmentSqlCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string collectorName = "fci-test0c1esqlsitecollector"; + ResourceIdentifier migrationAssessmentSqlCollectorResourceId = MigrationAssessmentSqlCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, collectorName); + MigrationAssessmentSqlCollectorResource migrationAssessmentSqlCollector = client.GetMigrationAssessmentSqlCollectorResource(migrationAssessmentSqlCollectorResourceId); + + // invoke the operation + await migrationAssessmentSqlCollector.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_SqlCollectorOperationsCreateMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/SqlCollectorOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "SqlCollectorOperations_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentSqlCollectorResource created on azure + // for more information of creating MigrationAssessmentSqlCollectorResource, please refer to the document of MigrationAssessmentSqlCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string collectorName = "fci-test0c1esqlsitecollector"; + ResourceIdentifier migrationAssessmentSqlCollectorResourceId = MigrationAssessmentSqlCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, collectorName); + MigrationAssessmentSqlCollectorResource migrationAssessmentSqlCollector = client.GetMigrationAssessmentSqlCollectorResource(migrationAssessmentSqlCollectorResourceId); + + // invoke the operation + MigrationAssessmentSqlCollectorData data = new MigrationAssessmentSqlCollectorData + { + AgentProperties = new CollectorAgentPropertiesBase + { + Id = "630da710-4d44-41f7-a189-72fe3db5502b-agent", + Version = null, + LastHeartbeatOn = default, + SpnDetails = new CollectorAgentSpnPropertiesBase + { + Authority = "https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", + ApplicationId = "db9c4c3d-477c-4d5a-817b-318276713565", + Audience = "db9c4c3d-477c-4d5a-817b-318276713565", + ObjectId = "e50236ad-ad07-47d4-af71-ed7b52d200d5", + TenantId = Guid.Parse("72f988bf-86f1-41af-91ab-2d7cd011db47"), + }, + }, + DiscoverySiteId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/bansalankit-rg/providers/Microsoft.OffAzure/MasterSites/fci-ankit-test6065mastersite/SqlSites/fci-ankit-test6065sqlsites", + }; + ArmOperation lro = await migrationAssessmentSqlCollector.UpdateAsync(WaitUntil.Completed, data); + MigrationAssessmentSqlCollectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentSqlCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentVMwareCollectorCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentVMwareCollectorCollection.cs new file mode 100644 index 000000000000..13681d8f5022 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentVMwareCollectorCollection.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migration.Assessment.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentVMwareCollectorCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_VmwareCollectorsOperationsCreateMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/VmwareCollectorsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "VmwareCollectorsOperations_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentVMwareCollectorResource + MigrationAssessmentVMwareCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentVMwareCollectors(); + + // invoke the operation + string vmWareCollectorName = "Vmware2258collector"; + MigrationAssessmentVMwareCollectorData data = new MigrationAssessmentVMwareCollectorData + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + AgentProperties = new CollectorAgentPropertiesBase + { + Id = "fe243486-3318-41fa-aaba-c48b5df75308", + Version = "1.0.8.383", + LastHeartbeatOn = DateTimeOffset.Parse("2022-03-29T12:10:08.9167289Z"), + SpnDetails = new CollectorAgentSpnPropertiesBase + { + Authority = "https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", + ApplicationId = "82b3e452-c0e8-4662-8347-58282925ae84", + Audience = "82b3e452-c0e8-4662-8347-58282925ae84", + ObjectId = "3fc89111-1405-4938-9214-37aa4739401d", + TenantId = Guid.Parse("72f988bf-86f1-41af-91ab-2d7cd011db47"), + }, + }, + DiscoverySiteId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawRG/providers/Microsoft.OffAzure/VMwareSites/Vmware2744site", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, vmWareCollectorName, data); + MigrationAssessmentVMwareCollectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentVMwareCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_VmwareCollectorsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/VmwareCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "VmwareCollectorsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentVMwareCollectorResource + MigrationAssessmentVMwareCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentVMwareCollectors(); + + // invoke the operation + string vmWareCollectorName = "Vmware2258collector"; + MigrationAssessmentVMwareCollectorResource result = await collection.GetAsync(vmWareCollectorName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentVMwareCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_VmwareCollectorsOperationsListByAssessmentProjectMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/VmwareCollectorsOperations_ListByAssessmentProject_MaximumSet_Gen.json + // this example is just showing the usage of "VmwareCollectorsOperations_ListByAssessmentProject" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentVMwareCollectorResource + MigrationAssessmentVMwareCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentVMwareCollectors(); + + // invoke the operation and iterate over the result + await foreach (MigrationAssessmentVMwareCollectorResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentVMwareCollectorData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_VmwareCollectorsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/VmwareCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "VmwareCollectorsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentVMwareCollectorResource + MigrationAssessmentVMwareCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentVMwareCollectors(); + + // invoke the operation + string vmWareCollectorName = "Vmware2258collector"; + bool result = await collection.ExistsAsync(vmWareCollectorName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_VmwareCollectorsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/VmwareCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "VmwareCollectorsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentAssessmentProjectResource created on azure + // for more information of creating MigrationAssessmentAssessmentProjectResource, please refer to the document of MigrationAssessmentAssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + ResourceIdentifier migrationAssessmentAssessmentProjectResourceId = MigrationAssessmentAssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MigrationAssessmentAssessmentProjectResource migrationAssessmentAssessmentProject = client.GetMigrationAssessmentAssessmentProjectResource(migrationAssessmentAssessmentProjectResourceId); + + // get the collection of this MigrationAssessmentVMwareCollectorResource + MigrationAssessmentVMwareCollectorCollection collection = migrationAssessmentAssessmentProject.GetMigrationAssessmentVMwareCollectors(); + + // invoke the operation + string vmWareCollectorName = "Vmware2258collector"; + NullableResponse response = await collection.GetIfExistsAsync(vmWareCollectorName); + MigrationAssessmentVMwareCollectorResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentVMwareCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentVMwareCollectorResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentVMwareCollectorResource.cs new file mode 100644 index 000000000000..c7da3df3eb18 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_MigrationAssessmentVMwareCollectorResource.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migration.Assessment.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_MigrationAssessmentVMwareCollectorResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_VmwareCollectorsOperationsGetMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/VmwareCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "VmwareCollectorsOperations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentVMwareCollectorResource created on azure + // for more information of creating MigrationAssessmentVMwareCollectorResource, please refer to the document of MigrationAssessmentVMwareCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + string vmWareCollectorName = "Vmware2258collector"; + ResourceIdentifier migrationAssessmentVMwareCollectorResourceId = MigrationAssessmentVMwareCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, vmWareCollectorName); + MigrationAssessmentVMwareCollectorResource migrationAssessmentVMwareCollector = client.GetMigrationAssessmentVMwareCollectorResource(migrationAssessmentVMwareCollectorResourceId); + + // invoke the operation + MigrationAssessmentVMwareCollectorResource result = await migrationAssessmentVMwareCollector.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentVMwareCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_VmwareCollectorsOperationsDeleteMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/VmwareCollectorsOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "VmwareCollectorsOperations_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentVMwareCollectorResource created on azure + // for more information of creating MigrationAssessmentVMwareCollectorResource, please refer to the document of MigrationAssessmentVMwareCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + string vmWareCollectorName = "Vmware2258collector"; + ResourceIdentifier migrationAssessmentVMwareCollectorResourceId = MigrationAssessmentVMwareCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, vmWareCollectorName); + MigrationAssessmentVMwareCollectorResource migrationAssessmentVMwareCollector = client.GetMigrationAssessmentVMwareCollectorResource(migrationAssessmentVMwareCollectorResourceId); + + // invoke the operation + await migrationAssessmentVMwareCollector.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_VmwareCollectorsOperationsCreateMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/VmwareCollectorsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "VmwareCollectorsOperations_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigrationAssessmentVMwareCollectorResource created on azure + // for more information of creating MigrationAssessmentVMwareCollectorResource, please refer to the document of MigrationAssessmentVMwareCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + string vmWareCollectorName = "Vmware2258collector"; + ResourceIdentifier migrationAssessmentVMwareCollectorResourceId = MigrationAssessmentVMwareCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, vmWareCollectorName); + MigrationAssessmentVMwareCollectorResource migrationAssessmentVMwareCollector = client.GetMigrationAssessmentVMwareCollectorResource(migrationAssessmentVMwareCollectorResourceId); + + // invoke the operation + MigrationAssessmentVMwareCollectorData data = new MigrationAssessmentVMwareCollectorData + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + AgentProperties = new CollectorAgentPropertiesBase + { + Id = "fe243486-3318-41fa-aaba-c48b5df75308", + Version = "1.0.8.383", + LastHeartbeatOn = DateTimeOffset.Parse("2022-03-29T12:10:08.9167289Z"), + SpnDetails = new CollectorAgentSpnPropertiesBase + { + Authority = "https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", + ApplicationId = "82b3e452-c0e8-4662-8347-58282925ae84", + Audience = "82b3e452-c0e8-4662-8347-58282925ae84", + ObjectId = "3fc89111-1405-4938-9214-37aa4739401d", + TenantId = Guid.Parse("72f988bf-86f1-41af-91ab-2d7cd011db47"), + }, + }, + DiscoverySiteId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawRG/providers/Microsoft.OffAzure/VMwareSites/Vmware2744site", + }; + ArmOperation lro = await migrationAssessmentVMwareCollector.UpdateAsync(WaitUntil.Completed, data); + MigrationAssessmentVMwareCollectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentVMwareCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..164d3ccb690d --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetMigrationAssessmentAssessmentProjects_AssessmentProjectsOperationsListBySubscriptionMaximumSetGen() + { + // Generated from example definition: specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/stable/2023-03-15/examples/AssessmentProjectsOperations_ListBySubscription_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProjectsOperations_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (MigrationAssessmentAssessmentProjectResource item in subscriptionResource.GetMigrationAssessmentAssessmentProjectsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigrationAssessmentAssessmentProjectData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Azure.ResourceManager.Migration.Assessment.csproj b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Azure.ResourceManager.Migration.Assessment.csproj new file mode 100644 index 000000000000..367e5b1d062f --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Azure.ResourceManager.Migration.Assessment.csproj @@ -0,0 +1,8 @@ + + + 1.0.0-beta.1 + Azure.ResourceManager.Migration.Assessment + Azure Resource Manager client SDK for Azure resource provider Migration.Assessment. + azure;management;arm;resource manager;migration.assessment + + diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/ArmMigrationAssessmentModelFactory.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/ArmMigrationAssessmentModelFactory.cs new file mode 100644 index 000000000000..fbbaff217b6e --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/ArmMigrationAssessmentModelFactory.cs @@ -0,0 +1,2200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Model factory for models. + public static partial class ArmMigrationAssessmentModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The status of the last operation. + /// Time when this project was created. Date-Time represented in ISO-8601 format. + /// + /// Time when this project was last updated. Date-Time represented in ISO-8601 + /// format. + /// + /// Endpoint at which the collector agent can call agent REST API. + /// Assessment solution ARM id tracked by Microsoft.Migrate/migrateProjects. + /// Assessment project status. + /// The ARM id of service map workspace created by customer. + /// Location of service map workspace created by customer. + /// + /// This value can be set to 'enabled' to avoid breaking changes on existing + /// customer resources and templates. If set to 'disabled', traffic over public + /// interface is not allowed, and private endpoint connections would be the + /// exclusive access method. + /// + /// The list of private endpoint connections to the project. + /// + /// The ARM id of the storage account used for interactions when public access is + /// disabled. + /// + /// A new instance for mocking. + public static MigrationAssessmentAssessmentProjectData MigrationAssessmentAssessmentProjectData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MigrationAssessmentProvisioningState? provisioningState = null, DateTimeOffset? createOn = null, DateTimeOffset? updatedOn = null, string serviceEndpoint = null, string assessmentSolutionId = null, AssessmentProjectStatus? projectStatus = null, string customerWorkspaceId = null, string customerWorkspaceLocation = null, string publicNetworkAccess = null, IEnumerable privateEndpointConnections = null, ResourceIdentifier customerStorageAccountArmId = null) + { + tags ??= new Dictionary(); + privateEndpointConnections ??= new List(); + + return new MigrationAssessmentAssessmentProjectData( + id, + name, + resourceType, + systemData, + tags, + location, + provisioningState, + createOn, + updatedOn, + serviceEndpoint, + assessmentSolutionId, + projectStatus, + customerWorkspaceId, + customerWorkspaceLocation, + publicNetworkAccess, + privateEndpointConnections?.ToList(), + customerStorageAccountArmId, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The group ids for the private endpoint resource. + /// The private endpoint resource. + /// A collection of information about the state of the connection between service consumer and provider. + /// The provisioning state of the private endpoint connection resource. + /// A new instance for mocking. + public static MigrationAssessmentPrivateEndpointConnectionData MigrationAssessmentPrivateEndpointConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable groupIds = null, ResourceIdentifier privateEndpointId = null, MigrationAssessmentPrivateLinkServiceConnectionState connectionState = null, MigrationAssessmentPrivateEndpointConnectionProvisioningState? provisioningState = null) + { + groupIds ??= new List(); + + return new MigrationAssessmentPrivateEndpointConnectionData( + id, + name, + resourceType, + systemData, + groupIds?.ToList(), + privateEndpointId != null ? ResourceManagerModelFactory.SubResource(privateEndpointId) : null, + connectionState, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// Dictionary of VM families grouped by vm family name describing the targeted + /// azure locations of VM family and the category of the family. + /// + /// List of supported VM Families. + /// List of supported Azure regions for reserved instances. + /// List of supported currencies for reserved instances. + /// List of supported Azure offer codes for reserved instances. + /// Ultra disk related assessment options. + /// List of VM Families that support premium disks for assessments. + /// List of VM Families that support Savings plan offer for assessments. + /// List of Azure locations that support Savings plan offer for assessments. + /// A new instance for mocking. + public static MigrationAssessmentAssessmentOptionData MigrationAssessmentAssessmentOptionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable vmFamilies = null, IEnumerable reservedInstanceVmFamilies = null, IEnumerable reservedInstanceSupportedLocations = null, IEnumerable reservedInstanceSupportedCurrencies = null, IEnumerable reservedInstanceSupportedOffers = null, IEnumerable ultraDiskVmFamilies = null, IEnumerable premiumDiskVmFamilies = null, IEnumerable savingsPlanVmFamilies = null, IEnumerable savingsPlanSupportedLocations = null) + { + vmFamilies ??= new List(); + reservedInstanceVmFamilies ??= new List(); + reservedInstanceSupportedLocations ??= new List(); + reservedInstanceSupportedCurrencies ??= new List(); + reservedInstanceSupportedOffers ??= new List(); + ultraDiskVmFamilies ??= new List(); + premiumDiskVmFamilies ??= new List(); + savingsPlanVmFamilies ??= new List(); + savingsPlanSupportedLocations ??= new List(); + + return new MigrationAssessmentAssessmentOptionData( + id, + name, + resourceType, + systemData, + vmFamilies?.ToList(), + reservedInstanceVmFamilies?.ToList(), + reservedInstanceSupportedLocations?.ToList(), + reservedInstanceSupportedCurrencies?.ToList(), + reservedInstanceSupportedOffers?.ToList(), + ultraDiskVmFamilies?.ToList(), + premiumDiskVmFamilies?.ToList(), + savingsPlanVmFamilies?.ToList(), + savingsPlanSupportedLocations?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Name of the VM family. + /// List of Azure regions. + /// Category of the VM family. + /// A new instance for mocking. + public static VmFamilyConfig VmFamilyConfig(string familyName = null, IEnumerable targetLocations = null, IEnumerable category = null) + { + targetLocations ??= new List(); + category ??= new List(); + + return new VmFamilyConfig(familyName, targetLocations?.ToList(), category?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Family name. + /// List of locations where ultra disk is supported for this VMfamily. + /// A new instance for mocking. + public static UltraDiskAssessmentConfig UltraDiskAssessmentConfig(string familyName = null, IEnumerable targetLocations = null) + { + targetLocations ??= new List(); + + return new UltraDiskAssessmentConfig(familyName, targetLocations?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// AVS SKU Nodes. + /// FTT and Raid level values. + /// List of AVS nodes for RI. + /// List of supported Azure regions for reserved instances. + /// List of supported currencies for reserved instances. + /// List of supported Azure offer codes for reserved instances. + /// A new instance for mocking. + public static MigrationAssessmentAvsAssessmentOptionData MigrationAssessmentAvsAssessmentOptionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable avsNodes = null, IEnumerable failuresToTolerateAndRaidLevelValues = null, IEnumerable reservedInstanceAvsNodes = null, IEnumerable reservedInstanceSupportedLocations = null, IEnumerable reservedInstanceSupportedCurrencies = null, IEnumerable reservedInstanceSupportedOffers = null) + { + avsNodes ??= new List(); + failuresToTolerateAndRaidLevelValues ??= new List(); + reservedInstanceAvsNodes ??= new List(); + reservedInstanceSupportedLocations ??= new List(); + reservedInstanceSupportedCurrencies ??= new List(); + reservedInstanceSupportedOffers ??= new List(); + + return new MigrationAssessmentAvsAssessmentOptionData( + id, + name, + resourceType, + systemData, + avsNodes?.ToList(), + failuresToTolerateAndRaidLevelValues?.ToList(), + reservedInstanceAvsNodes?.ToList(), + reservedInstanceSupportedLocations?.ToList(), + reservedInstanceSupportedCurrencies?.ToList(), + reservedInstanceSupportedOffers?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The status of the last operation. + /// Whether the group has been created and is valid. + /// Number of machines part of this group. + /// List of References to Assessments created on this group. + /// List of assessment types supported on this group. + /// If the assessments are in running state. + /// Time when this group was created. Date-Time represented in ISO-8601 format. + /// Time when this group was last updated. Date-Time represented in ISO-8601 format. + /// The type of group. + /// A new instance for mocking. + public static MigrationAssessmentGroupData MigrationAssessmentGroupData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MigrationAssessmentProvisioningState? provisioningState = null, MigrationAssessmentGroupStatus? groupStatus = null, int? machineCount = null, IEnumerable assessments = null, IEnumerable supportedAssessmentTypes = null, bool? areAssessmentsRunning = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null, MigrationAssessmentGroupType? groupType = null) + { + assessments ??= new List(); + supportedAssessmentTypes ??= new List(); + + return new MigrationAssessmentGroupData( + id, + name, + resourceType, + systemData, + provisioningState, + groupStatus, + machineCount, + assessments?.ToList(), + supportedAssessmentTypes?.ToList(), + areAssessmentsRunning, + createdOn, + updatedOn, + groupType, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The status of the last operation. + /// + /// Gets or sets the assessment error summary. + /// This is the number of + /// machines affected by each type of error in this assessment. + /// + /// + /// Gets or sets the aggregate ultra storage cost for all machines in the + /// assessment. + /// + /// Gets the collection of cost components. + /// Gets or sets enterprise agreement subscription id. + /// Gets or sets Azure Pricing Tier - Free, Basic, etc. + /// Gets or sets the Azure Storage Redundancy. Example: Locally Redundant Storage. + /// Gets or sets the Azure Reserved Instance - 1-Year, 3-Year. + /// + /// Gets or sets the user configurable setting to display the azure hybrid use + /// benefit. + /// + /// Gets or sets the azure storage type. Premium, Standard etc. + /// Gets or sets the Azure VM families. + /// Gets the distribution of sqlInstances by support status. + /// Gets the distribution distribution of sqlInstances by service pack insight. + /// Gets the distribution by os name. + /// Gets or sets the aggregate Compute Cost for all machines in the assessment. + /// Gets or sets the aggregate Bandwidth Cost for all machines in the assessment. + /// Gets or sets the aggregate Storage Cost for all machines in the assessment. + /// + /// Gets or sets the aggregate premium storage cost for all machines in the + /// assessment. + /// + /// + /// Gets or sets the aggregate standard SSD storage cost for all the machines in + /// the assessment. + /// + /// + /// Gets or sets the Cloud suitability summary for all the machines in the + /// assessment. + /// + /// Gets or sets the Number of machines part of the assessment. + /// + /// Gets or sets the duration for which the VMs are up in the on-premises + /// environment. + /// + /// Gets the group type for the assessment. + /// Assessment type of the assessment. + /// Azure Location or Azure region where to which the machines will be migrated. + /// Azure Offer Code. + /// Currency in which prices should be reported. + /// + /// Percentage of buffer that user wants on performance metrics when recommending + /// Azure sizes. + /// + /// + /// Percentile of the utilization data values to be considered while assessing + /// machines. + /// + /// + /// Time Range for which the historic utilization data should be considered for + /// assessment. + /// + /// Gets or sets the start time to consider performance data for assessment. + /// Gets or sets the end time to consider performance data for assessment. + /// User configurable setting to display the Stage of Assessment. + /// Custom discount percentage. + /// Assessment sizing criterion. + /// Confidence Rating in Percentage. + /// Last time when rates were queried. + /// Date and Time when assessment was created. + /// Date and Time when assessment was last updated. + /// Whether assessment is in valid state and all machines have been assessed. + /// Schema version. + /// A new instance for mocking. + public static MigrationAssessmentAssessmentData MigrationAssessmentAssessmentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MigrationAssessmentProvisioningState? provisioningState = null, IReadOnlyDictionary assessmentErrorSummary = null, double? monthlyUltraStorageCost = null, IEnumerable costComponents = null, string eaSubscriptionId = null, AzurePricingTier? azurePricingTier = null, AzureStorageRedundancy? azureStorageRedundancy = null, AzureReservedInstance? reservedInstance = null, AzureHybridUseBenefit? azureHybridUseBenefit = null, IEnumerable azureDiskTypes = null, IEnumerable azureVmFamilies = null, IReadOnlyDictionary distributionBySupportStatus = null, IReadOnlyDictionary distributionByServicePackInsight = null, IReadOnlyDictionary distributionByOSName = null, double? monthlyComputeCost = null, double? monthlyBandwidthCost = null, double? monthlyStorageCost = null, double? monthlyPremiumStorageCost = null, double? monthlyStandardSsdStorageCost = null, IReadOnlyDictionary suitabilitySummary = null, int? numberOfMachines = null, VmUptime vmUptime = null, MigrationAssessmentGroupType? groupType = null, AssessmentType? assessmentType = null, AzureLocation? azureLocation = null, AzureOfferCode? azureOfferCode = null, AzureCurrency? currency = null, double? scalingFactor = null, PercentileOfUtilization? percentile = null, AssessmentTimeRange? timeRange = null, DateTimeOffset? perfDataStartOn = null, DateTimeOffset? perfDataEndOn = null, AssessmentStage? stage = null, double? discountPercentage = null, AssessmentSizingCriterion? sizingCriterion = null, double? confidenceRatingInPercentage = null, DateTimeOffset? pricesQueriedOn = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null, AssessmentStatus? status = null, string schemaVersion = null) + { + assessmentErrorSummary ??= new Dictionary(); + costComponents ??= new List(); + azureDiskTypes ??= new List(); + azureVmFamilies ??= new List(); + distributionBySupportStatus ??= new Dictionary(); + distributionByServicePackInsight ??= new Dictionary(); + distributionByOSName ??= new Dictionary(); + suitabilitySummary ??= new Dictionary(); + + return new MigrationAssessmentAssessmentData( + id, + name, + resourceType, + systemData, + provisioningState, + assessmentErrorSummary, + monthlyUltraStorageCost, + costComponents?.ToList(), + eaSubscriptionId, + azurePricingTier, + azureStorageRedundancy, + reservedInstance, + azureHybridUseBenefit, + azureDiskTypes?.ToList(), + azureVmFamilies?.ToList(), + distributionBySupportStatus, + distributionByServicePackInsight, + distributionByOSName, + monthlyComputeCost, + monthlyBandwidthCost, + monthlyStorageCost, + monthlyPremiumStorageCost, + monthlyStandardSsdStorageCost, + suitabilitySummary, + numberOfMachines, + vmUptime, + groupType, + assessmentType, + azureLocation, + azureOfferCode, + currency, + scalingFactor, + percentile, + timeRange, + perfDataStartOn, + perfDataEndOn, + stage, + discountPercentage, + sizingCriterion, + confidenceRatingInPercentage, + pricesQueriedOn, + createdOn, + updatedOn, + status, + schemaVersion, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the name of the component. + /// The value of the component. + /// The textual description of the component. + /// A new instance for mocking. + public static CostComponent CostComponent(CostComponentName? name = null, double? value = null, string description = null) + { + return new CostComponent(name, value, description, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// List of errors for this machine. + /// Dictionary of disks attached to the machine. Key is ID of disk. Value is a disk object. + /// Monthly ultra storage cost. + /// Gets or sets the processor details of the host. + /// Gets or sets the collection of cost components. + /// Gets the product support status related details. + /// Monthly networking cost. + /// Monthly storage cost. + /// Monthly premium storage cost. + /// Monthly standard SSD storage cost. + /// + /// List of Network Adapters that were assessed as part of this machine's + /// assessment. + /// + /// Recommended Azure Size for the machine. + /// Number of cores for recommended size. Read Only. + /// Megabytes of memory for recommended size. Read Only. + /// Monthly Compute cost calculated for Recommended size, for a 31-day month. + /// Gets the explanation if machine is not suitable for cloud. + /// Gets the details if machine is not suitable for cloud. + /// Assessed machine type. + /// Boot type of machine discovered in private data center. + /// Operating system as reported by datacenter management solution. + /// Operating system as reported by datacenter management solution. + /// Operating system version as reported by datacenter management solution. + /// Operating system architecture as reported by datacenter management solution. + /// When was machine first created. + /// When was machine last updated. + /// Display Name of the Machine. + /// Description for the machine. + /// Data center machine ARM id. + /// Data center management server ARM id. + /// Data center management server name. + /// Megabytes of memory found allocated for the machine in private data center. + /// Number of CPU cores found on the machine. + /// Confidence Rating in Percentage. + /// + /// Percentile of Percentage of Cores Utilized noted during time period T. + /// + /// Here N and T are settings on Assessment. + /// + /// + /// Percentile of Percentage of Memory Utilized noted during time period T. + /// + /// Here N and T are settings on Assessment. + /// + /// + /// Gets a value indicating whether machine is suitable for the cloud platform + /// selected. + /// + /// A new instance for mocking. + public static AssessedMachineData AssessedMachineData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable errors = null, IReadOnlyDictionary disks = null, double? monthlyUltraStorageCost = null, ProcessorInfo hostProcessor = null, IEnumerable costComponents = null, ProductSupportStatus productSupportStatus = null, double? monthlyBandwidthCost = null, double? monthlyStorageCost = null, double? monthlyPremiumStorageCost = null, double? monthlyStandardSsdStorageCost = null, IReadOnlyDictionary networkAdapters = null, AzureVmSize? recommendedSize = null, int? numberOfCoresForRecommendedSize = null, double? megabytesOfMemoryForRecommendedSize = null, double? monthlyComputeCostForRecommendedSize = null, AzureVmSuitabilityExplanation? suitabilityExplanation = null, AzureVmSuitabilityDetail? suitabilityDetail = null, AssessedMachineType? typePropertiesType = null, MachineBootType? bootType = null, string operatingSystemType = null, string operatingSystemName = null, string operatingSystemVersion = null, GuestOperatingSystemArchitecture? operatingSystemArchitecture = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null, string displayName = null, string description = null, ResourceIdentifier datacenterMachineArmId = null, ResourceIdentifier datacenterManagementServerArmId = null, string datacenterManagementServerName = null, double? megabytesOfMemory = null, int? numberOfCores = null, double? confidenceRatingInPercentage = null, double? percentageCoresUtilization = null, double? percentageMemoryUtilization = null, MigrationAssessmentCloudSuitability? suitability = null) + { + errors ??= new List(); + disks ??= new Dictionary(); + costComponents ??= new List(); + networkAdapters ??= new Dictionary(); + + return new AssessedMachineData( + id, + name, + resourceType, + systemData, + errors?.ToList(), + disks, + monthlyUltraStorageCost, + hostProcessor, + costComponents?.ToList(), + productSupportStatus, + monthlyBandwidthCost, + monthlyStorageCost, + monthlyPremiumStorageCost, + monthlyStandardSsdStorageCost, + networkAdapters, + recommendedSize, + numberOfCoresForRecommendedSize, + megabytesOfMemoryForRecommendedSize, + monthlyComputeCostForRecommendedSize, + suitabilityExplanation, + suitabilityDetail, + typePropertiesType, + bootType, + operatingSystemType, + operatingSystemName, + operatingSystemVersion, + operatingSystemArchitecture, + createdOn, + updatedOn, + displayName, + description, + datacenterMachineArmId, + datacenterManagementServerArmId, + datacenterManagementServerName, + megabytesOfMemory, + numberOfCores, + confidenceRatingInPercentage, + percentageCoresUtilization, + percentageMemoryUtilization, + suitability, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the error ID. + /// Gets the error code. + /// Gets the Run as account ID. + /// Gets the Appliance name. + /// Gets the error message. + /// Gets the error summary message. + /// Gets the agent scenario where this error occurred. + /// Gets the error possible causes. + /// Gets the recommended action for the error. + /// Gets the error severity. + /// Gets the error message parameters. + /// Gets the time stamp when the error was updated. + /// Gets the type of assessment impacted by this error. + /// A new instance for mocking. + public static MigrationAssessmentError MigrationAssessmentError(int? id = null, string code = null, string runAsAccountId = null, string applianceName = null, string message = null, string summaryMessage = null, string agentScenario = null, string possibleCauses = null, string recommendedAction = null, string severity = null, IReadOnlyDictionary messageParameters = null, DateTimeOffset? updatedOn = null, string impactedAssessmentType = null) + { + messageParameters ??= new Dictionary(); + + return new MigrationAssessmentError( + id, + code, + runAsAccountId, + applianceName, + message, + summaryMessage, + agentScenario, + possibleCauses, + recommendedAction, + severity, + messageParameters, + updatedOn, + impactedAssessmentType, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the suitability. + /// Gets the suitability explanation. + /// Gets the suitability detail. + /// Gets the recommended disk size. + /// Gets the recommended disk type. + /// Gets the recommended disk size. + /// Gets the recommended disk throughput. + /// Gets the recommended disk iops. + /// Gets the monthly storage cost. + /// Gets the name. + /// Gets the machine display name. + /// Gets the gigabytes provisioned. + /// Gets the megabytes per second of read. + /// Gets the megabytes per second of write. + /// Gets the number of read operations per second. + /// Gets the number of write operations per second. + /// A new instance for mocking. + public static AssessedDisk AssessedDisk(MigrationAssessmentCloudSuitability? suitability = null, AzureDiskSuitabilityExplanation? suitabilityExplanation = null, AzureDiskSuitabilityDetail? suitabilityDetail = null, AzureDiskSize? recommendedDiskSize = null, AzureDiskType? recommendedDiskType = null, int? gigabytesForRecommendedDiskSize = null, double? recommendDiskThroughputInMbps = null, double? recommendedDiskIops = null, double? monthlyStorageCost = null, string name = null, string displayName = null, double? gigabytesProvisioned = null, double? megabytesPerSecondOfRead = null, double? megabytesPerSecondOfWrite = null, double? numberOfReadOperationsPerSecond = null, double? numberOfWriteOperationsPerSecond = null) + { + return new AssessedDisk( + suitability, + suitabilityExplanation, + suitabilityDetail, + recommendedDiskSize, + recommendedDiskType, + gigabytesForRecommendedDiskSize, + recommendDiskThroughputInMbps, + recommendedDiskIops, + monthlyStorageCost, + name, + displayName, + gigabytesProvisioned, + megabytesPerSecondOfRead, + megabytesPerSecondOfWrite, + numberOfReadOperationsPerSecond, + numberOfWriteOperationsPerSecond, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets current version of ServicePack. + /// Gets or sets ServicePack of the product. + /// Gets or sets the Extended Security Update ESU status. + /// Gets or sets the support status of the product. + /// Gets or sets the ETA. + /// Gets or sets the current ESU support year. + /// Gets or sets the main stream end date of the product. + /// Gets or sets the extended support end date of the product. + /// Gets or sets the extended security update year 1 end date of the product. + /// Gets or sets the extended security update year 2 end date of the product. + /// Gets or sets the extended security update year 3 end date of the product. + /// A new instance for mocking. + public static ProductSupportStatus ProductSupportStatus(string currentVersion = null, string servicePackStatus = null, string esuStatus = null, string supportStatus = null, int? eta = null, string currentEsuYear = null, DateTimeOffset? mainstreamEndOn = null, DateTimeOffset? extendedSupportEndOn = null, DateTimeOffset? extendedSecurityUpdateYear1EndOn = null, DateTimeOffset? extendedSecurityUpdateYear2EndOn = null, DateTimeOffset? extendedSecurityUpdateYear3EndOn = null) + { + return new ProductSupportStatus( + currentVersion, + servicePackStatus, + esuStatus, + supportStatus, + eta, + currentEsuYear, + mainstreamEndOn, + extendedSupportEndOn, + extendedSecurityUpdateYear1EndOn, + extendedSecurityUpdateYear2EndOn, + extendedSecurityUpdateYear3EndOn, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the suitability. + /// Gets the suitability detail. + /// Gets the suitability explanation. + /// Gets the monthly bandwidth costs. + /// Gets the net gigabytes transmitted per month. + /// Gets the display name. + /// Gets the mac address. + /// Gets the ip addresses. + /// Gets the megabytes per second received. + /// Gets the megabytes per second transmitted. + /// A new instance for mocking. + public static AssessedNetworkAdapter AssessedNetworkAdapter(MigrationAssessmentCloudSuitability? suitability = null, AzureNetworkAdapterSuitabilityDetail? suitabilityDetail = null, AzureNetworkAdapterSuitabilityExplanation? suitabilityExplanation = null, double? monthlyBandwidthCosts = null, double? netGigabytesTransmittedPerMonth = null, string displayName = null, string macAddress = null, IEnumerable ipAddresses = null, double? megabytesPerSecondReceived = null, double? megabytesPerSecondTransmitted = null) + { + ipAddresses ??= new List(); + + return new AssessedNetworkAdapter( + suitability, + suitabilityDetail, + suitabilityExplanation, + monthlyBandwidthCosts, + netGigabytesTransmittedPerMonth, + displayName, + macAddress, + ipAddresses?.ToList(), + megabytesPerSecondReceived, + megabytesPerSecondTransmitted, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Hyperlink to download report. + /// Expiry date of download url. + /// A new instance for mocking. + public static AssessmentReportDownloadUri AssessmentReportDownloadUri(Uri assessmentReportUri = null, DateTimeOffset expireOn = default) + { + return new AssessmentReportDownloadUri(assessmentReportUri, expireOn, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The status of the last operation. + /// + /// Gets the assessment error summary. + /// This is the number of machines + /// affected by each type of error in this assessment. + /// + /// Failures to tolerate and RAID level in a common property. + /// VCPU over subscription. + /// AVS node type. + /// Reserved instance. + /// Total monthly cost. + /// Gets or sets the Assessment cloud suitability. + /// Gets or sets the Assessment suitability explanation. + /// Recommended number of nodes. + /// Predicted CPU utilization. + /// Predicted RAM utilization. + /// Predicted storage utilization. + /// Predicted total CPU cores used. + /// Predicted total RAM used in GB. + /// Predicted total Storage used in GB. + /// Number of machines part of the assessment. + /// Cloud suitability summary for all the machines in the assessment. + /// Memory overcommit. + /// De-duplication compression. + /// Limiting factor. + /// Is Stretch Cluster Enabled. + /// Gets the group type for the assessment. + /// Assessment type of the assessment. + /// Azure Location or Azure region where to which the machines will be migrated. + /// Azure Offer code according to which cost estimation is done. + /// Currency in which prices should be reported. + /// + /// Percentage of buffer that user wants on performance metrics when recommending + /// Azure sizes. + /// + /// + /// Percentile of the utilization data values to be considered while assessing + /// machines. + /// + /// + /// Time Range for which the historic utilization data should be considered for + /// assessment. + /// + /// Gets or sets the start time to consider performance data for assessment. + /// Gets or sets the end time to consider performance data for assessment. + /// User configurable setting to display the Stage of Assessment. + /// Custom discount percentage. + /// Assessment sizing criterion. + /// Confidence Rating in Percentage. + /// + /// Time when the Azure Prices were queried. Date-Time represented in ISO-8601 + /// format. + /// + /// Date and Time when assessment was created. + /// Date and Time when assessment was last updated. + /// Whether assessment is in valid state and all machines have been assessed. + /// Schema version. + /// A new instance for mocking. + public static MigrationAssessmentAvsAssessmentData MigrationAssessmentAvsAssessmentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MigrationAssessmentProvisioningState? provisioningState = null, IReadOnlyDictionary assessmentErrorSummary = null, FttAndRaidLevel? failuresToTolerateAndRaidLevel = null, double? vcpuOversubscription = null, AvsNodeType? nodeType = null, AzureReservedInstance? reservedInstance = null, double? totalMonthlyCost = null, MigrationAssessmentCloudSuitability? suitability = null, AvsSuitabilityExplanation? suitabilityExplanation = null, int? numberOfNodes = null, double? cpuUtilization = null, double? ramUtilization = null, double? storageUtilization = null, double? totalCpuCores = null, double? totalRamInGB = null, double? totalStorageInGB = null, int? numberOfMachines = null, IReadOnlyDictionary suitabilitySummary = null, double? memOvercommit = null, double? dedupeCompression = null, string limitingFactor = null, bool? isStretchClusterEnabled = null, MigrationAssessmentGroupType? groupType = null, AssessmentType? assessmentType = null, AzureLocation? azureLocation = null, AzureOfferCode? azureOfferCode = null, AzureCurrency? currency = null, double? scalingFactor = null, PercentileOfUtilization? percentile = null, AssessmentTimeRange? timeRange = null, DateTimeOffset? perfDataStartOn = null, DateTimeOffset? perfDataEndOn = null, AssessmentStage? stage = null, double? discountPercentage = null, AssessmentSizingCriterion? sizingCriterion = null, double? confidenceRatingInPercentage = null, DateTimeOffset? pricesQueriedOn = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null, AssessmentStatus? status = null, string schemaVersion = null) + { + assessmentErrorSummary ??= new Dictionary(); + suitabilitySummary ??= new Dictionary(); + + return new MigrationAssessmentAvsAssessmentData( + id, + name, + resourceType, + systemData, + provisioningState, + assessmentErrorSummary, + failuresToTolerateAndRaidLevel, + vcpuOversubscription, + nodeType, + reservedInstance, + totalMonthlyCost, + suitability, + suitabilityExplanation, + numberOfNodes, + cpuUtilization, + ramUtilization, + storageUtilization, + totalCpuCores, + totalRamInGB, + totalStorageInGB, + numberOfMachines, + suitabilitySummary, + memOvercommit, + dedupeCompression, + limitingFactor, + isStretchClusterEnabled, + groupType, + assessmentType, + azureLocation, + azureOfferCode, + currency, + scalingFactor, + percentile, + timeRange, + perfDataStartOn, + perfDataEndOn, + stage, + discountPercentage, + sizingCriterion, + confidenceRatingInPercentage, + pricesQueriedOn, + createdOn, + updatedOn, + status, + schemaVersion, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// List of errors for this machine. + /// List of Disks that were assessed as part of this machine's assessment. + /// + /// List of Network Adapters that were assessed as part of this machine's + /// assessment. + /// + /// Gets the storage in use. + /// Gets the explanation if machine is not suitable for cloud. + /// Gets the details if machine is not suitable for cloud. + /// Assessed machine type. + /// Boot type of machine discovered in private data center. + /// Operating system as reported by datacenter management solution. + /// Operating system as reported by datacenter management solution. + /// Operating system version as reported by datacenter management solution. + /// Operating system architecture as reported by datacenter management solution. + /// When was machine first created. + /// When was machine last updated. + /// Display Name of the Machine. + /// Description for the machine. + /// Data center machine ARM id. + /// Data center management server ARM id. + /// Data center management server name. + /// Megabytes of memory found allocated for the machine in private data center. + /// Number of CPU cores found on the machine. + /// Confidence Rating in Percentage. + /// + /// Percentile of Percentage of Cores Utilized noted during time period T. + /// + /// Here N and T are settings on Assessment. + /// + /// + /// Percentile of Percentage of Memory Utilized noted during time period T. + /// + /// Here N and T are settings on Assessment. + /// + /// + /// Gets a value indicating whether machine is suitable for the cloud platform + /// selected. + /// + /// A new instance for mocking. + public static MigrationAssessmentAvsAssessedMachineData MigrationAssessmentAvsAssessedMachineData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable errors = null, IReadOnlyDictionary disks = null, IReadOnlyDictionary networkAdapters = null, double? storageInUseGB = null, AvsVmSuitabilityExplanation? suitabilityExplanation = null, AvsVmSuitabilityDetail? suitabilityDetail = null, AssessedMachineType? typePropertiesType = null, MachineBootType? bootType = null, string operatingSystemType = null, string operatingSystemName = null, string operatingSystemVersion = null, GuestOperatingSystemArchitecture? operatingSystemArchitecture = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null, string displayName = null, string description = null, ResourceIdentifier datacenterMachineArmId = null, ResourceIdentifier datacenterManagementServerArmId = null, string datacenterManagementServerName = null, double? megabytesOfMemory = null, int? numberOfCores = null, double? confidenceRatingInPercentage = null, double? percentageCoresUtilization = null, double? percentageMemoryUtilization = null, MigrationAssessmentCloudSuitability? suitability = null) + { + errors ??= new List(); + disks ??= new Dictionary(); + networkAdapters ??= new Dictionary(); + + return new MigrationAssessmentAvsAssessedMachineData( + id, + name, + resourceType, + systemData, + errors?.ToList(), + disks, + networkAdapters, + storageInUseGB, + suitabilityExplanation, + suitabilityDetail, + typePropertiesType, + bootType, + operatingSystemType, + operatingSystemName, + operatingSystemVersion, + operatingSystemArchitecture, + createdOn, + updatedOn, + displayName, + description, + datacenterMachineArmId, + datacenterManagementServerArmId, + datacenterManagementServerName, + megabytesOfMemory, + numberOfCores, + confidenceRatingInPercentage, + percentageCoresUtilization, + percentageMemoryUtilization, + suitability, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the ID of the disk. + /// Gets the display name of the disk. + /// Gigabytes Provisioned for a disk in private data center. + /// Disk Read Throughput in MB/s. + /// Disk Write Throughput in MB/s. + /// Read Operations per second. + /// Write Operations per second. + /// A new instance for mocking. + public static AvsAssessedDisk AvsAssessedDisk(string name = null, string displayName = null, double? gigabytesProvisioned = null, double? megabytesPerSecondOfRead = null, double? megabytesPerSecondOfWrite = null, double? numberOfReadOperationsPerSecond = null, double? numberOfWriteOperationsPerSecond = null) + { + return new AvsAssessedDisk( + name, + displayName, + gigabytesProvisioned, + megabytesPerSecondOfRead, + megabytesPerSecondOfWrite, + numberOfReadOperationsPerSecond, + numberOfWriteOperationsPerSecond, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Mac address of the NIC. + /// IP V4 addresses for the machine. + /// Gets the display name of the network adapter. + /// + /// Gets the Received data for Network Adapter in MB/s. + /// This value is + /// the percentile of historical data based on options selected in Assessment. + /// + /// + /// Gets the Transmitted data for Network Adapter in MB/s. + /// This value + /// is the percentile of historical data based on options selected in Assessment. + /// + /// A new instance for mocking. + public static AvsAssessedNetworkAdapter AvsAssessedNetworkAdapter(string macAddress = null, IEnumerable ipAddresses = null, string displayName = null, double? megabytesPerSecondReceived = null, double? megabytesPerSecondTransmitted = null) + { + ipAddresses ??= new List(); + + return new AvsAssessedNetworkAdapter( + macAddress, + ipAddresses?.ToList(), + displayName, + megabytesPerSecondReceived, + megabytesPerSecondTransmitted, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The status of the last operation. + /// Gets or sets user configurable setting to display the azure hybrid use benefit. + /// Gets or sets user configurable setting to display the environment type. + /// + /// Gets or sets the duration for which the entity (SQL, VMs) are up in the + /// on-premises environment. + /// + /// Gets or sets SQL optimization logic. + /// Gets or sets azure reserved instance for VM. + /// Gets or sets Azure Offer Code for VM. + /// Gets or sets the Enterprise agreement subscription id. + /// Gets or sets user configurable SQL managed instance settings. + /// Gets or sets user configurable SQL database settings. + /// Gets or sets user configurable SQL VM settings. + /// Gets or sets user preference indicating intent of multi-subnet configuration. + /// Gets or sets user preference indicating intent of async commit mode. + /// Gets or sets a value indicating whether internet access is available. + /// + /// Gets or sets the Azure Location or Azure region where to which the machines + /// will be migrated. + /// + /// Gets or sets a value indicating whether HADR assessments needs to be created. + /// Gets or sets a value indicating azure security offering type. + /// Reserved instance. + /// SQL server license. + /// Gets the group type for the assessment. + /// Assessment type of the assessment. + /// Azure Location or Azure region where to which the machines will be migrated. + /// Azure Offer Code. + /// Currency in which prices should be reported. + /// + /// Percentage of buffer that user wants on performance metrics when recommending + /// Azure sizes. + /// + /// + /// Percentile of the utilization data values to be considered while assessing + /// machines. + /// + /// + /// Time Range for which the historic utilization data should be considered for + /// assessment. + /// + /// Gets or sets the start time to consider performance data for assessment. + /// Gets or sets the end time to consider performance data for assessment. + /// User configurable setting to display the Stage of Assessment. + /// Custom discount percentage. + /// Assessment sizing criterion. + /// Confidence Rating in Percentage. + /// Last time when rates were queried. + /// Date and Time when assessment was created. + /// Date and Time when assessment was last updated. + /// Whether assessment is in valid state and all machines have been assessed. + /// Schema version. + /// A new instance for mocking. + public static MigrationAssessmentSqlAssessmentV2Data MigrationAssessmentSqlAssessmentV2Data(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MigrationAssessmentProvisioningState? provisioningState = null, MigrationAssessmentOSLicense? osLicense = null, AssessmentEnvironmentType? environmentType = null, EntityUptime entityUptime = null, SqlOptimizationLogic? optimizationLogic = null, AzureReservedInstance? reservedInstanceForVm = null, AzureOfferCode? azureOfferCodeForVm = null, string eaSubscriptionId = null, SqlMISettings azureSqlManagedInstanceSettings = null, SqlDBSettings azureSqlDatabaseSettings = null, IEnumerable azureSqlVmInstanceSeries = null, MultiSubnetIntent? multiSubnetIntent = null, AsyncCommitModeIntent? asyncCommitModeIntent = null, bool? isInternetAccessAvailable = null, AzureLocation? disasterRecoveryLocation = null, bool? enableHadrAssessment = null, AzureSecurityOfferingType? azureSecurityOfferingType = null, AzureReservedInstance? reservedInstance = null, SqlServerLicense? sqlServerLicense = null, MigrationAssessmentGroupType? groupType = null, AssessmentType? assessmentType = null, AzureLocation? azureLocation = null, AzureOfferCode? azureOfferCode = null, AzureCurrency? currency = null, double? scalingFactor = null, PercentileOfUtilization? percentile = null, AssessmentTimeRange? timeRange = null, DateTimeOffset? perfDataStartOn = null, DateTimeOffset? perfDataEndOn = null, AssessmentStage? stage = null, double? discountPercentage = null, AssessmentSizingCriterion? sizingCriterion = null, double? confidenceRatingInPercentage = null, DateTimeOffset? pricesQueriedOn = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null, AssessmentStatus? status = null, string schemaVersion = null) + { + azureSqlVmInstanceSeries ??= new List(); + + return new MigrationAssessmentSqlAssessmentV2Data( + id, + name, + resourceType, + systemData, + provisioningState, + osLicense, + environmentType, + entityUptime, + optimizationLogic, + reservedInstanceForVm, + azureOfferCodeForVm, + eaSubscriptionId, + azureSqlManagedInstanceSettings, + azureSqlDatabaseSettings, + azureSqlVmInstanceSeries != null ? new SqlVmSettings(azureSqlVmInstanceSeries?.ToList(), serializedAdditionalRawData: null) : null, + multiSubnetIntent, + asyncCommitModeIntent, + isInternetAccessAvailable, + disasterRecoveryLocation, + enableHadrAssessment, + azureSecurityOfferingType, + reservedInstance, + sqlServerLicense, + groupType, + assessmentType, + azureLocation, + azureOfferCode, + currency, + scalingFactor, + percentile, + timeRange, + perfDataStartOn, + perfDataEndOn, + stage, + discountPercentage, + sizingCriterion, + confidenceRatingInPercentage, + pricesQueriedOn, + createdOn, + updatedOn, + status, + schemaVersion, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets or sets the recommended azure SQL target type. + /// Gets or sets the recommended azure SQL suitability. + /// + /// Gets or sets the aggregated cache size of this database. This is a performance + /// data metric for this DB. + /// + /// Gets the product support status related details. + /// Gets or sets the azure SQL MI suitability details. + /// Gets or sets the azure SQL DB suitability details. + /// + /// Gets a value indicating whether the assessed SQL database is highly available + /// or not. + /// + /// + /// Gets the linked availability group overview if the database being assessed is + /// highly available. + /// + /// Machine arm id. + /// Assessed SQL instance arm id. + /// Machine display name. + /// SQL instance name. + /// SQL database name. + /// SQL database size in megabytes. + /// Database compatibility level. + /// SQL database SDS arm id. + /// The percentage of the total number of cores being utilized by the SQL database. + /// The read throughput of the SQL database. + /// The write throughput of the SQL database. + /// The read operations per second of the SQL database. + /// The write operations per second of the SQL database. + /// Confidence Rating in Percentage. + /// Assessment sizing criterion. + /// When was assessed SQL database first created. + /// When was assessed SQL database last updated. + /// A new instance for mocking. + public static AssessedSqlDatabaseV2Data AssessedSqlDatabaseV2Data(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MigrationAssessmentTargetType? recommendedAzureSqlTargetType = null, RecommendedSuitability? recommendedSuitability = null, double? bufferCacheSizeInMB = null, ProductSupportStatus productSupportStatus = null, SqlAssessmentV2PaasSuitabilityDetails azureSqlMISuitabilityDetails = null, SqlAssessmentV2PaasSuitabilityDetails azureSqlDBSuitabilityDetails = null, bool? isDatabaseHighlyAvailable = null, SqlAvailabilityGroupDataOverview linkedAvailabilityGroupOverview = null, ResourceIdentifier machineArmId = null, ResourceIdentifier assessedSqlInstanceArmId = null, string machineName = null, string instanceName = null, string databaseName = null, double? databaseSizeInMB = null, CompatibilityLevel? compatibilityLevel = null, ResourceIdentifier sqlDatabaseSdsArmId = null, double? percentageCoresUtilization = null, double? megabytesPerSecondOfRead = null, double? megabytesPerSecondOfWrite = null, double? numberOfReadOperationsPerSecond = null, double? numberOfWriteOperationsPerSecond = null, double? confidenceRatingInPercentage = null, AssessmentSizingCriterion? sizingCriterion = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null) + { + return new AssessedSqlDatabaseV2Data( + id, + name, + resourceType, + systemData, + recommendedAzureSqlTargetType, + recommendedSuitability, + bufferCacheSizeInMB, + productSupportStatus, + azureSqlMISuitabilityDetails, + azureSqlDBSuitabilityDetails, + isDatabaseHighlyAvailable, + linkedAvailabilityGroupOverview, + machineArmId, + assessedSqlInstanceArmId, + machineName, + instanceName, + databaseName, + databaseSizeInMB, + compatibilityLevel, + sqlDatabaseSdsArmId, + percentageCoresUtilization, + megabytesPerSecondOfRead, + megabytesPerSecondOfWrite, + numberOfReadOperationsPerSecond, + numberOfWriteOperationsPerSecond, + confidenceRatingInPercentage, + sizingCriterion, + createdOn, + updatedOn, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the azure SQL PAAS SKU. + /// Gets the replica azure SQL PAAS SKU. + /// Gets the shared resources. + /// Gets the monthly compute cost. + /// Gets the monthly storage cost. + /// Gets the collection of cost components. + /// Gets the suitability for Microsoft cloud defender. + /// Gets a value indicating whether replicas should be provisioned. + /// Gets the replication mode. + /// Gets the list of migration guidelines applicable to this target. + /// Gets the list of SQL recommendation Reasoning. + /// Gets the migration target platform. + /// Gets the azure suitability. + /// Gets the list of migrations issues. + /// A new instance for mocking. + public static SqlAssessmentV2PaasSuitabilityDetails SqlAssessmentV2PaasSuitabilityDetails(AzureSqlPaasSkuDto azureSqlSku = null, IEnumerable replicaAzureSqlSku = null, SharedResourcesDto sharedResources = null, double? monthlyComputeCost = null, double? monthlyStorageCost = null, IEnumerable costComponents = null, MigrationAssessmentCloudSuitability? securitySuitability = null, bool? shouldProvisionReplicas = null, SkuReplicationMode? skuReplicationMode = null, IEnumerable migrationGuidelines = null, IEnumerable recommendationReasonings = null, MigrationAssessmentTargetType? migrationTargetPlatform = null, MigrationAssessmentCloudSuitability? suitability = null, IEnumerable migrationIssues = null) + { + replicaAzureSqlSku ??= new List(); + costComponents ??= new List(); + migrationGuidelines ??= new List(); + recommendationReasonings ??= new List(); + migrationIssues ??= new List(); + + return new SqlAssessmentV2PaasSuitabilityDetails( + azureSqlSku, + replicaAzureSqlSku?.ToList(), + sharedResources, + monthlyComputeCost, + monthlyStorageCost, + costComponents?.ToList(), + securitySuitability, + shouldProvisionReplicas, + skuReplicationMode, + migrationGuidelines?.ToList(), + recommendationReasonings?.ToList(), + migrationTargetPlatform, + suitability, + migrationIssues?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the service tier. + /// Gets the compute tier. + /// Gets the hardware generation. + /// Gets the storage maximum size in megabytes. + /// + /// Gets the predicted data size in megabytes in the Azure SQL, will impact the + /// billing cost. + /// + /// + /// Gets the predicted log size in megabytes in the Azure SQL, will impact the + /// billing cost. + /// + /// Gets the number of cores. + /// Gets the target type. + /// A new instance for mocking. + public static AzureSqlPaasSkuDto AzureSqlPaasSkuDto(AzureSqlServiceTier? azureSqlServiceTier = null, MigrationAssessmentComputeTier? azureSqlComputeTier = null, MigrationAssessmentHardwareGeneration? azureSqlHardwareGeneration = null, double? storageMaxSizeInMB = null, double? predictedDataSizeInMB = null, double? predictedLogSizeInMB = null, int? cores = null, MigrationAssessmentTargetType? azureSqlTargetType = null) + { + return new AzureSqlPaasSkuDto( + azureSqlServiceTier, + azureSqlComputeTier, + azureSqlHardwareGeneration, + storageMaxSizeInMB, + predictedDataSizeInMB, + predictedLogSizeInMB, + cores, + azureSqlTargetType, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the list of shared data disks. + /// Gets the list of shared log disks. + /// Gets the list of shared Temporary database disks. + /// Gets number of mounts of shared disks. + /// Gets quorum witness. + /// A new instance for mocking. + public static SharedResourcesDto SharedResourcesDto(IEnumerable sharedDataDisks = null, IEnumerable sharedLogDisks = null, IEnumerable sharedTempDBDisks = null, int? numberOfMounts = null, AzureQuorumWitnessDtoQuorumWitnessType? quorumWitnessType = null) + { + sharedDataDisks ??= new List(); + sharedLogDisks ??= new List(); + sharedTempDBDisks ??= new List(); + + return new SharedResourcesDto( + sharedDataDisks?.ToList(), + sharedLogDisks?.ToList(), + sharedTempDBDisks?.ToList(), + numberOfMounts, + quorumWitnessType != null ? new AzureQuorumWitnessDto(quorumWitnessType, serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the Type ("tier") of disk - e.g. standard, premium, ultra. + /// Gets the Size of the managed disk - e.g. P30, P40. + /// Gets disk redundancy - e.g. LRS, ZRS. + /// Gets the managed disk storage cost. + /// Gets the recommended in GB of the managed disk. + /// Gets the recommended throughput in MBPS of the managed disk. + /// Gets the recommended IOPS of the managed disk. + /// A new instance for mocking. + public static AzureManagedDiskSkuDto AzureManagedDiskSkuDto(AzureManagedDiskSkuDtoDiskType? diskType = null, AzureDiskSize? diskSize = null, AzureManagedDiskSkuDtoDiskRedundancy? diskRedundancy = null, double? storageCost = null, double? recommendedSizeInGib = null, double? recommendedThroughputInMbps = null, double? recommendedIops = null) + { + return new AzureManagedDiskSkuDto( + diskType, + diskSize, + diskRedundancy, + storageCost, + recommendedSizeInGib, + recommendedThroughputInMbps, + recommendedIops, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the guideline id. + /// Gets the migration guideline category. + /// Gets the migration guideline context. + /// A new instance for mocking. + public static SqlMigrationGuideline SqlMigrationGuideline(string guidelineId = null, SqlMigrationGuidelineCategory? migrationGuidelineCategory = null, IEnumerable migrationGuidelineContext = null) + { + migrationGuidelineContext ??= new List(); + + return new SqlMigrationGuideline(guidelineId, migrationGuidelineCategory, migrationGuidelineContext?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the reasoning context key. + /// Gets the reasoning context value. + /// A new instance for mocking. + public static MigrationGuidelineContext MigrationGuidelineContext(string contextKey = null, string contextValue = null) + { + return new MigrationGuidelineContext(contextKey, contextValue, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the reasoning id. + /// Gets the reasoning status. + /// Gets the reasoning category. + /// Gets the Sql recommended reasoning parameters. + /// A new instance for mocking. + public static SqlRecommendationReasoning SqlRecommendationReasoning(string reasoningId = null, string reasoningString = null, string reasoningCategory = null, IEnumerable contextParameters = null) + { + contextParameters ??= new List(); + + return new SqlRecommendationReasoning(reasoningId, reasoningString, reasoningCategory, contextParameters?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the reasoning context key. + /// Gets the reasoning context value. + /// A new instance for mocking. + public static SqlRecommendationReasoningContext SqlRecommendationReasoningContext(string contextKey = null, string contextValue = null) + { + return new SqlRecommendationReasoningContext(contextKey, contextValue, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the issue id. + /// Gets the issue category. + /// Gets the list of impacted objects. + /// A new instance for mocking. + public static SqlAssessmentMigrationIssue SqlAssessmentMigrationIssue(string issueId = null, SqlAssessmentMigrationIssueCategory? issueCategory = null, IEnumerable impactedObjects = null) + { + impactedObjects ??= new List(); + + return new SqlAssessmentMigrationIssue(issueId, issueCategory, impactedObjects?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the object name. + /// Gets the object type. + /// A new instance for mocking. + public static ImpactedAssessmentObject ImpactedAssessmentObject(string objectName = null, string objectType = null) + { + return new ImpactedAssessmentObject(objectName, objectType, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the availability group id. + /// Gets the availability group name. + /// Gets the availability group arm id. + /// Gets the availability group entity id. + /// Gets the availability replica id. + /// A new instance for mocking. + public static SqlAvailabilityGroupDataOverview SqlAvailabilityGroupDataOverview(string availabilityGroupId = null, string availabilityGroupName = null, ResourceIdentifier sqlAvailabilityGroupSdsArmId = null, string sqlAvailabilityGroupEntityId = null, string sqlAvailabilityReplicaId = null) + { + return new SqlAvailabilityGroupDataOverview( + availabilityGroupId, + availabilityGroupName, + sqlAvailabilityGroupSdsArmId, + sqlAvailabilityGroupEntityId, + sqlAvailabilityReplicaId, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets or sets the memory used by SQL instance in megabytes. + /// Gets or sets a value indicating whether SQL instance has been deep discovered. + /// Gets or sets the recommended azure SQL target type. + /// Gets or sets the recommended azure SQL suitability. + /// SQL instance azure SQL MI suitability details. + /// SQL instance azure SQL DB suitability details. + /// SQL instance azure SQL VM suitability details. + /// Gets the storage details. + /// Gets the product support status related details. + /// Gets the FCI metadata if this instance represents an FCI instance. + /// + /// Gets the overview counts of availability replicas in the assessed instance, by + /// commit mode and read type. + /// + /// Gets a value indicating whether the SQL instance is clustered or not. + /// Gets a value indicating whether the high availability is enabled or not. + /// Gets the list of recommended target reasoning. + /// Machine arm id. + /// Machine display name. + /// SQL instance name. + /// SQL instance SDS arm id. + /// SQL instance edition. + /// SQL instance version. + /// Number of CPU cores assigned to the SQL instance. + /// The percentage of the total number of cores being utilized by the SQL instance. + /// The logical disk details. + /// The databases summary. + /// Confidence Rating in Percentage. + /// Assessment sizing criterion. + /// When was assessed SQL instance first created. + /// When was assessed SQL instance last updated. + /// A new instance for mocking. + public static AssessedSqlInstanceV2Data AssessedSqlInstanceV2Data(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, double? memoryInUseInMB = null, bool? hasScanOccurred = null, MigrationAssessmentTargetType? recommendedAzureSqlTargetType = null, RecommendedSuitability? recommendedSuitability = null, SqlAssessmentV2PaasSuitabilityDetails azureSqlMISuitabilityDetails = null, SqlAssessmentV2PaasSuitabilityDetails azureSqlDBSuitabilityDetails = null, SqlAssessmentV2IaasSuitabilityDetails azureSqlVmSuitabilityDetails = null, IEnumerable storageTypeBasedDetails = null, ProductSupportStatus productSupportStatus = null, SqlFciMetadata fciMetadata = null, SqlAvailabilityReplicaSummary availabilityReplicaSummary = null, bool? isClustered = null, bool? isHighAvailabilityEnabled = null, IEnumerable recommendedTargetReasonings = null, ResourceIdentifier machineArmId = null, string machineName = null, string instanceName = null, ResourceIdentifier sqlInstanceSdsArmId = null, string sqlEdition = null, string sqlVersion = null, int? numberOfCoresAllocated = null, double? percentageCoresUtilization = null, IEnumerable logicalDisks = null, AssessedSqlInstanceDatabaseSummary databaseSummary = null, double? confidenceRatingInPercentage = null, AssessmentSizingCriterion? sizingCriterion = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null) + { + storageTypeBasedDetails ??= new List(); + recommendedTargetReasonings ??= new List(); + logicalDisks ??= new List(); + + return new AssessedSqlInstanceV2Data( + id, + name, + resourceType, + systemData, + memoryInUseInMB, + hasScanOccurred, + recommendedAzureSqlTargetType, + recommendedSuitability, + azureSqlMISuitabilityDetails, + azureSqlDBSuitabilityDetails, + azureSqlVmSuitabilityDetails, + storageTypeBasedDetails?.ToList(), + productSupportStatus, + fciMetadata, + availabilityReplicaSummary, + isClustered, + isHighAvailabilityEnabled, + recommendedTargetReasonings?.ToList(), + machineArmId, + machineName, + instanceName, + sqlInstanceSdsArmId, + sqlEdition, + sqlVersion, + numberOfCoresAllocated, + percentageCoresUtilization, + logicalDisks?.ToList(), + databaseSummary, + confidenceRatingInPercentage, + sizingCriterion, + createdOn, + updatedOn, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the azure SQL IAAS SKU. + /// Gets the replica azure SQL IAAS SKU. + /// Gets the shared resources. + /// Gets the monthly compute cost. + /// Gets the monthly storage cost. + /// Gets the collection of cost components. + /// Gets the suitability for Microsoft cloud defender. + /// Gets a value indicating whether replicas should be provisioned. + /// Gets the replication mode. + /// Gets the list of migration guidelines applicable to this target. + /// Gets the list of SQL recommendation Reasoning. + /// Gets the migration target platform. + /// Gets the azure suitability. + /// Gets the list of migrations issues. + /// A new instance for mocking. + public static SqlAssessmentV2IaasSuitabilityDetails SqlAssessmentV2IaasSuitabilityDetails(AzureSqlIaasSkuDto azureSqlSku = null, IEnumerable replicaAzureSqlSku = null, SharedResourcesDto sharedResources = null, double? monthlyComputeCost = null, double? monthlyStorageCost = null, IEnumerable costComponents = null, MigrationAssessmentCloudSuitability? securitySuitability = null, bool? shouldProvisionReplicas = null, SkuReplicationMode? skuReplicationMode = null, IEnumerable migrationGuidelines = null, IEnumerable recommendationReasonings = null, MigrationAssessmentTargetType? migrationTargetPlatform = null, MigrationAssessmentCloudSuitability? suitability = null, IEnumerable migrationIssues = null) + { + replicaAzureSqlSku ??= new List(); + costComponents ??= new List(); + migrationGuidelines ??= new List(); + recommendationReasonings ??= new List(); + migrationIssues ??= new List(); + + return new SqlAssessmentV2IaasSuitabilityDetails( + azureSqlSku, + replicaAzureSqlSku?.ToList(), + sharedResources, + monthlyComputeCost, + monthlyStorageCost, + costComponents?.ToList(), + securitySuitability, + shouldProvisionReplicas, + skuReplicationMode, + migrationGuidelines?.ToList(), + recommendationReasonings?.ToList(), + migrationTargetPlatform, + suitability, + migrationIssues?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the The Azure Compute Virtual Machine. + /// Gets the The list of data disk sizes. + /// Gets the The list of log disk sizes. + /// Gets the target type. + /// A new instance for mocking. + public static AzureSqlIaasSkuDto AzureSqlIaasSkuDto(AzureVmSkuDto virtualMachineSize = null, IEnumerable dataDiskSizes = null, IEnumerable logDiskSizes = null, MigrationAssessmentTargetType? azureSqlTargetType = null) + { + dataDiskSizes ??= new List(); + logDiskSizes ??= new List(); + + return new AzureSqlIaasSkuDto(virtualMachineSize, dataDiskSizes?.ToList(), logDiskSizes?.ToList(), azureSqlTargetType, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the Virtual Machine Family, for example : standardMSFamily. + /// Gets the Compute Size in vCores. + /// Gets the Virtual Machine SKU name,: E.g. : Standard_F16s. + /// + /// Gets the Available vCores. This can be less than the vCores in the Constrained + /// vCPU VM Sizes. + /// + /// Gets the Max network interfaces. + /// A new instance for mocking. + public static AzureVmSkuDto AzureVmSkuDto(AzureVmFamily? azureVmFamily = null, int? cores = null, AzureVmSize? azureSkuName = null, int? availableCores = null, int? maxNetworkInterfaces = null) + { + return new AzureVmSkuDto( + azureVmFamily, + cores, + azureSkuName, + availableCores, + maxNetworkInterfaces, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the storage type. + /// Gets the disk size in mb. + /// Gets the megabytes per second of read. + /// Gets the megabytes per second of read. + /// Gets the number of read operations per second. + /// Gets the number of write operations per second. + /// A new instance for mocking. + public static AssessedSqlInstanceStorageDetails AssessedSqlInstanceStorageDetails(string storageType = null, double? diskSizeInMB = null, double? megabytesPerSecondOfRead = null, double? megabytesPerSecondOfWrite = null, double? numberOfReadOperationsPerSecond = null, double? numberOfWriteOperationsPerSecond = null) + { + return new AssessedSqlInstanceStorageDetails( + storageType, + diskSizeInMB, + megabytesPerSecondOfRead, + megabytesPerSecondOfWrite, + numberOfReadOperationsPerSecond, + numberOfWriteOperationsPerSecond, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the Sql fci meta data state. + /// Gets whether fci is multi subnet. + /// Gets the fci shared disk count. + /// A new instance for mocking. + public static SqlFciMetadata SqlFciMetadata(SqlFciMetadataState? state = null, bool? isMultiSubnet = null, int? fciSharedDiskCount = null) + { + return new SqlFciMetadata(state, isMultiSubnet, fciSharedDiskCount, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the number Of synchronous read replicas. + /// Gets the number Of synchronous non read replicas. + /// Gets the number Of asynchronous read replicas. + /// Gets the number Of asynchronous non read replicas. + /// Gets the number Of primary replicas. + /// A new instance for mocking. + public static SqlAvailabilityReplicaSummary SqlAvailabilityReplicaSummary(int? numberOfSynchronousReadReplicas = null, int? numberOfSynchronousNonReadReplicas = null, int? numberOfAsynchronousReadReplicas = null, int? numberOfAsynchronousNonReadReplicas = null, int? numberOfPrimaryReplicas = null) + { + return new SqlAvailabilityReplicaSummary( + numberOfSynchronousReadReplicas, + numberOfSynchronousNonReadReplicas, + numberOfAsynchronousReadReplicas, + numberOfAsynchronousNonReadReplicas, + numberOfPrimaryReplicas, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the disk id. + /// Gets the disk size in mb. + /// Gets the megabytes per second of read. + /// Gets the megabytes per second of write. + /// Gets the number of read operations per second. + /// Gets the number of write operations per second. + /// A new instance for mocking. + public static AssessedSqlInstanceDiskDetails AssessedSqlInstanceDiskDetails(string diskId = null, double? diskSizeInMB = null, double? megabytesPerSecondOfRead = null, double? megabytesPerSecondOfWrite = null, double? numberOfReadOperationsPerSecond = null, double? numberOfWriteOperationsPerSecond = null) + { + return new AssessedSqlInstanceDiskDetails( + diskId, + diskSizeInMB, + megabytesPerSecondOfRead, + megabytesPerSecondOfWrite, + numberOfReadOperationsPerSecond, + numberOfWriteOperationsPerSecond, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the number of user databases. + /// Gets the total database size in MB. + /// Gets the largest database size in MB. + /// Gets the total discovered user databases. + /// A new instance for mocking. + public static AssessedSqlInstanceDatabaseSummary AssessedSqlInstanceDatabaseSummary(int? numberOfUserDatabases = null, double? totalDatabaseSizeInMB = null, double? largestDatabaseSizeInMB = null, int? totalDiscoveredUserDatabases = null) + { + return new AssessedSqlInstanceDatabaseSummary(numberOfUserDatabases, totalDatabaseSizeInMB, largestDatabaseSizeInMB, totalDiscoveredUserDatabases, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets or sets the BIOS GUID for the machine. + /// Gets or sets the FQDN for the machine. + /// Gets the list of SQL instances discovered on the machine. + /// + /// Gets or sets the detailed messages that were set on the machine during + /// evaluation. + /// + /// Gets or sets the explanation if machine is not suitable for cloud. + /// Gets or sets the Recommended Azure Size for the machine. + /// Gets or sets the Recommended Azure VM Family for the machine. + /// Gets the product support status related details. + /// Gets or sets the Number of cores for recommended size. + /// Gets or sets the Megabytes of memory for recommended size. + /// Gets or sets the monthly compute cost calculated for recommended size. + /// Gets the list of data disks that were assessed as part of this assessment. + /// Gets the list of network adapters that were assessed as part of this assessment. + /// Gets or sets the monthly networking cost. + /// Gets or sets the monthly total storage cost. + /// Gets the collection of cost components. + /// Gets the suitability for Microsoft cloud defender. + /// Gets the list of migration guidelines applicable. + /// Boot type of machine discovered in private data center. + /// Operating system as reported by datacenter management solution. + /// Operating system as reported by datacenter management solution. + /// Operating system version as reported by datacenter management solution. + /// Operating system architecture as reported by datacenter management solution. + /// When was machine first created. + /// When was machine last updated. + /// Display Name of the Machine. + /// Assessed machine type. + /// Description for the machine. + /// Data center machine ARM id. + /// Data center management server ARM id. + /// Data center management server name. + /// Megabytes of memory found allocated for the machine in private data center. + /// Number of CPU cores found on the machine. + /// Confidence Rating in Percentage. + /// + /// Percentile of Percentage of Cores Utilized noted during time period T. + /// + /// Here N and T are settings on Assessment. + /// + /// + /// Percentile of Percentage of Memory Utilized noted during time period T. + /// + /// Here N and T are settings on Assessment. + /// + /// + /// Gets a value indicating whether machine is suitable for the cloud platform + /// selected. + /// + /// Assessment sizing criterion. + /// A new instance for mocking. + public static AssessedSqlMachineData AssessedSqlMachineData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string biosGuid = null, string fqdn = null, IEnumerable sqlInstances = null, AzureVmSuitabilityDetail? suitabilityDetail = null, AzureVmSuitabilityExplanation? suitabilityExplanation = null, AzureVmSize? recommendedVmSize = null, AzureVmFamily? recommendedVmFamily = null, ProductSupportStatus productSupportStatus = null, int? recommendedVmSizeNumberOfCores = null, double? recommendedVmSizeMegabytesOfMemory = null, double? monthlyComputeCost = null, IReadOnlyDictionary disks = null, IReadOnlyDictionary networkAdapters = null, double? monthlyBandwidthCost = null, double? monthlyStorageCost = null, IEnumerable costComponents = null, MigrationAssessmentCloudSuitability? securitySuitability = null, IEnumerable migrationGuidelines = null, MachineBootType? bootType = null, string operatingSystemType = null, string operatingSystemName = null, string operatingSystemVersion = null, GuestOperatingSystemArchitecture? operatingSystemArchitecture = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null, string displayName = null, AssessedMachineType? typePropertiesType = null, string description = null, ResourceIdentifier datacenterMachineArmId = null, ResourceIdentifier datacenterManagementServerArmId = null, string datacenterManagementServerName = null, double? megabytesOfMemory = null, int? numberOfCores = null, double? confidenceRatingInPercentage = null, double? percentageCoresUtilization = null, double? percentageMemoryUtilization = null, MigrationAssessmentCloudSuitability? suitability = null, AssessmentSizingCriterion? sizingCriterion = null) + { + sqlInstances ??= new List(); + disks ??= new Dictionary(); + networkAdapters ??= new Dictionary(); + costComponents ??= new List(); + migrationGuidelines ??= new List(); + + return new AssessedSqlMachineData( + id, + name, + resourceType, + systemData, + biosGuid, + fqdn, + sqlInstances?.ToList(), + suitabilityDetail, + suitabilityExplanation, + recommendedVmSize, + recommendedVmFamily, + productSupportStatus, + recommendedVmSizeNumberOfCores, + recommendedVmSizeMegabytesOfMemory, + monthlyComputeCost, + disks, + networkAdapters, + monthlyBandwidthCost, + monthlyStorageCost, + costComponents?.ToList(), + securitySuitability, + migrationGuidelines?.ToList(), + bootType, + operatingSystemType, + operatingSystemName, + operatingSystemVersion, + operatingSystemArchitecture, + createdOn, + updatedOn, + displayName, + typePropertiesType, + description, + datacenterMachineArmId, + datacenterManagementServerArmId, + datacenterManagementServerName, + megabytesOfMemory, + numberOfCores, + confidenceRatingInPercentage, + percentageCoresUtilization, + percentageMemoryUtilization, + suitability, + sizingCriterion, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the instance id. + /// Gets the instance name. + /// Gets the instance arm id. + /// Gets the instance entity id. + /// Gets the Sql edition. + /// Gets the Sql version. + /// Gets whether Sql is clustered. + /// Gets whether Sql is highly available. + /// Gets the Sql Fci state. + /// A new instance for mocking. + public static AssessedSqlInstanceSummary AssessedSqlInstanceSummary(string instanceId = null, string instanceName = null, ResourceIdentifier sqlInstanceSdsArmId = null, string sqlInstanceEntityId = null, string sqlEdition = null, string sqlVersion = null, bool? isClustered = null, bool? isHighAvailabilityEnabled = null, SqlFciState? sqlFciState = null) + { + return new AssessedSqlInstanceSummary( + instanceId, + instanceName, + sqlInstanceSdsArmId, + sqlInstanceEntityId, + sqlEdition, + sqlVersion, + isClustered, + isHighAvailabilityEnabled, + sqlFciState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the suitability. + /// Gets the suitability explanation. + /// Gets the suitability detail. + /// Gets the recommended disk size. + /// Gets the recommended disk type. + /// Gets the recommended disk size. + /// Gets the recommended disk throughput. + /// Gets the recommended disk iops. + /// Gets the monthly storage cost. + /// Gets the name. + /// Gets the machine display name. + /// Gets the gigabytes provisioned. + /// Gets the megabytes per second of read. + /// Gets the megabytes per second of write. + /// Gets the number of read operations per second. + /// Gets the number of write operations per second. + /// A new instance for mocking. + public static AssessedDataDisk AssessedDataDisk(MigrationAssessmentCloudSuitability? suitability = null, AzureDiskSuitabilityExplanation? suitabilityExplanation = null, AzureDiskSuitabilityDetail? suitabilityDetail = null, AzureDiskSize? recommendedDiskSize = null, AzureDiskType? recommendedDiskType = null, int? recommendedDiskSizeGigabytes = null, double? recommendDiskThroughputInMbps = null, double? recommendedDiskIops = null, double? monthlyStorageCost = null, string name = null, string displayName = null, double? gigabytesProvisioned = null, double? megabytesPerSecondOfRead = null, double? megabytesPerSecondOfWrite = null, double? numberOfReadOperationsPerSecond = null, double? numberOfWriteOperationsPerSecond = null) + { + return new AssessedDataDisk( + suitability, + suitabilityExplanation, + suitabilityDetail, + recommendedDiskSize, + recommendedDiskType, + recommendedDiskSizeGigabytes, + recommendDiskThroughputInMbps, + recommendedDiskIops, + monthlyStorageCost, + name, + displayName, + gigabytesProvisioned, + megabytesPerSecondOfRead, + megabytesPerSecondOfWrite, + numberOfReadOperationsPerSecond, + numberOfWriteOperationsPerSecond, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the suitability. + /// Gets the suitability detail. + /// Gets the suitability explanation. + /// Gets the monthly bandwidth costs. + /// Gets the net gigabytes transmitted per month. + /// Gets the name. + /// Gets the display name. + /// Gets the mac address. + /// Gets the ip addresses. + /// Gets the megabytes per second received. + /// Gets the megabytes per second transmitted. + /// A new instance for mocking. + public static SqlAssessedNetworkAdapter SqlAssessedNetworkAdapter(MigrationAssessmentCloudSuitability? suitability = null, AzureNetworkAdapterSuitabilityDetail? suitabilityDetail = null, AzureNetworkAdapterSuitabilityExplanation? suitabilityExplanation = null, double? monthlyBandwidthCosts = null, double? netGigabytesTransmittedPerMonth = null, string name = null, string displayName = null, string macAddress = null, IEnumerable ipAddresses = null, double? megabytesPerSecondReceived = null, double? megabytesPerSecondTransmitted = null) + { + ipAddresses ??= new List(); + + return new SqlAssessedNetworkAdapter( + suitability, + suitabilityDetail, + suitabilityExplanation, + monthlyBandwidthCosts, + netGigabytesTransmittedPerMonth, + name, + displayName, + macAddress, + ipAddresses?.ToList(), + megabytesPerSecondReceived, + megabytesPerSecondTransmitted, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets or sets machine name. + /// Gets or sets SQL instance name. + /// Gets the product support status related details. + /// Gets or sets assessed database count. + /// Gets or sets the total discovered database count. + /// + /// Gets or sets a value indicating whether instance deep discovery has occurred or + /// not. + /// + /// Gets or sets the recommended azure SQL target type. + /// Gets or sets the recommended azure SQL suitability. + /// SQL instance azure SQL MI suitability details. + /// SQL instance azure SQL DB suitability details. + /// SQL instance azure SQL VM suitability details. + /// Gets or sets Arm id of assessed entity. + /// Gets or sets a value indicating whether the SQL instance is clustered or not. + /// Gets or sets a value indicating whether the high availability is enabled or not. + /// Gets the SQL edition from the recommended entity if applicable. + /// Gets the SQL version from the recommended entity if applicable. + /// Assessment sizing criterion. + /// A new instance for mocking. + public static AssessedSqlRecommendedEntityData AssessedSqlRecommendedEntityData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string machineName = null, string instanceName = null, ProductSupportStatus productSupportStatus = null, int? dbCount = null, int? discoveredDBCount = null, bool? hasScanOccurred = null, MigrationAssessmentTargetType? recommendedAzureSqlTargetType = null, RecommendedSuitability? recommendedSuitability = null, SqlAssessmentV2PaasSuitabilityDetails azureSqlMISuitabilityDetails = null, SqlAssessmentV2PaasSuitabilityDetails azureSqlDBSuitabilityDetails = null, SqlAssessmentV2IaasSuitabilityDetails azureSqlVmSuitabilityDetails = null, ResourceIdentifier assessedSqlEntityArmId = null, bool? isClustered = null, bool? isHighAvailabilityEnabled = null, string sqlEdition = null, string sqlVersion = null, AssessmentSizingCriterion? sizingCriterion = null) + { + return new AssessedSqlRecommendedEntityData( + id, + name, + resourceType, + systemData, + machineName, + instanceName, + productSupportStatus, + dbCount, + discoveredDBCount, + hasScanOccurred, + recommendedAzureSqlTargetType, + recommendedSuitability, + azureSqlMISuitabilityDetails, + azureSqlDBSuitabilityDetails, + azureSqlVmSuitabilityDetails, + assessedSqlEntityArmId, + isClustered, + isHighAvailabilityEnabled, + sqlEdition, + sqlVersion, + sizingCriterion, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets or sets the Assessment summary. + /// Gets the distribution of sqlInstances by support status. + /// Gets the distribution distribution of sqlInstances by service pack insight. + /// Gets the distribution of sqlInstances by sql version. + /// Gets the distribution of sqlInstances by sql edition. + /// Gets the instance distribution by sizing criterion. + /// Gets the database distribution by sizing criterion. + /// Number of machines part of the assessment. + /// Number of sql instances part of the assessment. + /// Number of successfully discovered sql instances part of the assessment. + /// Number of sql databases part of the assessment. + /// Number of sql failover cluster instances part of the assessment. + /// Number of sql availability groups part of the assessment. + /// A new instance for mocking. + public static MigrationAssessmentSqlAssessmentV2SummaryData MigrationAssessmentSqlAssessmentV2SummaryData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IReadOnlyDictionary assessmentSummary = null, IReadOnlyDictionary distributionBySupportStatus = null, IReadOnlyDictionary distributionByServicePackInsight = null, IReadOnlyDictionary distributionBySqlVersion = null, IReadOnlyDictionary distributionBySqlEdition = null, IReadOnlyDictionary instanceDistributionBySizingCriterion = null, IReadOnlyDictionary databaseDistributionBySizingCriterion = null, int? numberOfMachines = null, int? numberOfSqlInstances = null, int? numberOfSuccessfullyDiscoveredSqlInstances = null, int? numberOfSqlDatabases = null, int? numberOfFciInstances = null, int? numberOfSqlAvailabilityGroups = null) + { + assessmentSummary ??= new Dictionary(); + distributionBySupportStatus ??= new Dictionary(); + distributionByServicePackInsight ??= new Dictionary(); + distributionBySqlVersion ??= new Dictionary(); + distributionBySqlEdition ??= new Dictionary(); + instanceDistributionBySizingCriterion ??= new Dictionary(); + databaseDistributionBySizingCriterion ??= new Dictionary(); + + return new MigrationAssessmentSqlAssessmentV2SummaryData( + id, + name, + resourceType, + systemData, + assessmentSummary, + distributionBySupportStatus, + distributionByServicePackInsight, + distributionBySqlVersion, + distributionBySqlEdition, + instanceDistributionBySizingCriterion, + databaseDistributionBySizingCriterion, + numberOfMachines, + numberOfSqlInstances, + numberOfSuccessfullyDiscoveredSqlInstances, + numberOfSqlDatabases, + numberOfFciInstances, + numberOfSqlAvailabilityGroups, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Sql assessment summary data. + /// Monthly compute cost. + /// Monthly storage cost. + /// Monthly license cost. + /// Confidence Rating. + /// Monthly security cost. + /// A new instance for mocking. + public static SqlAssessmentV2SummaryDetails SqlAssessmentV2SummaryDetails(IReadOnlyDictionary suitabilitySummary = null, double? monthlyComputeCost = null, double? monthlyStorageCost = null, double? monthlyLicenseCost = null, double? confidenceScore = null, double? monthlySecurityCost = null) + { + suitabilitySummary ??= new Dictionary(); + + return new SqlAssessmentV2SummaryDetails( + suitabilitySummary, + monthlyComputeCost, + monthlyStorageCost, + monthlyLicenseCost, + confidenceScore, + monthlySecurityCost, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The status of the last operation. + /// Gets or sets the collector agent properties. + /// Gets the discovery site id. + /// Gets the Timestamp when collector was created. + /// Timestamp when collector was last updated. + /// A new instance for mocking. + public static MigrationAssessmentHyperVCollectorData MigrationAssessmentHyperVCollectorData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MigrationAssessmentProvisioningState? provisioningState = null, CollectorAgentPropertiesBase agentProperties = null, string discoverySiteId = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null) + { + return new MigrationAssessmentHyperVCollectorData( + id, + name, + resourceType, + systemData, + provisioningState, + agentProperties, + discoverySiteId, + createdOn, + updatedOn, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The status of the last operation. + /// Gets the discovery site id. + /// Gets the Timestamp when collector was created. + /// Timestamp when collector was last updated. + /// A new instance for mocking. + public static MigrationAssessmentImportCollectorData MigrationAssessmentImportCollectorData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MigrationAssessmentProvisioningState? provisioningState = null, string discoverySiteId = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null) + { + return new MigrationAssessmentImportCollectorData( + id, + name, + resourceType, + systemData, + provisioningState, + discoverySiteId, + createdOn, + updatedOn, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets or sets workload summary. + /// List of errors for this machine. + /// Gets Processor details of the host. + /// Gets the product support status related details. + /// Site id of machine discovered in private data center. + /// The data center management server ARM Id for the machine. + /// The data center management server name for the machine. + /// Boot type of machine discovered in private data center. + /// Display Name of the Machine. + /// Megabytes of memory found allocated for the machine in private data center. + /// Number of CPU cores found on the machine. + /// Operating system as reported by datacenter management solution. + /// Operating system as reported by datacenter management solution. + /// Operating system version as reported by datacenter management solution. + /// Description for the machine. + /// When was machine first created. + /// Disks attached to the machine discovered in private data center. + /// Gets the References to the groups that this machine is member of. + /// Network adapters attached to the machine discovered in private data center. + /// SQL instances discovered on the machine. + /// Web applications discovered on the machine. + /// When was machine last updated. + /// A new instance for mocking. + public static MigrationAssessmentMachineData MigrationAssessmentMachineData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, WorkloadSummary workloadSummary = null, IEnumerable errors = null, ProcessorInfo hostProcessor = null, ProductSupportStatus productSupportStatus = null, ResourceIdentifier discoveryMachineArmId = null, ResourceIdentifier datacenterManagementServerArmId = null, string datacenterManagementServerName = null, MachineBootType? bootType = null, string displayName = null, double? megabytesOfMemory = null, int? numberOfCores = null, string operatingSystemType = null, string operatingSystemName = null, string operatingSystemVersion = null, string description = null, DateTimeOffset? createdOn = null, IReadOnlyDictionary disks = null, IEnumerable groups = null, IReadOnlyDictionary networkAdapters = null, IEnumerable sqlInstances = null, IEnumerable webApplications = null, DateTimeOffset? updatedOn = null) + { + errors ??= new List(); + disks ??= new Dictionary(); + groups ??= new List(); + networkAdapters ??= new Dictionary(); + sqlInstances ??= new List(); + webApplications ??= new List(); + + return new MigrationAssessmentMachineData( + id, + name, + resourceType, + systemData, + workloadSummary, + errors?.ToList(), + hostProcessor, + productSupportStatus, + discoveryMachineArmId, + datacenterManagementServerArmId, + datacenterManagementServerName, + bootType, + displayName, + megabytesOfMemory, + numberOfCores, + operatingSystemType, + operatingSystemName, + operatingSystemVersion, + description, + createdOn, + disks, + groups?.ToList(), + networkAdapters, + sqlInstances?.ToList(), + webApplications?.ToList(), + updatedOn, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets oracle databases. + /// Gets or sets oracle databases. + /// A new instance for mocking. + public static WorkloadSummary WorkloadSummary(int? oracleInstances = null, int? springApps = null) + { + return new WorkloadSummary(oracleInstances, springApps, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gigabytes of storage provisioned for this disk. + /// User friendly name of the disk. + /// A new instance for mocking. + public static MigrationAssessmentDisk MigrationAssessmentDisk(double? gigabytesAllocated = null, string displayName = null) + { + return new MigrationAssessmentDisk(gigabytesAllocated, displayName, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// MAC Address of the network adapter. + /// List of IP Addresses on the network adapter. + /// User friendly name of the network adapter. + /// A new instance for mocking. + public static MigrationAssessmentNetworkAdapter MigrationAssessmentNetworkAdapter(string macAddress = null, IEnumerable ipAddresses = null, string displayName = null) + { + ipAddresses ??= new List(); + + return new MigrationAssessmentNetworkAdapter(macAddress, ipAddresses?.ToList(), displayName, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The private link resource group id. + /// The private link resource required member names. + /// The private link resource private link DNS zone name. + /// A new instance for mocking. + public static MigrationAssessmentPrivateLinkResourceData MigrationAssessmentPrivateLinkResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string groupId = null, IEnumerable requiredMembers = null, IEnumerable requiredZoneNames = null) + { + requiredMembers ??= new List(); + requiredZoneNames ??= new List(); + + return new MigrationAssessmentPrivateLinkResourceData( + id, + name, + resourceType, + systemData, + groupId, + requiredMembers?.ToList(), + requiredZoneNames?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// Gets the Error summary by feature. Contains number of affected Entities per + /// feature. + /// + /// Gets the number of private endpoint connections. + /// Gets the number of groups created in this project. + /// Gets the number of machines part of this project. + /// Gets the number of import machines part of this project. + /// Gets the number of assessments created in this project. + /// Gets the last assessment timestamp. + /// A new instance for mocking. + public static MigrationAssessmentAssessmentProjectSummaryData MigrationAssessmentAssessmentProjectSummaryData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable errorSummaryAffectedEntities = null, int? numberOfPrivateEndpointConnections = null, int? numberOfGroups = null, int? numberOfMachines = null, int? numberOfImportMachines = null, int? numberOfAssessments = null, DateTimeOffset? lastAssessedOn = null) + { + errorSummaryAffectedEntities ??= new List(); + + return new MigrationAssessmentAssessmentProjectSummaryData( + id, + name, + resourceType, + systemData, + errorSummaryAffectedEntities?.ToList(), + numberOfPrivateEndpointConnections, + numberOfGroups, + numberOfMachines, + numberOfImportMachines, + numberOfAssessments, + lastAssessedOn, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the assessment type. + /// Gets the affected entity count. + /// A new instance for mocking. + public static AssessmentErrorSummary AssessmentErrorSummary(AssessmentType? assessmentType = null, int? count = null) + { + return new AssessmentErrorSummary(assessmentType, count, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The status of the last operation. + /// Gets or sets the collector agent properties. + /// Gets the discovery site id. + /// Gets the Timestamp when collector was created. + /// Timestamp when collector was last updated. + /// A new instance for mocking. + public static MigrationAssessmentServerCollectorData MigrationAssessmentServerCollectorData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MigrationAssessmentProvisioningState? provisioningState = null, CollectorAgentPropertiesBase agentProperties = null, string discoverySiteId = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null) + { + return new MigrationAssessmentServerCollectorData( + id, + name, + resourceType, + systemData, + provisioningState, + agentProperties, + discoverySiteId, + createdOn, + updatedOn, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets the list of VM families. + /// Gets the Reserved Instance VM Families list. + /// Gets the Premium disk VM Families list. + /// Gets or sets the Premium disk VM Families list. + /// Gets or sets the list of Azure locations supporting Saving Plans for IAAS. + /// Gets or sets the list of Azure locations supporting Saving Plans for PAAS. + /// Gets or sets the list of Azure locations supporting Reserved Instances for IAAS. + /// Gets or sets the list of Azure Offers supporting Saving Plans. + /// Gets or sets the list of SQL target SKU properties for dropdowns. + /// Gets or sets the Reserved Instance SQL target types. + /// Gets or sets the list of Azure locations supporting Reserved Instances. + /// Gets or sets the list of currencies supported for Reserved Instances. + /// Gets or sets the list of offers supported for Reserved Instances. + /// Gets or sets the list of offers supported for SQL assessments. + /// A new instance for mocking. + public static MigrationAssessmentSqlAssessmentOptionData MigrationAssessmentSqlAssessmentOptionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable vmFamilies = null, IEnumerable reservedInstanceVmFamilies = null, IEnumerable premiumDiskVmFamilies = null, IEnumerable savingsPlanVmFamilies = null, IEnumerable savingsPlanSupportedLocations = null, IEnumerable savingsPlanSupportedLocationsForPaas = null, IEnumerable reservedInstanceSupportedLocationsForIaas = null, IEnumerable savingsPlanSupportedOffers = null, IEnumerable sqlSkus = null, IEnumerable reservedInstanceSqlTargets = null, IEnumerable reservedInstanceSupportedLocations = null, IEnumerable reservedInstanceSupportedCurrencies = null, IEnumerable reservedInstanceSupportedOffers = null, IEnumerable supportedOffers = null) + { + vmFamilies ??= new List(); + reservedInstanceVmFamilies ??= new List(); + premiumDiskVmFamilies ??= new List(); + savingsPlanVmFamilies ??= new List(); + savingsPlanSupportedLocations ??= new List(); + savingsPlanSupportedLocationsForPaas ??= new List(); + reservedInstanceSupportedLocationsForIaas ??= new List(); + savingsPlanSupportedOffers ??= new List(); + sqlSkus ??= new List(); + reservedInstanceSqlTargets ??= new List(); + reservedInstanceSupportedLocations ??= new List(); + reservedInstanceSupportedCurrencies ??= new List(); + reservedInstanceSupportedOffers ??= new List(); + supportedOffers ??= new List(); + + return new MigrationAssessmentSqlAssessmentOptionData( + id, + name, + resourceType, + systemData, + vmFamilies?.ToList(), + reservedInstanceVmFamilies?.ToList(), + premiumDiskVmFamilies?.ToList(), + savingsPlanVmFamilies?.ToList(), + savingsPlanSupportedLocations?.ToList(), + savingsPlanSupportedLocationsForPaas?.ToList(), + reservedInstanceSupportedLocationsForIaas?.ToList(), + savingsPlanSupportedOffers?.ToList(), + sqlSkus?.ToList(), + reservedInstanceSqlTargets?.ToList(), + reservedInstanceSupportedLocations?.ToList(), + reservedInstanceSupportedCurrencies?.ToList(), + reservedInstanceSupportedOffers?.ToList(), + supportedOffers?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The status of the last operation. + /// Gets or sets the collector agent properties. + /// Gets the discovery site id. + /// Gets the Timestamp when collector was created. + /// Timestamp when collector was last updated. + /// A new instance for mocking. + public static MigrationAssessmentSqlCollectorData MigrationAssessmentSqlCollectorData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MigrationAssessmentProvisioningState? provisioningState = null, CollectorAgentPropertiesBase agentProperties = null, string discoverySiteId = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null) + { + return new MigrationAssessmentSqlCollectorData( + id, + name, + resourceType, + systemData, + provisioningState, + agentProperties, + discoverySiteId, + createdOn, + updatedOn, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The status of the last operation. + /// Gets or sets the collector agent properties. + /// Gets the discovery site id. + /// Gets the Timestamp when collector was created. + /// Timestamp when collector was last updated. + /// A new instance for mocking. + public static MigrationAssessmentVMwareCollectorData MigrationAssessmentVMwareCollectorData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MigrationAssessmentProvisioningState? provisioningState = null, CollectorAgentPropertiesBase agentProperties = null, string discoverySiteId = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null) + { + return new MigrationAssessmentVMwareCollectorData( + id, + name, + resourceType, + systemData, + provisioningState, + agentProperties, + discoverySiteId, + createdOn, + updatedOn, + serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedMachineCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedMachineCollection.cs new file mode 100644 index 000000000000..237c0ff46610 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedMachineCollection.cs @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetAssessedMachines method from an instance of . + /// + public partial class AssessedMachineCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _assessedMachineAssessedMachinesOperationsClientDiagnostics; + private readonly AssessedMachinesRestOperations _assessedMachineAssessedMachinesOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected AssessedMachineCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal AssessedMachineCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _assessedMachineAssessedMachinesOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", AssessedMachineResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AssessedMachineResource.ResourceType, out string assessedMachineAssessedMachinesOperationsApiVersion); + _assessedMachineAssessedMachinesOperationsRestClient = new AssessedMachinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, assessedMachineAssessedMachinesOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MigrationAssessmentAssessmentResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MigrationAssessmentAssessmentResource.ResourceType), nameof(id)); + } + + /// + /// Get a AssessedMachine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName} + /// + /// + /// Operation Id + /// AssessedMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Machine assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string assessedMachineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessedMachineName, nameof(assessedMachineName)); + + using var scope = _assessedMachineAssessedMachinesOperationsClientDiagnostics.CreateScope("AssessedMachineCollection.Get"); + scope.Start(); + try + { + var response = await _assessedMachineAssessedMachinesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, assessedMachineName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AssessedMachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AssessedMachine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName} + /// + /// + /// Operation Id + /// AssessedMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Machine assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string assessedMachineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessedMachineName, nameof(assessedMachineName)); + + using var scope = _assessedMachineAssessedMachinesOperationsClientDiagnostics.CreateScope("AssessedMachineCollection.Get"); + scope.Start(); + try + { + var response = _assessedMachineAssessedMachinesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, assessedMachineName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AssessedMachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List AssessedMachine resources by Assessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines + /// + /// + /// Operation Id + /// AssessedMachinesOperations_ListByAssessment + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _assessedMachineAssessedMachinesOperationsRestClient.CreateListByAssessmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _assessedMachineAssessedMachinesOperationsRestClient.CreateListByAssessmentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AssessedMachineResource(Client, AssessedMachineData.DeserializeAssessedMachineData(e)), _assessedMachineAssessedMachinesOperationsClientDiagnostics, Pipeline, "AssessedMachineCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List AssessedMachine resources by Assessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines + /// + /// + /// Operation Id + /// AssessedMachinesOperations_ListByAssessment + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _assessedMachineAssessedMachinesOperationsRestClient.CreateListByAssessmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _assessedMachineAssessedMachinesOperationsRestClient.CreateListByAssessmentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AssessedMachineResource(Client, AssessedMachineData.DeserializeAssessedMachineData(e)), _assessedMachineAssessedMachinesOperationsClientDiagnostics, Pipeline, "AssessedMachineCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName} + /// + /// + /// Operation Id + /// AssessedMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Machine assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string assessedMachineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessedMachineName, nameof(assessedMachineName)); + + using var scope = _assessedMachineAssessedMachinesOperationsClientDiagnostics.CreateScope("AssessedMachineCollection.Exists"); + scope.Start(); + try + { + var response = await _assessedMachineAssessedMachinesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, assessedMachineName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName} + /// + /// + /// Operation Id + /// AssessedMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Machine assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string assessedMachineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessedMachineName, nameof(assessedMachineName)); + + using var scope = _assessedMachineAssessedMachinesOperationsClientDiagnostics.CreateScope("AssessedMachineCollection.Exists"); + scope.Start(); + try + { + var response = _assessedMachineAssessedMachinesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, assessedMachineName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName} + /// + /// + /// Operation Id + /// AssessedMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Machine assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string assessedMachineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessedMachineName, nameof(assessedMachineName)); + + using var scope = _assessedMachineAssessedMachinesOperationsClientDiagnostics.CreateScope("AssessedMachineCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _assessedMachineAssessedMachinesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, assessedMachineName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AssessedMachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName} + /// + /// + /// Operation Id + /// AssessedMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Machine assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string assessedMachineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessedMachineName, nameof(assessedMachineName)); + + using var scope = _assessedMachineAssessedMachinesOperationsClientDiagnostics.CreateScope("AssessedMachineCollection.GetIfExists"); + scope.Start(); + try + { + var response = _assessedMachineAssessedMachinesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, assessedMachineName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AssessedMachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedMachineData.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedMachineData.Serialization.cs new file mode 100644 index 000000000000..7783fe9140de --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedMachineData.Serialization.cs @@ -0,0 +1,748 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class AssessedMachineData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedMachineData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Disks)) + { + writer.WritePropertyName("disks"u8); + writer.WriteStartObject(); + foreach (var item in Disks) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsDefined(MonthlyUltraStorageCost)) + { + writer.WritePropertyName("monthlyUltraStorageCost"u8); + writer.WriteNumberValue(MonthlyUltraStorageCost.Value); + } + if (Optional.IsDefined(HostProcessor)) + { + writer.WritePropertyName("hostProcessor"u8); + writer.WriteObjectValue(HostProcessor, options); + } + if (Optional.IsCollectionDefined(CostComponents)) + { + writer.WritePropertyName("costComponents"u8); + writer.WriteStartArray(); + foreach (var item in CostComponents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ProductSupportStatus)) + { + writer.WritePropertyName("productSupportStatus"u8); + writer.WriteObjectValue(ProductSupportStatus, options); + } + if (options.Format != "W" && Optional.IsDefined(MonthlyBandwidthCost)) + { + writer.WritePropertyName("monthlyBandwidthCost"u8); + writer.WriteNumberValue(MonthlyBandwidthCost.Value); + } + if (options.Format != "W" && Optional.IsDefined(MonthlyStorageCost)) + { + writer.WritePropertyName("monthlyStorageCost"u8); + writer.WriteNumberValue(MonthlyStorageCost.Value); + } + if (options.Format != "W" && Optional.IsDefined(MonthlyPremiumStorageCost)) + { + writer.WritePropertyName("monthlyPremiumStorageCost"u8); + writer.WriteNumberValue(MonthlyPremiumStorageCost.Value); + } + if (options.Format != "W" && Optional.IsDefined(MonthlyStandardSsdStorageCost)) + { + writer.WritePropertyName("monthlyStandardSsdStorageCost"u8); + writer.WriteNumberValue(MonthlyStandardSsdStorageCost.Value); + } + if (options.Format != "W" && Optional.IsCollectionDefined(NetworkAdapters)) + { + writer.WritePropertyName("networkAdapters"u8); + writer.WriteStartObject(); + foreach (var item in NetworkAdapters) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsDefined(RecommendedSize)) + { + writer.WritePropertyName("recommendedSize"u8); + writer.WriteStringValue(RecommendedSize.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfCoresForRecommendedSize)) + { + writer.WritePropertyName("numberOfCoresForRecommendedSize"u8); + writer.WriteNumberValue(NumberOfCoresForRecommendedSize.Value); + } + if (options.Format != "W" && Optional.IsDefined(MegabytesOfMemoryForRecommendedSize)) + { + writer.WritePropertyName("megabytesOfMemoryForRecommendedSize"u8); + writer.WriteNumberValue(MegabytesOfMemoryForRecommendedSize.Value); + } + if (options.Format != "W" && Optional.IsDefined(MonthlyComputeCostForRecommendedSize)) + { + writer.WritePropertyName("monthlyComputeCostForRecommendedSize"u8); + writer.WriteNumberValue(MonthlyComputeCostForRecommendedSize.Value); + } + if (options.Format != "W" && Optional.IsDefined(SuitabilityExplanation)) + { + writer.WritePropertyName("suitabilityExplanation"u8); + writer.WriteStringValue(SuitabilityExplanation.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(SuitabilityDetail)) + { + writer.WritePropertyName("suitabilityDetail"u8); + writer.WriteStringValue(SuitabilityDetail.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(TypePropertiesType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(TypePropertiesType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(BootType)) + { + writer.WritePropertyName("bootType"u8); + writer.WriteStringValue(BootType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(OperatingSystemType)) + { + writer.WritePropertyName("operatingSystemType"u8); + writer.WriteStringValue(OperatingSystemType); + } + if (options.Format != "W" && Optional.IsDefined(OperatingSystemName)) + { + writer.WritePropertyName("operatingSystemName"u8); + writer.WriteStringValue(OperatingSystemName); + } + if (options.Format != "W" && Optional.IsDefined(OperatingSystemVersion)) + { + writer.WritePropertyName("operatingSystemVersion"u8); + writer.WriteStringValue(OperatingSystemVersion); + } + if (options.Format != "W" && Optional.IsDefined(OperatingSystemArchitecture)) + { + writer.WritePropertyName("operatingSystemArchitecture"u8); + writer.WriteStringValue(OperatingSystemArchitecture.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("createdTimestamp"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(UpdatedOn)) + { + writer.WritePropertyName("updatedTimestamp"u8); + writer.WriteStringValue(UpdatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (options.Format != "W" && Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && Optional.IsDefined(DatacenterMachineArmId)) + { + writer.WritePropertyName("datacenterMachineArmId"u8); + writer.WriteStringValue(DatacenterMachineArmId); + } + if (options.Format != "W" && Optional.IsDefined(DatacenterManagementServerArmId)) + { + writer.WritePropertyName("datacenterManagementServerArmId"u8); + writer.WriteStringValue(DatacenterManagementServerArmId); + } + if (options.Format != "W" && Optional.IsDefined(DatacenterManagementServerName)) + { + writer.WritePropertyName("datacenterManagementServerName"u8); + writer.WriteStringValue(DatacenterManagementServerName); + } + if (options.Format != "W" && Optional.IsDefined(MegabytesOfMemory)) + { + writer.WritePropertyName("megabytesOfMemory"u8); + writer.WriteNumberValue(MegabytesOfMemory.Value); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfCores)) + { + writer.WritePropertyName("numberOfCores"u8); + writer.WriteNumberValue(NumberOfCores.Value); + } + if (options.Format != "W" && Optional.IsDefined(ConfidenceRatingInPercentage)) + { + writer.WritePropertyName("confidenceRatingInPercentage"u8); + writer.WriteNumberValue(ConfidenceRatingInPercentage.Value); + } + if (options.Format != "W" && Optional.IsDefined(PercentageCoresUtilization)) + { + writer.WritePropertyName("percentageCoresUtilization"u8); + writer.WriteNumberValue(PercentageCoresUtilization.Value); + } + if (options.Format != "W" && Optional.IsDefined(PercentageMemoryUtilization)) + { + writer.WritePropertyName("percentageMemoryUtilization"u8); + writer.WriteNumberValue(PercentageMemoryUtilization.Value); + } + if (options.Format != "W" && Optional.IsDefined(Suitability)) + { + writer.WritePropertyName("suitability"u8); + writer.WriteStringValue(Suitability.Value.ToString()); + } + writer.WriteEndObject(); + } + + AssessedMachineData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedMachineData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssessedMachineData(document.RootElement, options); + } + + internal static AssessedMachineData DeserializeAssessedMachineData(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; + IReadOnlyList errors = default; + IReadOnlyDictionary disks = default; + double? monthlyUltraStorageCost = default; + ProcessorInfo hostProcessor = default; + IList costComponents = default; + ProductSupportStatus productSupportStatus = default; + double? monthlyBandwidthCost = default; + double? monthlyStorageCost = default; + double? monthlyPremiumStorageCost = default; + double? monthlyStandardSsdStorageCost = default; + IReadOnlyDictionary networkAdapters = default; + AzureVmSize? recommendedSize = default; + int? numberOfCoresForRecommendedSize = default; + double? megabytesOfMemoryForRecommendedSize = default; + double? monthlyComputeCostForRecommendedSize = default; + AzureVmSuitabilityExplanation? suitabilityExplanation = default; + AzureVmSuitabilityDetail? suitabilityDetail = default; + AssessedMachineType? type0 = default; + MachineBootType? bootType = default; + string operatingSystemType = default; + string operatingSystemName = default; + string operatingSystemVersion = default; + GuestOperatingSystemArchitecture? operatingSystemArchitecture = default; + DateTimeOffset? createdTimestamp = default; + DateTimeOffset? updatedTimestamp = default; + string displayName = default; + string description = default; + ResourceIdentifier datacenterMachineArmId = default; + ResourceIdentifier datacenterManagementServerArmId = default; + string datacenterManagementServerName = default; + double? megabytesOfMemory = default; + int? numberOfCores = default; + double? confidenceRatingInPercentage = default; + double? percentageCoresUtilization = default; + double? percentageMemoryUtilization = default; + MigrationAssessmentCloudSuitability? suitability = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(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("errors"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(MigrationAssessmentError.DeserializeMigrationAssessmentError(item, options)); + } + errors = array; + continue; + } + if (property0.NameEquals("disks"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, AssessedDisk.DeserializeAssessedDisk(property1.Value, options)); + } + disks = dictionary; + continue; + } + if (property0.NameEquals("monthlyUltraStorageCost"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyUltraStorageCost = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("hostProcessor"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hostProcessor = ProcessorInfo.DeserializeProcessorInfo(property0.Value, options); + continue; + } + if (property0.NameEquals("costComponents"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(CostComponent.DeserializeCostComponent(item, options)); + } + costComponents = array; + continue; + } + if (property0.NameEquals("productSupportStatus"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + productSupportStatus = ProductSupportStatus.DeserializeProductSupportStatus(property0.Value, options); + continue; + } + if (property0.NameEquals("monthlyBandwidthCost"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyBandwidthCost = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("monthlyStorageCost"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyStorageCost = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("monthlyPremiumStorageCost"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyPremiumStorageCost = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("monthlyStandardSsdStorageCost"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyStandardSsdStorageCost = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("networkAdapters"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, AssessedNetworkAdapter.DeserializeAssessedNetworkAdapter(property1.Value, options)); + } + networkAdapters = dictionary; + continue; + } + if (property0.NameEquals("recommendedSize"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendedSize = new AzureVmSize(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("numberOfCoresForRecommendedSize"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfCoresForRecommendedSize = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("megabytesOfMemoryForRecommendedSize"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + megabytesOfMemoryForRecommendedSize = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("monthlyComputeCostForRecommendedSize"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyComputeCostForRecommendedSize = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("suitabilityExplanation"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitabilityExplanation = new AzureVmSuitabilityExplanation(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("suitabilityDetail"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitabilityDetail = new AzureVmSuitabilityDetail(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("type"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type0 = new AssessedMachineType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("bootType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bootType = new MachineBootType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("operatingSystemType"u8)) + { + operatingSystemType = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("operatingSystemName"u8)) + { + operatingSystemName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("operatingSystemVersion"u8)) + { + operatingSystemVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("operatingSystemArchitecture"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + operatingSystemArchitecture = new GuestOperatingSystemArchitecture(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("createdTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("updatedTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("displayName"u8)) + { + displayName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("description"u8)) + { + description = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("datacenterMachineArmId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + datacenterMachineArmId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("datacenterManagementServerArmId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + datacenterManagementServerArmId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("datacenterManagementServerName"u8)) + { + datacenterManagementServerName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("megabytesOfMemory"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + megabytesOfMemory = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("numberOfCores"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfCores = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("confidenceRatingInPercentage"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + confidenceRatingInPercentage = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("percentageCoresUtilization"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + percentageCoresUtilization = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("percentageMemoryUtilization"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + percentageMemoryUtilization = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("suitability"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitability = new MigrationAssessmentCloudSuitability(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssessedMachineData( + id, + name, + type, + systemData, + errors ?? new ChangeTrackingList(), + disks ?? new ChangeTrackingDictionary(), + monthlyUltraStorageCost, + hostProcessor, + costComponents ?? new ChangeTrackingList(), + productSupportStatus, + monthlyBandwidthCost, + monthlyStorageCost, + monthlyPremiumStorageCost, + monthlyStandardSsdStorageCost, + networkAdapters ?? new ChangeTrackingDictionary(), + recommendedSize, + numberOfCoresForRecommendedSize, + megabytesOfMemoryForRecommendedSize, + monthlyComputeCostForRecommendedSize, + suitabilityExplanation, + suitabilityDetail, + type0, + bootType, + operatingSystemType, + operatingSystemName, + operatingSystemVersion, + operatingSystemArchitecture, + createdTimestamp, + updatedTimestamp, + displayName, + description, + datacenterMachineArmId, + datacenterManagementServerArmId, + datacenterManagementServerName, + megabytesOfMemory, + numberOfCores, + confidenceRatingInPercentage, + percentageCoresUtilization, + percentageMemoryUtilization, + suitability, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssessedMachineData)} does not support writing '{options.Format}' format."); + } + } + + AssessedMachineData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssessedMachineData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssessedMachineData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedMachineData.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedMachineData.cs new file mode 100644 index 000000000000..f42ba1720cb4 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedMachineData.cs @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing the AssessedMachine data model. + /// Machine assessment Assessed Machine resource. + /// + public partial class AssessedMachineData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AssessedMachineData() + { + Errors = new ChangeTrackingList(); + Disks = new ChangeTrackingDictionary(); + CostComponents = new ChangeTrackingList(); + NetworkAdapters = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// List of errors for this machine. + /// Dictionary of disks attached to the machine. Key is ID of disk. Value is a disk object. + /// Monthly ultra storage cost. + /// Gets or sets the processor details of the host. + /// Gets or sets the collection of cost components. + /// Gets the product support status related details. + /// Monthly networking cost. + /// Monthly storage cost. + /// Monthly premium storage cost. + /// Monthly standard SSD storage cost. + /// + /// List of Network Adapters that were assessed as part of this machine's + /// assessment. + /// + /// Recommended Azure Size for the machine. + /// Number of cores for recommended size. Read Only. + /// Megabytes of memory for recommended size. Read Only. + /// Monthly Compute cost calculated for Recommended size, for a 31-day month. + /// Gets the explanation if machine is not suitable for cloud. + /// Gets the details if machine is not suitable for cloud. + /// Assessed machine type. + /// Boot type of machine discovered in private data center. + /// Operating system as reported by datacenter management solution. + /// Operating system as reported by datacenter management solution. + /// Operating system version as reported by datacenter management solution. + /// Operating system architecture as reported by datacenter management solution. + /// When was machine first created. + /// When was machine last updated. + /// Display Name of the Machine. + /// Description for the machine. + /// Data center machine ARM id. + /// Data center management server ARM id. + /// Data center management server name. + /// Megabytes of memory found allocated for the machine in private data center. + /// Number of CPU cores found on the machine. + /// Confidence Rating in Percentage. + /// + /// Percentile of Percentage of Cores Utilized noted during time period T. + /// + /// Here N and T are settings on Assessment. + /// + /// + /// Percentile of Percentage of Memory Utilized noted during time period T. + /// + /// Here N and T are settings on Assessment. + /// + /// + /// Gets a value indicating whether machine is suitable for the cloud platform + /// selected. + /// + /// Keeps track of any properties unknown to the library. + internal AssessedMachineData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IReadOnlyList errors, IReadOnlyDictionary disks, double? monthlyUltraStorageCost, ProcessorInfo hostProcessor, IList costComponents, ProductSupportStatus productSupportStatus, double? monthlyBandwidthCost, double? monthlyStorageCost, double? monthlyPremiumStorageCost, double? monthlyStandardSsdStorageCost, IReadOnlyDictionary networkAdapters, AzureVmSize? recommendedSize, int? numberOfCoresForRecommendedSize, double? megabytesOfMemoryForRecommendedSize, double? monthlyComputeCostForRecommendedSize, AzureVmSuitabilityExplanation? suitabilityExplanation, AzureVmSuitabilityDetail? suitabilityDetail, AssessedMachineType? typePropertiesType, MachineBootType? bootType, string operatingSystemType, string operatingSystemName, string operatingSystemVersion, GuestOperatingSystemArchitecture? operatingSystemArchitecture, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, string displayName, string description, ResourceIdentifier datacenterMachineArmId, ResourceIdentifier datacenterManagementServerArmId, string datacenterManagementServerName, double? megabytesOfMemory, int? numberOfCores, double? confidenceRatingInPercentage, double? percentageCoresUtilization, double? percentageMemoryUtilization, MigrationAssessmentCloudSuitability? suitability, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Errors = errors; + Disks = disks; + MonthlyUltraStorageCost = monthlyUltraStorageCost; + HostProcessor = hostProcessor; + CostComponents = costComponents; + ProductSupportStatus = productSupportStatus; + MonthlyBandwidthCost = monthlyBandwidthCost; + MonthlyStorageCost = monthlyStorageCost; + MonthlyPremiumStorageCost = monthlyPremiumStorageCost; + MonthlyStandardSsdStorageCost = monthlyStandardSsdStorageCost; + NetworkAdapters = networkAdapters; + RecommendedSize = recommendedSize; + NumberOfCoresForRecommendedSize = numberOfCoresForRecommendedSize; + MegabytesOfMemoryForRecommendedSize = megabytesOfMemoryForRecommendedSize; + MonthlyComputeCostForRecommendedSize = monthlyComputeCostForRecommendedSize; + SuitabilityExplanation = suitabilityExplanation; + SuitabilityDetail = suitabilityDetail; + TypePropertiesType = typePropertiesType; + BootType = bootType; + OperatingSystemType = operatingSystemType; + OperatingSystemName = operatingSystemName; + OperatingSystemVersion = operatingSystemVersion; + OperatingSystemArchitecture = operatingSystemArchitecture; + CreatedOn = createdOn; + UpdatedOn = updatedOn; + DisplayName = displayName; + Description = description; + DatacenterMachineArmId = datacenterMachineArmId; + DatacenterManagementServerArmId = datacenterManagementServerArmId; + DatacenterManagementServerName = datacenterManagementServerName; + MegabytesOfMemory = megabytesOfMemory; + NumberOfCores = numberOfCores; + ConfidenceRatingInPercentage = confidenceRatingInPercentage; + PercentageCoresUtilization = percentageCoresUtilization; + PercentageMemoryUtilization = percentageMemoryUtilization; + Suitability = suitability; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of errors for this machine. + public IReadOnlyList Errors { get; } + /// Dictionary of disks attached to the machine. Key is ID of disk. Value is a disk object. + public IReadOnlyDictionary Disks { get; } + /// Monthly ultra storage cost. + public double? MonthlyUltraStorageCost { get; } + /// Gets or sets the processor details of the host. + public ProcessorInfo HostProcessor { get; set; } + /// Gets or sets the collection of cost components. + public IList CostComponents { get; } + /// Gets the product support status related details. + public ProductSupportStatus ProductSupportStatus { get; } + /// Monthly networking cost. + public double? MonthlyBandwidthCost { get; } + /// Monthly storage cost. + public double? MonthlyStorageCost { get; } + /// Monthly premium storage cost. + public double? MonthlyPremiumStorageCost { get; } + /// Monthly standard SSD storage cost. + public double? MonthlyStandardSsdStorageCost { get; } + /// + /// List of Network Adapters that were assessed as part of this machine's + /// assessment. + /// + public IReadOnlyDictionary NetworkAdapters { get; } + /// Recommended Azure Size for the machine. + public AzureVmSize? RecommendedSize { get; } + /// Number of cores for recommended size. Read Only. + public int? NumberOfCoresForRecommendedSize { get; } + /// Megabytes of memory for recommended size. Read Only. + public double? MegabytesOfMemoryForRecommendedSize { get; } + /// Monthly Compute cost calculated for Recommended size, for a 31-day month. + public double? MonthlyComputeCostForRecommendedSize { get; } + /// Gets the explanation if machine is not suitable for cloud. + public AzureVmSuitabilityExplanation? SuitabilityExplanation { get; } + /// Gets the details if machine is not suitable for cloud. + public AzureVmSuitabilityDetail? SuitabilityDetail { get; } + /// Assessed machine type. + public AssessedMachineType? TypePropertiesType { get; } + /// Boot type of machine discovered in private data center. + public MachineBootType? BootType { get; } + /// Operating system as reported by datacenter management solution. + public string OperatingSystemType { get; } + /// Operating system as reported by datacenter management solution. + public string OperatingSystemName { get; } + /// Operating system version as reported by datacenter management solution. + public string OperatingSystemVersion { get; } + /// Operating system architecture as reported by datacenter management solution. + public GuestOperatingSystemArchitecture? OperatingSystemArchitecture { get; } + /// When was machine first created. + public DateTimeOffset? CreatedOn { get; } + /// When was machine last updated. + public DateTimeOffset? UpdatedOn { get; } + /// Display Name of the Machine. + public string DisplayName { get; } + /// Description for the machine. + public string Description { get; } + /// Data center machine ARM id. + public ResourceIdentifier DatacenterMachineArmId { get; } + /// Data center management server ARM id. + public ResourceIdentifier DatacenterManagementServerArmId { get; } + /// Data center management server name. + public string DatacenterManagementServerName { get; } + /// Megabytes of memory found allocated for the machine in private data center. + public double? MegabytesOfMemory { get; } + /// Number of CPU cores found on the machine. + public int? NumberOfCores { get; } + /// Confidence Rating in Percentage. + public double? ConfidenceRatingInPercentage { get; } + /// + /// Percentile of Percentage of Cores Utilized noted during time period T. + /// + /// Here N and T are settings on Assessment. + /// + public double? PercentageCoresUtilization { get; } + /// + /// Percentile of Percentage of Memory Utilized noted during time period T. + /// + /// Here N and T are settings on Assessment. + /// + public double? PercentageMemoryUtilization { get; } + /// + /// Gets a value indicating whether machine is suitable for the cloud platform + /// selected. + /// + public MigrationAssessmentCloudSuitability? Suitability { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedMachineResource.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedMachineResource.Serialization.cs new file mode 100644 index 000000000000..b10b80f48901 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedMachineResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class AssessedMachineResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + AssessedMachineData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + AssessedMachineData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedMachineResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedMachineResource.cs new file mode 100644 index 000000000000..fd4d37280b62 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedMachineResource.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A Class representing an AssessedMachine along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetAssessedMachineResource method. + /// Otherwise you can get one from its parent resource using the GetAssessedMachine method. + /// + public partial class AssessedMachineResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The groupName. + /// The assessmentName. + /// The assessedMachineName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedMachineName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _assessedMachineAssessedMachinesOperationsClientDiagnostics; + private readonly AssessedMachinesRestOperations _assessedMachineAssessedMachinesOperationsRestClient; + private readonly AssessedMachineData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/groups/assessments/assessedMachines"; + + /// Initializes a new instance of the class for mocking. + protected AssessedMachineResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AssessedMachineResource(ArmClient client, AssessedMachineData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal AssessedMachineResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _assessedMachineAssessedMachinesOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string assessedMachineAssessedMachinesOperationsApiVersion); + _assessedMachineAssessedMachinesOperationsRestClient = new AssessedMachinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, assessedMachineAssessedMachinesOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual AssessedMachineData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a AssessedMachine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName} + /// + /// + /// Operation Id + /// AssessedMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _assessedMachineAssessedMachinesOperationsClientDiagnostics.CreateScope("AssessedMachineResource.Get"); + scope.Start(); + try + { + var response = await _assessedMachineAssessedMachinesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AssessedMachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AssessedMachine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName} + /// + /// + /// Operation Id + /// AssessedMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _assessedMachineAssessedMachinesOperationsClientDiagnostics.CreateScope("AssessedMachineResource.Get"); + scope.Start(); + try + { + var response = _assessedMachineAssessedMachinesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AssessedMachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlDatabaseV2Collection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlDatabaseV2Collection.cs new file mode 100644 index 000000000000..2cc3ec119687 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlDatabaseV2Collection.cs @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetAssessedSqlDatabaseV2s method from an instance of . + /// + public partial class AssessedSqlDatabaseV2Collection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsClientDiagnostics; + private readonly AssessedSqlDatabaseV2RestOperations _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected AssessedSqlDatabaseV2Collection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal AssessedSqlDatabaseV2Collection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", AssessedSqlDatabaseV2Resource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AssessedSqlDatabaseV2Resource.ResourceType, out string assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsApiVersion); + _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsRestClient = new AssessedSqlDatabaseV2RestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MigrationAssessmentSqlAssessmentV2Resource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MigrationAssessmentSqlAssessmentV2Resource.ResourceType), nameof(id)); + } + + /// + /// Get a AssessedSqlDatabaseV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlDatabases/{assessedSqlDatabaseName} + /// + /// + /// Operation Id + /// AssessedSqlDatabaseV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Databases ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string assessedSqlDatabaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessedSqlDatabaseName, nameof(assessedSqlDatabaseName)); + + using var scope = _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsClientDiagnostics.CreateScope("AssessedSqlDatabaseV2Collection.Get"); + scope.Start(); + try + { + var response = await _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, assessedSqlDatabaseName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AssessedSqlDatabaseV2Resource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AssessedSqlDatabaseV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlDatabases/{assessedSqlDatabaseName} + /// + /// + /// Operation Id + /// AssessedSqlDatabaseV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Databases ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string assessedSqlDatabaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessedSqlDatabaseName, nameof(assessedSqlDatabaseName)); + + using var scope = _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsClientDiagnostics.CreateScope("AssessedSqlDatabaseV2Collection.Get"); + scope.Start(); + try + { + var response = _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, assessedSqlDatabaseName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AssessedSqlDatabaseV2Resource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List AssessedSqlDatabaseV2 resources by SqlAssessmentV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlDatabases + /// + /// + /// Operation Id + /// AssessedSqlDatabaseV2Operations_ListBySqlAssessmentV2 + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsRestClient.CreateListBySqlAssessmentV2Request(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsRestClient.CreateListBySqlAssessmentV2NextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AssessedSqlDatabaseV2Resource(Client, AssessedSqlDatabaseV2Data.DeserializeAssessedSqlDatabaseV2Data(e)), _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsClientDiagnostics, Pipeline, "AssessedSqlDatabaseV2Collection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List AssessedSqlDatabaseV2 resources by SqlAssessmentV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlDatabases + /// + /// + /// Operation Id + /// AssessedSqlDatabaseV2Operations_ListBySqlAssessmentV2 + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsRestClient.CreateListBySqlAssessmentV2Request(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsRestClient.CreateListBySqlAssessmentV2NextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AssessedSqlDatabaseV2Resource(Client, AssessedSqlDatabaseV2Data.DeserializeAssessedSqlDatabaseV2Data(e)), _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsClientDiagnostics, Pipeline, "AssessedSqlDatabaseV2Collection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlDatabases/{assessedSqlDatabaseName} + /// + /// + /// Operation Id + /// AssessedSqlDatabaseV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Databases ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string assessedSqlDatabaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessedSqlDatabaseName, nameof(assessedSqlDatabaseName)); + + using var scope = _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsClientDiagnostics.CreateScope("AssessedSqlDatabaseV2Collection.Exists"); + scope.Start(); + try + { + var response = await _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, assessedSqlDatabaseName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlDatabases/{assessedSqlDatabaseName} + /// + /// + /// Operation Id + /// AssessedSqlDatabaseV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Databases ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string assessedSqlDatabaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessedSqlDatabaseName, nameof(assessedSqlDatabaseName)); + + using var scope = _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsClientDiagnostics.CreateScope("AssessedSqlDatabaseV2Collection.Exists"); + scope.Start(); + try + { + var response = _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, assessedSqlDatabaseName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlDatabases/{assessedSqlDatabaseName} + /// + /// + /// Operation Id + /// AssessedSqlDatabaseV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Databases ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string assessedSqlDatabaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessedSqlDatabaseName, nameof(assessedSqlDatabaseName)); + + using var scope = _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsClientDiagnostics.CreateScope("AssessedSqlDatabaseV2Collection.GetIfExists"); + scope.Start(); + try + { + var response = await _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, assessedSqlDatabaseName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AssessedSqlDatabaseV2Resource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlDatabases/{assessedSqlDatabaseName} + /// + /// + /// Operation Id + /// AssessedSqlDatabaseV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Databases ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string assessedSqlDatabaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessedSqlDatabaseName, nameof(assessedSqlDatabaseName)); + + using var scope = _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsClientDiagnostics.CreateScope("AssessedSqlDatabaseV2Collection.GetIfExists"); + scope.Start(); + try + { + var response = _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, assessedSqlDatabaseName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AssessedSqlDatabaseV2Resource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlDatabaseV2Data.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlDatabaseV2Data.Serialization.cs new file mode 100644 index 000000000000..e533c6259832 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlDatabaseV2Data.Serialization.cs @@ -0,0 +1,542 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class AssessedSqlDatabaseV2Data : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedSqlDatabaseV2Data)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(RecommendedAzureSqlTargetType)) + { + writer.WritePropertyName("recommendedAzureSqlTargetType"u8); + writer.WriteStringValue(RecommendedAzureSqlTargetType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(RecommendedSuitability)) + { + writer.WritePropertyName("recommendedSuitability"u8); + writer.WriteStringValue(RecommendedSuitability.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(BufferCacheSizeInMB)) + { + writer.WritePropertyName("bufferCacheSizeInMB"u8); + writer.WriteNumberValue(BufferCacheSizeInMB.Value); + } + if (options.Format != "W" && Optional.IsDefined(ProductSupportStatus)) + { + writer.WritePropertyName("productSupportStatus"u8); + writer.WriteObjectValue(ProductSupportStatus, options); + } + if (options.Format != "W" && Optional.IsDefined(AzureSqlMISuitabilityDetails)) + { + writer.WritePropertyName("azureSqlMISuitabilityDetails"u8); + writer.WriteObjectValue(AzureSqlMISuitabilityDetails, options); + } + if (options.Format != "W" && Optional.IsDefined(AzureSqlDBSuitabilityDetails)) + { + writer.WritePropertyName("azureSqlDBSuitabilityDetails"u8); + writer.WriteObjectValue(AzureSqlDBSuitabilityDetails, options); + } + if (options.Format != "W" && Optional.IsDefined(IsDatabaseHighlyAvailable)) + { + writer.WritePropertyName("isDatabaseHighlyAvailable"u8); + writer.WriteBooleanValue(IsDatabaseHighlyAvailable.Value); + } + if (options.Format != "W" && Optional.IsDefined(LinkedAvailabilityGroupOverview)) + { + writer.WritePropertyName("linkedAvailabilityGroupOverview"u8); + writer.WriteObjectValue(LinkedAvailabilityGroupOverview, options); + } + if (options.Format != "W" && Optional.IsDefined(MachineArmId)) + { + writer.WritePropertyName("machineArmId"u8); + writer.WriteStringValue(MachineArmId); + } + if (options.Format != "W" && Optional.IsDefined(AssessedSqlInstanceArmId)) + { + writer.WritePropertyName("assessedSqlInstanceArmId"u8); + writer.WriteStringValue(AssessedSqlInstanceArmId); + } + if (options.Format != "W" && Optional.IsDefined(MachineName)) + { + writer.WritePropertyName("machineName"u8); + writer.WriteStringValue(MachineName); + } + if (options.Format != "W" && Optional.IsDefined(InstanceName)) + { + writer.WritePropertyName("instanceName"u8); + writer.WriteStringValue(InstanceName); + } + if (options.Format != "W" && Optional.IsDefined(DatabaseName)) + { + writer.WritePropertyName("databaseName"u8); + writer.WriteStringValue(DatabaseName); + } + if (options.Format != "W" && Optional.IsDefined(DatabaseSizeInMB)) + { + writer.WritePropertyName("databaseSizeInMB"u8); + writer.WriteNumberValue(DatabaseSizeInMB.Value); + } + if (options.Format != "W" && Optional.IsDefined(CompatibilityLevel)) + { + writer.WritePropertyName("compatibilityLevel"u8); + writer.WriteStringValue(CompatibilityLevel.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(SqlDatabaseSdsArmId)) + { + writer.WritePropertyName("sqlDatabaseSdsArmId"u8); + writer.WriteStringValue(SqlDatabaseSdsArmId); + } + if (options.Format != "W" && Optional.IsDefined(PercentageCoresUtilization)) + { + writer.WritePropertyName("percentageCoresUtilization"u8); + writer.WriteNumberValue(PercentageCoresUtilization.Value); + } + if (options.Format != "W" && Optional.IsDefined(MegabytesPerSecondOfRead)) + { + writer.WritePropertyName("megabytesPerSecondOfRead"u8); + writer.WriteNumberValue(MegabytesPerSecondOfRead.Value); + } + if (options.Format != "W" && Optional.IsDefined(MegabytesPerSecondOfWrite)) + { + writer.WritePropertyName("megabytesPerSecondOfWrite"u8); + writer.WriteNumberValue(MegabytesPerSecondOfWrite.Value); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfReadOperationsPerSecond)) + { + writer.WritePropertyName("numberOfReadOperationsPerSecond"u8); + writer.WriteNumberValue(NumberOfReadOperationsPerSecond.Value); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfWriteOperationsPerSecond)) + { + writer.WritePropertyName("numberOfWriteOperationsPerSecond"u8); + writer.WriteNumberValue(NumberOfWriteOperationsPerSecond.Value); + } + if (options.Format != "W" && Optional.IsDefined(ConfidenceRatingInPercentage)) + { + writer.WritePropertyName("confidenceRatingInPercentage"u8); + writer.WriteNumberValue(ConfidenceRatingInPercentage.Value); + } + if (options.Format != "W" && Optional.IsDefined(SizingCriterion)) + { + writer.WritePropertyName("sizingCriterion"u8); + writer.WriteStringValue(SizingCriterion.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("createdTimestamp"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(UpdatedOn)) + { + writer.WritePropertyName("updatedTimestamp"u8); + writer.WriteStringValue(UpdatedOn.Value, "O"); + } + writer.WriteEndObject(); + } + + AssessedSqlDatabaseV2Data IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedSqlDatabaseV2Data)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssessedSqlDatabaseV2Data(document.RootElement, options); + } + + internal static AssessedSqlDatabaseV2Data DeserializeAssessedSqlDatabaseV2Data(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; + MigrationAssessmentTargetType? recommendedAzureSqlTargetType = default; + RecommendedSuitability? recommendedSuitability = default; + double? bufferCacheSizeInMB = default; + ProductSupportStatus productSupportStatus = default; + SqlAssessmentV2PaasSuitabilityDetails azureSqlMISuitabilityDetails = default; + SqlAssessmentV2PaasSuitabilityDetails azureSqlDBSuitabilityDetails = default; + bool? isDatabaseHighlyAvailable = default; + SqlAvailabilityGroupDataOverview linkedAvailabilityGroupOverview = default; + ResourceIdentifier machineArmId = default; + ResourceIdentifier assessedSqlInstanceArmId = default; + string machineName = default; + string instanceName = default; + string databaseName = default; + double? databaseSizeInMB = default; + CompatibilityLevel? compatibilityLevel = default; + ResourceIdentifier sqlDatabaseSdsArmId = default; + double? percentageCoresUtilization = default; + double? megabytesPerSecondOfRead = default; + double? megabytesPerSecondOfWrite = default; + double? numberOfReadOperationsPerSecond = default; + double? numberOfWriteOperationsPerSecond = default; + double? confidenceRatingInPercentage = default; + AssessmentSizingCriterion? sizingCriterion = default; + DateTimeOffset? createdTimestamp = default; + DateTimeOffset? updatedTimestamp = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(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("recommendedAzureSqlTargetType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendedAzureSqlTargetType = new MigrationAssessmentTargetType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("recommendedSuitability"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendedSuitability = new RecommendedSuitability(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("bufferCacheSizeInMB"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bufferCacheSizeInMB = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("productSupportStatus"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + productSupportStatus = ProductSupportStatus.DeserializeProductSupportStatus(property0.Value, options); + continue; + } + if (property0.NameEquals("azureSqlMISuitabilityDetails"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSqlMISuitabilityDetails = SqlAssessmentV2PaasSuitabilityDetails.DeserializeSqlAssessmentV2PaasSuitabilityDetails(property0.Value, options); + continue; + } + if (property0.NameEquals("azureSqlDBSuitabilityDetails"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSqlDBSuitabilityDetails = SqlAssessmentV2PaasSuitabilityDetails.DeserializeSqlAssessmentV2PaasSuitabilityDetails(property0.Value, options); + continue; + } + if (property0.NameEquals("isDatabaseHighlyAvailable"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDatabaseHighlyAvailable = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("linkedAvailabilityGroupOverview"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + linkedAvailabilityGroupOverview = SqlAvailabilityGroupDataOverview.DeserializeSqlAvailabilityGroupDataOverview(property0.Value, options); + continue; + } + if (property0.NameEquals("machineArmId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + machineArmId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("assessedSqlInstanceArmId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assessedSqlInstanceArmId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("machineName"u8)) + { + machineName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("instanceName"u8)) + { + instanceName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("databaseName"u8)) + { + databaseName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("databaseSizeInMB"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseSizeInMB = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("compatibilityLevel"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + compatibilityLevel = new CompatibilityLevel(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("sqlDatabaseSdsArmId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sqlDatabaseSdsArmId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("percentageCoresUtilization"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + percentageCoresUtilization = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("megabytesPerSecondOfRead"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + megabytesPerSecondOfRead = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("megabytesPerSecondOfWrite"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + megabytesPerSecondOfWrite = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("numberOfReadOperationsPerSecond"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfReadOperationsPerSecond = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("numberOfWriteOperationsPerSecond"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfWriteOperationsPerSecond = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("confidenceRatingInPercentage"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + confidenceRatingInPercentage = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("sizingCriterion"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sizingCriterion = new AssessmentSizingCriterion(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("createdTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("updatedTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssessedSqlDatabaseV2Data( + id, + name, + type, + systemData, + recommendedAzureSqlTargetType, + recommendedSuitability, + bufferCacheSizeInMB, + productSupportStatus, + azureSqlMISuitabilityDetails, + azureSqlDBSuitabilityDetails, + isDatabaseHighlyAvailable, + linkedAvailabilityGroupOverview, + machineArmId, + assessedSqlInstanceArmId, + machineName, + instanceName, + databaseName, + databaseSizeInMB, + compatibilityLevel, + sqlDatabaseSdsArmId, + percentageCoresUtilization, + megabytesPerSecondOfRead, + megabytesPerSecondOfWrite, + numberOfReadOperationsPerSecond, + numberOfWriteOperationsPerSecond, + confidenceRatingInPercentage, + sizingCriterion, + createdTimestamp, + updatedTimestamp, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssessedSqlDatabaseV2Data)} does not support writing '{options.Format}' format."); + } + } + + AssessedSqlDatabaseV2Data IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssessedSqlDatabaseV2Data(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssessedSqlDatabaseV2Data)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlDatabaseV2Data.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlDatabaseV2Data.cs new file mode 100644 index 000000000000..45f012786c40 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlDatabaseV2Data.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing the AssessedSqlDatabaseV2 data model. + /// Assessed SQL database web model class. + /// + public partial class AssessedSqlDatabaseV2Data : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AssessedSqlDatabaseV2Data() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets or sets the recommended azure SQL target type. + /// Gets or sets the recommended azure SQL suitability. + /// + /// Gets or sets the aggregated cache size of this database. This is a performance + /// data metric for this DB. + /// + /// Gets the product support status related details. + /// Gets or sets the azure SQL MI suitability details. + /// Gets or sets the azure SQL DB suitability details. + /// + /// Gets a value indicating whether the assessed SQL database is highly available + /// or not. + /// + /// + /// Gets the linked availability group overview if the database being assessed is + /// highly available. + /// + /// Machine arm id. + /// Assessed SQL instance arm id. + /// Machine display name. + /// SQL instance name. + /// SQL database name. + /// SQL database size in megabytes. + /// Database compatibility level. + /// SQL database SDS arm id. + /// The percentage of the total number of cores being utilized by the SQL database. + /// The read throughput of the SQL database. + /// The write throughput of the SQL database. + /// The read operations per second of the SQL database. + /// The write operations per second of the SQL database. + /// Confidence Rating in Percentage. + /// Assessment sizing criterion. + /// When was assessed SQL database first created. + /// When was assessed SQL database last updated. + /// Keeps track of any properties unknown to the library. + internal AssessedSqlDatabaseV2Data(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MigrationAssessmentTargetType? recommendedAzureSqlTargetType, RecommendedSuitability? recommendedSuitability, double? bufferCacheSizeInMB, ProductSupportStatus productSupportStatus, SqlAssessmentV2PaasSuitabilityDetails azureSqlMISuitabilityDetails, SqlAssessmentV2PaasSuitabilityDetails azureSqlDBSuitabilityDetails, bool? isDatabaseHighlyAvailable, SqlAvailabilityGroupDataOverview linkedAvailabilityGroupOverview, ResourceIdentifier machineArmId, ResourceIdentifier assessedSqlInstanceArmId, string machineName, string instanceName, string databaseName, double? databaseSizeInMB, CompatibilityLevel? compatibilityLevel, ResourceIdentifier sqlDatabaseSdsArmId, double? percentageCoresUtilization, double? megabytesPerSecondOfRead, double? megabytesPerSecondOfWrite, double? numberOfReadOperationsPerSecond, double? numberOfWriteOperationsPerSecond, double? confidenceRatingInPercentage, AssessmentSizingCriterion? sizingCriterion, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + RecommendedAzureSqlTargetType = recommendedAzureSqlTargetType; + RecommendedSuitability = recommendedSuitability; + BufferCacheSizeInMB = bufferCacheSizeInMB; + ProductSupportStatus = productSupportStatus; + AzureSqlMISuitabilityDetails = azureSqlMISuitabilityDetails; + AzureSqlDBSuitabilityDetails = azureSqlDBSuitabilityDetails; + IsDatabaseHighlyAvailable = isDatabaseHighlyAvailable; + LinkedAvailabilityGroupOverview = linkedAvailabilityGroupOverview; + MachineArmId = machineArmId; + AssessedSqlInstanceArmId = assessedSqlInstanceArmId; + MachineName = machineName; + InstanceName = instanceName; + DatabaseName = databaseName; + DatabaseSizeInMB = databaseSizeInMB; + CompatibilityLevel = compatibilityLevel; + SqlDatabaseSdsArmId = sqlDatabaseSdsArmId; + PercentageCoresUtilization = percentageCoresUtilization; + MegabytesPerSecondOfRead = megabytesPerSecondOfRead; + MegabytesPerSecondOfWrite = megabytesPerSecondOfWrite; + NumberOfReadOperationsPerSecond = numberOfReadOperationsPerSecond; + NumberOfWriteOperationsPerSecond = numberOfWriteOperationsPerSecond; + ConfidenceRatingInPercentage = confidenceRatingInPercentage; + SizingCriterion = sizingCriterion; + CreatedOn = createdOn; + UpdatedOn = updatedOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the recommended azure SQL target type. + public MigrationAssessmentTargetType? RecommendedAzureSqlTargetType { get; } + /// Gets or sets the recommended azure SQL suitability. + public RecommendedSuitability? RecommendedSuitability { get; } + /// + /// Gets or sets the aggregated cache size of this database. This is a performance + /// data metric for this DB. + /// + public double? BufferCacheSizeInMB { get; } + /// Gets the product support status related details. + public ProductSupportStatus ProductSupportStatus { get; } + /// Gets or sets the azure SQL MI suitability details. + public SqlAssessmentV2PaasSuitabilityDetails AzureSqlMISuitabilityDetails { get; } + /// Gets or sets the azure SQL DB suitability details. + public SqlAssessmentV2PaasSuitabilityDetails AzureSqlDBSuitabilityDetails { get; } + /// + /// Gets a value indicating whether the assessed SQL database is highly available + /// or not. + /// + public bool? IsDatabaseHighlyAvailable { get; } + /// + /// Gets the linked availability group overview if the database being assessed is + /// highly available. + /// + public SqlAvailabilityGroupDataOverview LinkedAvailabilityGroupOverview { get; } + /// Machine arm id. + public ResourceIdentifier MachineArmId { get; } + /// Assessed SQL instance arm id. + public ResourceIdentifier AssessedSqlInstanceArmId { get; } + /// Machine display name. + public string MachineName { get; } + /// SQL instance name. + public string InstanceName { get; } + /// SQL database name. + public string DatabaseName { get; } + /// SQL database size in megabytes. + public double? DatabaseSizeInMB { get; } + /// Database compatibility level. + public CompatibilityLevel? CompatibilityLevel { get; } + /// SQL database SDS arm id. + public ResourceIdentifier SqlDatabaseSdsArmId { get; } + /// The percentage of the total number of cores being utilized by the SQL database. + public double? PercentageCoresUtilization { get; } + /// The read throughput of the SQL database. + public double? MegabytesPerSecondOfRead { get; } + /// The write throughput of the SQL database. + public double? MegabytesPerSecondOfWrite { get; } + /// The read operations per second of the SQL database. + public double? NumberOfReadOperationsPerSecond { get; } + /// The write operations per second of the SQL database. + public double? NumberOfWriteOperationsPerSecond { get; } + /// Confidence Rating in Percentage. + public double? ConfidenceRatingInPercentage { get; } + /// Assessment sizing criterion. + public AssessmentSizingCriterion? SizingCriterion { get; } + /// When was assessed SQL database first created. + public DateTimeOffset? CreatedOn { get; } + /// When was assessed SQL database last updated. + public DateTimeOffset? UpdatedOn { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlDatabaseV2Resource.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlDatabaseV2Resource.Serialization.cs new file mode 100644 index 000000000000..450cf08dafb0 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlDatabaseV2Resource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class AssessedSqlDatabaseV2Resource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + AssessedSqlDatabaseV2Data IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + AssessedSqlDatabaseV2Data IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlDatabaseV2Resource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlDatabaseV2Resource.cs new file mode 100644 index 000000000000..0f2dac87857b --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlDatabaseV2Resource.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A Class representing an AssessedSqlDatabaseV2 along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetAssessedSqlDatabaseV2Resource method. + /// Otherwise you can get one from its parent resource using the GetAssessedSqlDatabaseV2 method. + /// + public partial class AssessedSqlDatabaseV2Resource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The groupName. + /// The assessmentName. + /// The assessedSqlDatabaseName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedSqlDatabaseName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlDatabases/{assessedSqlDatabaseName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsClientDiagnostics; + private readonly AssessedSqlDatabaseV2RestOperations _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsRestClient; + private readonly AssessedSqlDatabaseV2Data _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/groups/sqlAssessments/assessedSqlDatabases"; + + /// Initializes a new instance of the class for mocking. + protected AssessedSqlDatabaseV2Resource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AssessedSqlDatabaseV2Resource(ArmClient client, AssessedSqlDatabaseV2Data data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal AssessedSqlDatabaseV2Resource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsApiVersion); + _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsRestClient = new AssessedSqlDatabaseV2RestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual AssessedSqlDatabaseV2Data Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a AssessedSqlDatabaseV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlDatabases/{assessedSqlDatabaseName} + /// + /// + /// Operation Id + /// AssessedSqlDatabaseV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsClientDiagnostics.CreateScope("AssessedSqlDatabaseV2Resource.Get"); + scope.Start(); + try + { + var response = await _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AssessedSqlDatabaseV2Resource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AssessedSqlDatabaseV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlDatabases/{assessedSqlDatabaseName} + /// + /// + /// Operation Id + /// AssessedSqlDatabaseV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsClientDiagnostics.CreateScope("AssessedSqlDatabaseV2Resource.Get"); + scope.Start(); + try + { + var response = _assessedSqlDatabaseV2AssessedSqlDatabaseV2OperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AssessedSqlDatabaseV2Resource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlInstanceV2Collection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlInstanceV2Collection.cs new file mode 100644 index 000000000000..7ce5e4613947 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlInstanceV2Collection.cs @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetAssessedSqlInstanceV2s method from an instance of . + /// + public partial class AssessedSqlInstanceV2Collection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsClientDiagnostics; + private readonly AssessedSqlInstanceV2RestOperations _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected AssessedSqlInstanceV2Collection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal AssessedSqlInstanceV2Collection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", AssessedSqlInstanceV2Resource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AssessedSqlInstanceV2Resource.ResourceType, out string assessedSqlInstanceV2AssessedSqlInstanceV2OperationsApiVersion); + _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsRestClient = new AssessedSqlInstanceV2RestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, assessedSqlInstanceV2AssessedSqlInstanceV2OperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MigrationAssessmentSqlAssessmentV2Resource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MigrationAssessmentSqlAssessmentV2Resource.ResourceType), nameof(id)); + } + + /// + /// Get a AssessedSqlInstanceV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlInstances/{assessedSqlInstanceName} + /// + /// + /// Operation Id + /// AssessedSqlInstanceV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Instance ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string assessedSqlInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessedSqlInstanceName, nameof(assessedSqlInstanceName)); + + using var scope = _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsClientDiagnostics.CreateScope("AssessedSqlInstanceV2Collection.Get"); + scope.Start(); + try + { + var response = await _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, assessedSqlInstanceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AssessedSqlInstanceV2Resource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AssessedSqlInstanceV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlInstances/{assessedSqlInstanceName} + /// + /// + /// Operation Id + /// AssessedSqlInstanceV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Instance ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string assessedSqlInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessedSqlInstanceName, nameof(assessedSqlInstanceName)); + + using var scope = _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsClientDiagnostics.CreateScope("AssessedSqlInstanceV2Collection.Get"); + scope.Start(); + try + { + var response = _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, assessedSqlInstanceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AssessedSqlInstanceV2Resource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List AssessedSqlInstanceV2 resources by SqlAssessmentV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlInstances + /// + /// + /// Operation Id + /// AssessedSqlInstanceV2Operations_ListBySqlAssessmentV2 + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsRestClient.CreateListBySqlAssessmentV2Request(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsRestClient.CreateListBySqlAssessmentV2NextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AssessedSqlInstanceV2Resource(Client, AssessedSqlInstanceV2Data.DeserializeAssessedSqlInstanceV2Data(e)), _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsClientDiagnostics, Pipeline, "AssessedSqlInstanceV2Collection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List AssessedSqlInstanceV2 resources by SqlAssessmentV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlInstances + /// + /// + /// Operation Id + /// AssessedSqlInstanceV2Operations_ListBySqlAssessmentV2 + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsRestClient.CreateListBySqlAssessmentV2Request(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsRestClient.CreateListBySqlAssessmentV2NextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AssessedSqlInstanceV2Resource(Client, AssessedSqlInstanceV2Data.DeserializeAssessedSqlInstanceV2Data(e)), _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsClientDiagnostics, Pipeline, "AssessedSqlInstanceV2Collection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlInstances/{assessedSqlInstanceName} + /// + /// + /// Operation Id + /// AssessedSqlInstanceV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Instance ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string assessedSqlInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessedSqlInstanceName, nameof(assessedSqlInstanceName)); + + using var scope = _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsClientDiagnostics.CreateScope("AssessedSqlInstanceV2Collection.Exists"); + scope.Start(); + try + { + var response = await _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, assessedSqlInstanceName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlInstances/{assessedSqlInstanceName} + /// + /// + /// Operation Id + /// AssessedSqlInstanceV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Instance ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string assessedSqlInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessedSqlInstanceName, nameof(assessedSqlInstanceName)); + + using var scope = _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsClientDiagnostics.CreateScope("AssessedSqlInstanceV2Collection.Exists"); + scope.Start(); + try + { + var response = _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, assessedSqlInstanceName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlInstances/{assessedSqlInstanceName} + /// + /// + /// Operation Id + /// AssessedSqlInstanceV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Instance ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string assessedSqlInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessedSqlInstanceName, nameof(assessedSqlInstanceName)); + + using var scope = _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsClientDiagnostics.CreateScope("AssessedSqlInstanceV2Collection.GetIfExists"); + scope.Start(); + try + { + var response = await _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, assessedSqlInstanceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AssessedSqlInstanceV2Resource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlInstances/{assessedSqlInstanceName} + /// + /// + /// Operation Id + /// AssessedSqlInstanceV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Instance ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string assessedSqlInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessedSqlInstanceName, nameof(assessedSqlInstanceName)); + + using var scope = _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsClientDiagnostics.CreateScope("AssessedSqlInstanceV2Collection.GetIfExists"); + scope.Start(); + try + { + var response = _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, assessedSqlInstanceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AssessedSqlInstanceV2Resource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlInstanceV2Data.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlInstanceV2Data.Serialization.cs new file mode 100644 index 000000000000..edea3c78714a --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlInstanceV2Data.Serialization.cs @@ -0,0 +1,616 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class AssessedSqlInstanceV2Data : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedSqlInstanceV2Data)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(MemoryInUseInMB)) + { + writer.WritePropertyName("memoryInUseInMB"u8); + writer.WriteNumberValue(MemoryInUseInMB.Value); + } + if (options.Format != "W" && Optional.IsDefined(HasScanOccurred)) + { + writer.WritePropertyName("hasScanOccurred"u8); + writer.WriteBooleanValue(HasScanOccurred.Value); + } + if (options.Format != "W" && Optional.IsDefined(RecommendedAzureSqlTargetType)) + { + writer.WritePropertyName("recommendedAzureSqlTargetType"u8); + writer.WriteStringValue(RecommendedAzureSqlTargetType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(RecommendedSuitability)) + { + writer.WritePropertyName("recommendedSuitability"u8); + writer.WriteStringValue(RecommendedSuitability.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(AzureSqlMISuitabilityDetails)) + { + writer.WritePropertyName("azureSqlMISuitabilityDetails"u8); + writer.WriteObjectValue(AzureSqlMISuitabilityDetails, options); + } + if (options.Format != "W" && Optional.IsDefined(AzureSqlDBSuitabilityDetails)) + { + writer.WritePropertyName("azureSqlDBSuitabilityDetails"u8); + writer.WriteObjectValue(AzureSqlDBSuitabilityDetails, options); + } + if (options.Format != "W" && Optional.IsDefined(AzureSqlVmSuitabilityDetails)) + { + writer.WritePropertyName("azureSqlVMSuitabilityDetails"u8); + writer.WriteObjectValue(AzureSqlVmSuitabilityDetails, options); + } + if (options.Format != "W" && Optional.IsCollectionDefined(StorageTypeBasedDetails)) + { + writer.WritePropertyName("storageTypeBasedDetails"u8); + writer.WriteStartArray(); + foreach (var item in StorageTypeBasedDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ProductSupportStatus)) + { + writer.WritePropertyName("productSupportStatus"u8); + writer.WriteObjectValue(ProductSupportStatus, options); + } + if (options.Format != "W" && Optional.IsDefined(FciMetadata)) + { + writer.WritePropertyName("fciMetadata"u8); + writer.WriteObjectValue(FciMetadata, options); + } + if (options.Format != "W" && Optional.IsDefined(AvailabilityReplicaSummary)) + { + writer.WritePropertyName("availabilityReplicaSummary"u8); + writer.WriteObjectValue(AvailabilityReplicaSummary, options); + } + if (options.Format != "W" && Optional.IsDefined(IsClustered)) + { + writer.WritePropertyName("isClustered"u8); + writer.WriteBooleanValue(IsClustered.Value); + } + if (options.Format != "W" && Optional.IsDefined(IsHighAvailabilityEnabled)) + { + writer.WritePropertyName("isHighAvailabilityEnabled"u8); + writer.WriteBooleanValue(IsHighAvailabilityEnabled.Value); + } + if (options.Format != "W" && Optional.IsCollectionDefined(RecommendedTargetReasonings)) + { + writer.WritePropertyName("recommendedTargetReasonings"u8); + writer.WriteStartArray(); + foreach (var item in RecommendedTargetReasonings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(MachineArmId)) + { + writer.WritePropertyName("machineArmId"u8); + writer.WriteStringValue(MachineArmId); + } + if (options.Format != "W" && Optional.IsDefined(MachineName)) + { + writer.WritePropertyName("machineName"u8); + writer.WriteStringValue(MachineName); + } + if (options.Format != "W" && Optional.IsDefined(InstanceName)) + { + writer.WritePropertyName("instanceName"u8); + writer.WriteStringValue(InstanceName); + } + if (options.Format != "W" && Optional.IsDefined(SqlInstanceSdsArmId)) + { + writer.WritePropertyName("sqlInstanceSdsArmId"u8); + writer.WriteStringValue(SqlInstanceSdsArmId); + } + if (options.Format != "W" && Optional.IsDefined(SqlEdition)) + { + writer.WritePropertyName("sqlEdition"u8); + writer.WriteStringValue(SqlEdition); + } + if (options.Format != "W" && Optional.IsDefined(SqlVersion)) + { + writer.WritePropertyName("sqlVersion"u8); + writer.WriteStringValue(SqlVersion); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfCoresAllocated)) + { + writer.WritePropertyName("numberOfCoresAllocated"u8); + writer.WriteNumberValue(NumberOfCoresAllocated.Value); + } + if (options.Format != "W" && Optional.IsDefined(PercentageCoresUtilization)) + { + writer.WritePropertyName("percentageCoresUtilization"u8); + writer.WriteNumberValue(PercentageCoresUtilization.Value); + } + if (options.Format != "W" && Optional.IsCollectionDefined(LogicalDisks)) + { + writer.WritePropertyName("logicalDisks"u8); + writer.WriteStartArray(); + foreach (var item in LogicalDisks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(DatabaseSummary)) + { + writer.WritePropertyName("databaseSummary"u8); + writer.WriteObjectValue(DatabaseSummary, options); + } + if (options.Format != "W" && Optional.IsDefined(ConfidenceRatingInPercentage)) + { + writer.WritePropertyName("confidenceRatingInPercentage"u8); + writer.WriteNumberValue(ConfidenceRatingInPercentage.Value); + } + if (options.Format != "W" && Optional.IsDefined(SizingCriterion)) + { + writer.WritePropertyName("sizingCriterion"u8); + writer.WriteStringValue(SizingCriterion.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("createdTimestamp"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(UpdatedOn)) + { + writer.WritePropertyName("updatedTimestamp"u8); + writer.WriteStringValue(UpdatedOn.Value, "O"); + } + writer.WriteEndObject(); + } + + AssessedSqlInstanceV2Data IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedSqlInstanceV2Data)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssessedSqlInstanceV2Data(document.RootElement, options); + } + + internal static AssessedSqlInstanceV2Data DeserializeAssessedSqlInstanceV2Data(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; + double? memoryInUseInMB = default; + bool? hasScanOccurred = default; + MigrationAssessmentTargetType? recommendedAzureSqlTargetType = default; + RecommendedSuitability? recommendedSuitability = default; + SqlAssessmentV2PaasSuitabilityDetails azureSqlMISuitabilityDetails = default; + SqlAssessmentV2PaasSuitabilityDetails azureSqlDBSuitabilityDetails = default; + SqlAssessmentV2IaasSuitabilityDetails azureSqlVmSuitabilityDetails = default; + IReadOnlyList storageTypeBasedDetails = default; + ProductSupportStatus productSupportStatus = default; + SqlFciMetadata fciMetadata = default; + SqlAvailabilityReplicaSummary availabilityReplicaSummary = default; + bool? isClustered = default; + bool? isHighAvailabilityEnabled = default; + IReadOnlyList recommendedTargetReasonings = default; + ResourceIdentifier machineArmId = default; + string machineName = default; + string instanceName = default; + ResourceIdentifier sqlInstanceSdsArmId = default; + string sqlEdition = default; + string sqlVersion = default; + int? numberOfCoresAllocated = default; + double? percentageCoresUtilization = default; + IReadOnlyList logicalDisks = default; + AssessedSqlInstanceDatabaseSummary databaseSummary = default; + double? confidenceRatingInPercentage = default; + AssessmentSizingCriterion? sizingCriterion = default; + DateTimeOffset? createdTimestamp = default; + DateTimeOffset? updatedTimestamp = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(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("memoryInUseInMB"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + memoryInUseInMB = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("hasScanOccurred"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hasScanOccurred = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("recommendedAzureSqlTargetType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendedAzureSqlTargetType = new MigrationAssessmentTargetType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("recommendedSuitability"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendedSuitability = new RecommendedSuitability(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("azureSqlMISuitabilityDetails"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSqlMISuitabilityDetails = SqlAssessmentV2PaasSuitabilityDetails.DeserializeSqlAssessmentV2PaasSuitabilityDetails(property0.Value, options); + continue; + } + if (property0.NameEquals("azureSqlDBSuitabilityDetails"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSqlDBSuitabilityDetails = SqlAssessmentV2PaasSuitabilityDetails.DeserializeSqlAssessmentV2PaasSuitabilityDetails(property0.Value, options); + continue; + } + if (property0.NameEquals("azureSqlVMSuitabilityDetails"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSqlVmSuitabilityDetails = SqlAssessmentV2IaasSuitabilityDetails.DeserializeSqlAssessmentV2IaasSuitabilityDetails(property0.Value, options); + continue; + } + if (property0.NameEquals("storageTypeBasedDetails"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(AssessedSqlInstanceStorageDetails.DeserializeAssessedSqlInstanceStorageDetails(item, options)); + } + storageTypeBasedDetails = array; + continue; + } + if (property0.NameEquals("productSupportStatus"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + productSupportStatus = ProductSupportStatus.DeserializeProductSupportStatus(property0.Value, options); + continue; + } + if (property0.NameEquals("fciMetadata"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fciMetadata = SqlFciMetadata.DeserializeSqlFciMetadata(property0.Value, options); + continue; + } + if (property0.NameEquals("availabilityReplicaSummary"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + availabilityReplicaSummary = SqlAvailabilityReplicaSummary.DeserializeSqlAvailabilityReplicaSummary(property0.Value, options); + continue; + } + if (property0.NameEquals("isClustered"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isClustered = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("isHighAvailabilityEnabled"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isHighAvailabilityEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("recommendedTargetReasonings"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(SqlRecommendationReasoning.DeserializeSqlRecommendationReasoning(item, options)); + } + recommendedTargetReasonings = array; + continue; + } + if (property0.NameEquals("machineArmId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + machineArmId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("machineName"u8)) + { + machineName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("instanceName"u8)) + { + instanceName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("sqlInstanceSdsArmId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sqlInstanceSdsArmId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("sqlEdition"u8)) + { + sqlEdition = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("sqlVersion"u8)) + { + sqlVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("numberOfCoresAllocated"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfCoresAllocated = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("percentageCoresUtilization"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + percentageCoresUtilization = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("logicalDisks"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(AssessedSqlInstanceDiskDetails.DeserializeAssessedSqlInstanceDiskDetails(item, options)); + } + logicalDisks = array; + continue; + } + if (property0.NameEquals("databaseSummary"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseSummary = AssessedSqlInstanceDatabaseSummary.DeserializeAssessedSqlInstanceDatabaseSummary(property0.Value, options); + continue; + } + if (property0.NameEquals("confidenceRatingInPercentage"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + confidenceRatingInPercentage = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("sizingCriterion"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sizingCriterion = new AssessmentSizingCriterion(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("createdTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("updatedTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssessedSqlInstanceV2Data( + id, + name, + type, + systemData, + memoryInUseInMB, + hasScanOccurred, + recommendedAzureSqlTargetType, + recommendedSuitability, + azureSqlMISuitabilityDetails, + azureSqlDBSuitabilityDetails, + azureSqlVmSuitabilityDetails, + storageTypeBasedDetails ?? new ChangeTrackingList(), + productSupportStatus, + fciMetadata, + availabilityReplicaSummary, + isClustered, + isHighAvailabilityEnabled, + recommendedTargetReasonings ?? new ChangeTrackingList(), + machineArmId, + machineName, + instanceName, + sqlInstanceSdsArmId, + sqlEdition, + sqlVersion, + numberOfCoresAllocated, + percentageCoresUtilization, + logicalDisks ?? new ChangeTrackingList(), + databaseSummary, + confidenceRatingInPercentage, + sizingCriterion, + createdTimestamp, + updatedTimestamp, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssessedSqlInstanceV2Data)} does not support writing '{options.Format}' format."); + } + } + + AssessedSqlInstanceV2Data IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssessedSqlInstanceV2Data(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssessedSqlInstanceV2Data)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlInstanceV2Data.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlInstanceV2Data.cs new file mode 100644 index 000000000000..18514fca54aa --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlInstanceV2Data.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing the AssessedSqlInstanceV2 data model. + /// Assessed SQL instance web model class. + /// + public partial class AssessedSqlInstanceV2Data : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AssessedSqlInstanceV2Data() + { + StorageTypeBasedDetails = new ChangeTrackingList(); + RecommendedTargetReasonings = new ChangeTrackingList(); + LogicalDisks = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets or sets the memory used by SQL instance in megabytes. + /// Gets or sets a value indicating whether SQL instance has been deep discovered. + /// Gets or sets the recommended azure SQL target type. + /// Gets or sets the recommended azure SQL suitability. + /// SQL instance azure SQL MI suitability details. + /// SQL instance azure SQL DB suitability details. + /// SQL instance azure SQL VM suitability details. + /// Gets the storage details. + /// Gets the product support status related details. + /// Gets the FCI metadata if this instance represents an FCI instance. + /// + /// Gets the overview counts of availability replicas in the assessed instance, by + /// commit mode and read type. + /// + /// Gets a value indicating whether the SQL instance is clustered or not. + /// Gets a value indicating whether the high availability is enabled or not. + /// Gets the list of recommended target reasoning. + /// Machine arm id. + /// Machine display name. + /// SQL instance name. + /// SQL instance SDS arm id. + /// SQL instance edition. + /// SQL instance version. + /// Number of CPU cores assigned to the SQL instance. + /// The percentage of the total number of cores being utilized by the SQL instance. + /// The logical disk details. + /// The databases summary. + /// Confidence Rating in Percentage. + /// Assessment sizing criterion. + /// When was assessed SQL instance first created. + /// When was assessed SQL instance last updated. + /// Keeps track of any properties unknown to the library. + internal AssessedSqlInstanceV2Data(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, double? memoryInUseInMB, bool? hasScanOccurred, MigrationAssessmentTargetType? recommendedAzureSqlTargetType, RecommendedSuitability? recommendedSuitability, SqlAssessmentV2PaasSuitabilityDetails azureSqlMISuitabilityDetails, SqlAssessmentV2PaasSuitabilityDetails azureSqlDBSuitabilityDetails, SqlAssessmentV2IaasSuitabilityDetails azureSqlVmSuitabilityDetails, IReadOnlyList storageTypeBasedDetails, ProductSupportStatus productSupportStatus, SqlFciMetadata fciMetadata, SqlAvailabilityReplicaSummary availabilityReplicaSummary, bool? isClustered, bool? isHighAvailabilityEnabled, IReadOnlyList recommendedTargetReasonings, ResourceIdentifier machineArmId, string machineName, string instanceName, ResourceIdentifier sqlInstanceSdsArmId, string sqlEdition, string sqlVersion, int? numberOfCoresAllocated, double? percentageCoresUtilization, IReadOnlyList logicalDisks, AssessedSqlInstanceDatabaseSummary databaseSummary, double? confidenceRatingInPercentage, AssessmentSizingCriterion? sizingCriterion, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + MemoryInUseInMB = memoryInUseInMB; + HasScanOccurred = hasScanOccurred; + RecommendedAzureSqlTargetType = recommendedAzureSqlTargetType; + RecommendedSuitability = recommendedSuitability; + AzureSqlMISuitabilityDetails = azureSqlMISuitabilityDetails; + AzureSqlDBSuitabilityDetails = azureSqlDBSuitabilityDetails; + AzureSqlVmSuitabilityDetails = azureSqlVmSuitabilityDetails; + StorageTypeBasedDetails = storageTypeBasedDetails; + ProductSupportStatus = productSupportStatus; + FciMetadata = fciMetadata; + AvailabilityReplicaSummary = availabilityReplicaSummary; + IsClustered = isClustered; + IsHighAvailabilityEnabled = isHighAvailabilityEnabled; + RecommendedTargetReasonings = recommendedTargetReasonings; + MachineArmId = machineArmId; + MachineName = machineName; + InstanceName = instanceName; + SqlInstanceSdsArmId = sqlInstanceSdsArmId; + SqlEdition = sqlEdition; + SqlVersion = sqlVersion; + NumberOfCoresAllocated = numberOfCoresAllocated; + PercentageCoresUtilization = percentageCoresUtilization; + LogicalDisks = logicalDisks; + DatabaseSummary = databaseSummary; + ConfidenceRatingInPercentage = confidenceRatingInPercentage; + SizingCriterion = sizingCriterion; + CreatedOn = createdOn; + UpdatedOn = updatedOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the memory used by SQL instance in megabytes. + public double? MemoryInUseInMB { get; } + /// Gets or sets a value indicating whether SQL instance has been deep discovered. + public bool? HasScanOccurred { get; } + /// Gets or sets the recommended azure SQL target type. + public MigrationAssessmentTargetType? RecommendedAzureSqlTargetType { get; } + /// Gets or sets the recommended azure SQL suitability. + public RecommendedSuitability? RecommendedSuitability { get; } + /// SQL instance azure SQL MI suitability details. + public SqlAssessmentV2PaasSuitabilityDetails AzureSqlMISuitabilityDetails { get; } + /// SQL instance azure SQL DB suitability details. + public SqlAssessmentV2PaasSuitabilityDetails AzureSqlDBSuitabilityDetails { get; } + /// SQL instance azure SQL VM suitability details. + public SqlAssessmentV2IaasSuitabilityDetails AzureSqlVmSuitabilityDetails { get; } + /// Gets the storage details. + public IReadOnlyList StorageTypeBasedDetails { get; } + /// Gets the product support status related details. + public ProductSupportStatus ProductSupportStatus { get; } + /// Gets the FCI metadata if this instance represents an FCI instance. + public SqlFciMetadata FciMetadata { get; } + /// + /// Gets the overview counts of availability replicas in the assessed instance, by + /// commit mode and read type. + /// + public SqlAvailabilityReplicaSummary AvailabilityReplicaSummary { get; } + /// Gets a value indicating whether the SQL instance is clustered or not. + public bool? IsClustered { get; } + /// Gets a value indicating whether the high availability is enabled or not. + public bool? IsHighAvailabilityEnabled { get; } + /// Gets the list of recommended target reasoning. + public IReadOnlyList RecommendedTargetReasonings { get; } + /// Machine arm id. + public ResourceIdentifier MachineArmId { get; } + /// Machine display name. + public string MachineName { get; } + /// SQL instance name. + public string InstanceName { get; } + /// SQL instance SDS arm id. + public ResourceIdentifier SqlInstanceSdsArmId { get; } + /// SQL instance edition. + public string SqlEdition { get; } + /// SQL instance version. + public string SqlVersion { get; } + /// Number of CPU cores assigned to the SQL instance. + public int? NumberOfCoresAllocated { get; } + /// The percentage of the total number of cores being utilized by the SQL instance. + public double? PercentageCoresUtilization { get; } + /// The logical disk details. + public IReadOnlyList LogicalDisks { get; } + /// The databases summary. + public AssessedSqlInstanceDatabaseSummary DatabaseSummary { get; } + /// Confidence Rating in Percentage. + public double? ConfidenceRatingInPercentage { get; } + /// Assessment sizing criterion. + public AssessmentSizingCriterion? SizingCriterion { get; } + /// When was assessed SQL instance first created. + public DateTimeOffset? CreatedOn { get; } + /// When was assessed SQL instance last updated. + public DateTimeOffset? UpdatedOn { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlInstanceV2Resource.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlInstanceV2Resource.Serialization.cs new file mode 100644 index 000000000000..b8d047045a64 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlInstanceV2Resource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class AssessedSqlInstanceV2Resource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + AssessedSqlInstanceV2Data IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + AssessedSqlInstanceV2Data IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlInstanceV2Resource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlInstanceV2Resource.cs new file mode 100644 index 000000000000..9a8fd6df203a --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlInstanceV2Resource.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A Class representing an AssessedSqlInstanceV2 along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetAssessedSqlInstanceV2Resource method. + /// Otherwise you can get one from its parent resource using the GetAssessedSqlInstanceV2 method. + /// + public partial class AssessedSqlInstanceV2Resource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The groupName. + /// The assessmentName. + /// The assessedSqlInstanceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedSqlInstanceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlInstances/{assessedSqlInstanceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsClientDiagnostics; + private readonly AssessedSqlInstanceV2RestOperations _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsRestClient; + private readonly AssessedSqlInstanceV2Data _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/groups/sqlAssessments/assessedSqlInstances"; + + /// Initializes a new instance of the class for mocking. + protected AssessedSqlInstanceV2Resource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AssessedSqlInstanceV2Resource(ArmClient client, AssessedSqlInstanceV2Data data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal AssessedSqlInstanceV2Resource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string assessedSqlInstanceV2AssessedSqlInstanceV2OperationsApiVersion); + _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsRestClient = new AssessedSqlInstanceV2RestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, assessedSqlInstanceV2AssessedSqlInstanceV2OperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual AssessedSqlInstanceV2Data Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a AssessedSqlInstanceV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlInstances/{assessedSqlInstanceName} + /// + /// + /// Operation Id + /// AssessedSqlInstanceV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsClientDiagnostics.CreateScope("AssessedSqlInstanceV2Resource.Get"); + scope.Start(); + try + { + var response = await _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AssessedSqlInstanceV2Resource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AssessedSqlInstanceV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlInstances/{assessedSqlInstanceName} + /// + /// + /// Operation Id + /// AssessedSqlInstanceV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsClientDiagnostics.CreateScope("AssessedSqlInstanceV2Resource.Get"); + scope.Start(); + try + { + var response = _assessedSqlInstanceV2AssessedSqlInstanceV2OperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AssessedSqlInstanceV2Resource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlMachineCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlMachineCollection.cs new file mode 100644 index 000000000000..297e769974e3 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlMachineCollection.cs @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetAssessedSqlMachines method from an instance of . + /// + public partial class AssessedSqlMachineCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _assessedSqlMachineAssessedSqlMachinesOperationsClientDiagnostics; + private readonly AssessedSqlMachinesRestOperations _assessedSqlMachineAssessedSqlMachinesOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected AssessedSqlMachineCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal AssessedSqlMachineCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _assessedSqlMachineAssessedSqlMachinesOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", AssessedSqlMachineResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AssessedSqlMachineResource.ResourceType, out string assessedSqlMachineAssessedSqlMachinesOperationsApiVersion); + _assessedSqlMachineAssessedSqlMachinesOperationsRestClient = new AssessedSqlMachinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, assessedSqlMachineAssessedSqlMachinesOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MigrationAssessmentSqlAssessmentV2Resource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MigrationAssessmentSqlAssessmentV2Resource.ResourceType), nameof(id)); + } + + /// + /// Get a AssessedSqlMachine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlMachines/{assessedSqlMachineName} + /// + /// + /// Operation Id + /// AssessedSqlMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string assessedSqlMachineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessedSqlMachineName, nameof(assessedSqlMachineName)); + + using var scope = _assessedSqlMachineAssessedSqlMachinesOperationsClientDiagnostics.CreateScope("AssessedSqlMachineCollection.Get"); + scope.Start(); + try + { + var response = await _assessedSqlMachineAssessedSqlMachinesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, assessedSqlMachineName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AssessedSqlMachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AssessedSqlMachine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlMachines/{assessedSqlMachineName} + /// + /// + /// Operation Id + /// AssessedSqlMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string assessedSqlMachineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessedSqlMachineName, nameof(assessedSqlMachineName)); + + using var scope = _assessedSqlMachineAssessedSqlMachinesOperationsClientDiagnostics.CreateScope("AssessedSqlMachineCollection.Get"); + scope.Start(); + try + { + var response = _assessedSqlMachineAssessedSqlMachinesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, assessedSqlMachineName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AssessedSqlMachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List AssessedSqlMachine resources by SqlAssessmentV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlMachines + /// + /// + /// Operation Id + /// AssessedSqlMachinesOperations_ListBySqlAssessmentV2 + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _assessedSqlMachineAssessedSqlMachinesOperationsRestClient.CreateListBySqlAssessmentV2Request(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _assessedSqlMachineAssessedSqlMachinesOperationsRestClient.CreateListBySqlAssessmentV2NextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AssessedSqlMachineResource(Client, AssessedSqlMachineData.DeserializeAssessedSqlMachineData(e)), _assessedSqlMachineAssessedSqlMachinesOperationsClientDiagnostics, Pipeline, "AssessedSqlMachineCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List AssessedSqlMachine resources by SqlAssessmentV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlMachines + /// + /// + /// Operation Id + /// AssessedSqlMachinesOperations_ListBySqlAssessmentV2 + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _assessedSqlMachineAssessedSqlMachinesOperationsRestClient.CreateListBySqlAssessmentV2Request(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _assessedSqlMachineAssessedSqlMachinesOperationsRestClient.CreateListBySqlAssessmentV2NextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AssessedSqlMachineResource(Client, AssessedSqlMachineData.DeserializeAssessedSqlMachineData(e)), _assessedSqlMachineAssessedSqlMachinesOperationsClientDiagnostics, Pipeline, "AssessedSqlMachineCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlMachines/{assessedSqlMachineName} + /// + /// + /// Operation Id + /// AssessedSqlMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string assessedSqlMachineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessedSqlMachineName, nameof(assessedSqlMachineName)); + + using var scope = _assessedSqlMachineAssessedSqlMachinesOperationsClientDiagnostics.CreateScope("AssessedSqlMachineCollection.Exists"); + scope.Start(); + try + { + var response = await _assessedSqlMachineAssessedSqlMachinesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, assessedSqlMachineName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlMachines/{assessedSqlMachineName} + /// + /// + /// Operation Id + /// AssessedSqlMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string assessedSqlMachineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessedSqlMachineName, nameof(assessedSqlMachineName)); + + using var scope = _assessedSqlMachineAssessedSqlMachinesOperationsClientDiagnostics.CreateScope("AssessedSqlMachineCollection.Exists"); + scope.Start(); + try + { + var response = _assessedSqlMachineAssessedSqlMachinesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, assessedSqlMachineName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlMachines/{assessedSqlMachineName} + /// + /// + /// Operation Id + /// AssessedSqlMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string assessedSqlMachineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessedSqlMachineName, nameof(assessedSqlMachineName)); + + using var scope = _assessedSqlMachineAssessedSqlMachinesOperationsClientDiagnostics.CreateScope("AssessedSqlMachineCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _assessedSqlMachineAssessedSqlMachinesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, assessedSqlMachineName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AssessedSqlMachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlMachines/{assessedSqlMachineName} + /// + /// + /// Operation Id + /// AssessedSqlMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string assessedSqlMachineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessedSqlMachineName, nameof(assessedSqlMachineName)); + + using var scope = _assessedSqlMachineAssessedSqlMachinesOperationsClientDiagnostics.CreateScope("AssessedSqlMachineCollection.GetIfExists"); + scope.Start(); + try + { + var response = _assessedSqlMachineAssessedSqlMachinesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, assessedSqlMachineName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AssessedSqlMachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlMachineData.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlMachineData.Serialization.cs new file mode 100644 index 000000000000..7da4a88143c9 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlMachineData.Serialization.cs @@ -0,0 +1,782 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class AssessedSqlMachineData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedSqlMachineData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(BiosGuid)) + { + writer.WritePropertyName("biosGuid"u8); + writer.WriteStringValue(BiosGuid); + } + if (options.Format != "W" && Optional.IsDefined(Fqdn)) + { + writer.WritePropertyName("fqdn"u8); + writer.WriteStringValue(Fqdn); + } + if (options.Format != "W" && Optional.IsCollectionDefined(SqlInstances)) + { + writer.WritePropertyName("sqlInstances"u8); + writer.WriteStartArray(); + foreach (var item in SqlInstances) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(SuitabilityDetail)) + { + writer.WritePropertyName("suitabilityDetail"u8); + writer.WriteStringValue(SuitabilityDetail.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(SuitabilityExplanation)) + { + writer.WritePropertyName("suitabilityExplanation"u8); + writer.WriteStringValue(SuitabilityExplanation.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(RecommendedVmSize)) + { + writer.WritePropertyName("recommendedVmSize"u8); + writer.WriteStringValue(RecommendedVmSize.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(RecommendedVmFamily)) + { + writer.WritePropertyName("recommendedVmFamily"u8); + writer.WriteStringValue(RecommendedVmFamily.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProductSupportStatus)) + { + writer.WritePropertyName("productSupportStatus"u8); + writer.WriteObjectValue(ProductSupportStatus, options); + } + if (options.Format != "W" && Optional.IsDefined(RecommendedVmSizeNumberOfCores)) + { + writer.WritePropertyName("recommendedVmSizeNumberOfCores"u8); + writer.WriteNumberValue(RecommendedVmSizeNumberOfCores.Value); + } + if (options.Format != "W" && Optional.IsDefined(RecommendedVmSizeMegabytesOfMemory)) + { + writer.WritePropertyName("recommendedVmSizeMegabytesOfMemory"u8); + writer.WriteNumberValue(RecommendedVmSizeMegabytesOfMemory.Value); + } + if (options.Format != "W" && Optional.IsDefined(MonthlyComputeCost)) + { + writer.WritePropertyName("monthlyComputeCost"u8); + writer.WriteNumberValue(MonthlyComputeCost.Value); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Disks)) + { + writer.WritePropertyName("disks"u8); + writer.WriteStartObject(); + foreach (var item in Disks) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(NetworkAdapters)) + { + writer.WritePropertyName("networkAdapters"u8); + writer.WriteStartObject(); + foreach (var item in NetworkAdapters) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsDefined(MonthlyBandwidthCost)) + { + writer.WritePropertyName("monthlyBandwidthCost"u8); + writer.WriteNumberValue(MonthlyBandwidthCost.Value); + } + if (options.Format != "W" && Optional.IsDefined(MonthlyStorageCost)) + { + writer.WritePropertyName("monthlyStorageCost"u8); + writer.WriteNumberValue(MonthlyStorageCost.Value); + } + if (Optional.IsCollectionDefined(CostComponents)) + { + writer.WritePropertyName("costComponents"u8); + writer.WriteStartArray(); + foreach (var item in CostComponents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(SecuritySuitability)) + { + writer.WritePropertyName("securitySuitability"u8); + writer.WriteStringValue(SecuritySuitability.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(MigrationGuidelines)) + { + writer.WritePropertyName("migrationGuidelines"u8); + writer.WriteStartArray(); + foreach (var item in MigrationGuidelines) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(BootType)) + { + writer.WritePropertyName("bootType"u8); + writer.WriteStringValue(BootType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(OperatingSystemType)) + { + writer.WritePropertyName("operatingSystemType"u8); + writer.WriteStringValue(OperatingSystemType); + } + if (options.Format != "W" && Optional.IsDefined(OperatingSystemName)) + { + writer.WritePropertyName("operatingSystemName"u8); + writer.WriteStringValue(OperatingSystemName); + } + if (options.Format != "W" && Optional.IsDefined(OperatingSystemVersion)) + { + writer.WritePropertyName("operatingSystemVersion"u8); + writer.WriteStringValue(OperatingSystemVersion); + } + if (options.Format != "W" && Optional.IsDefined(OperatingSystemArchitecture)) + { + writer.WritePropertyName("operatingSystemArchitecture"u8); + writer.WriteStringValue(OperatingSystemArchitecture.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("createdTimestamp"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(UpdatedOn)) + { + writer.WritePropertyName("updatedTimestamp"u8); + writer.WriteStringValue(UpdatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (options.Format != "W" && Optional.IsDefined(TypePropertiesType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(TypePropertiesType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && Optional.IsDefined(DatacenterMachineArmId)) + { + writer.WritePropertyName("datacenterMachineArmId"u8); + writer.WriteStringValue(DatacenterMachineArmId); + } + if (options.Format != "W" && Optional.IsDefined(DatacenterManagementServerArmId)) + { + writer.WritePropertyName("datacenterManagementServerArmId"u8); + writer.WriteStringValue(DatacenterManagementServerArmId); + } + if (options.Format != "W" && Optional.IsDefined(DatacenterManagementServerName)) + { + writer.WritePropertyName("datacenterManagementServerName"u8); + writer.WriteStringValue(DatacenterManagementServerName); + } + if (options.Format != "W" && Optional.IsDefined(MegabytesOfMemory)) + { + writer.WritePropertyName("megabytesOfMemory"u8); + writer.WriteNumberValue(MegabytesOfMemory.Value); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfCores)) + { + writer.WritePropertyName("numberOfCores"u8); + writer.WriteNumberValue(NumberOfCores.Value); + } + if (options.Format != "W" && Optional.IsDefined(ConfidenceRatingInPercentage)) + { + writer.WritePropertyName("confidenceRatingInPercentage"u8); + writer.WriteNumberValue(ConfidenceRatingInPercentage.Value); + } + if (options.Format != "W" && Optional.IsDefined(PercentageCoresUtilization)) + { + writer.WritePropertyName("percentageCoresUtilization"u8); + writer.WriteNumberValue(PercentageCoresUtilization.Value); + } + if (options.Format != "W" && Optional.IsDefined(PercentageMemoryUtilization)) + { + writer.WritePropertyName("percentageMemoryUtilization"u8); + writer.WriteNumberValue(PercentageMemoryUtilization.Value); + } + if (options.Format != "W" && Optional.IsDefined(Suitability)) + { + writer.WritePropertyName("suitability"u8); + writer.WriteStringValue(Suitability.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(SizingCriterion)) + { + writer.WritePropertyName("sizingCriterion"u8); + writer.WriteStringValue(SizingCriterion.Value.ToString()); + } + writer.WriteEndObject(); + } + + AssessedSqlMachineData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedSqlMachineData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssessedSqlMachineData(document.RootElement, options); + } + + internal static AssessedSqlMachineData DeserializeAssessedSqlMachineData(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; + string biosGuid = default; + string fqdn = default; + IReadOnlyList sqlInstances = default; + AzureVmSuitabilityDetail? suitabilityDetail = default; + AzureVmSuitabilityExplanation? suitabilityExplanation = default; + AzureVmSize? recommendedVmSize = default; + AzureVmFamily? recommendedVmFamily = default; + ProductSupportStatus productSupportStatus = default; + int? recommendedVmSizeNumberOfCores = default; + double? recommendedVmSizeMegabytesOfMemory = default; + double? monthlyComputeCost = default; + IReadOnlyDictionary disks = default; + IReadOnlyDictionary networkAdapters = default; + double? monthlyBandwidthCost = default; + double? monthlyStorageCost = default; + IList costComponents = default; + MigrationAssessmentCloudSuitability? securitySuitability = default; + IReadOnlyList migrationGuidelines = default; + MachineBootType? bootType = default; + string operatingSystemType = default; + string operatingSystemName = default; + string operatingSystemVersion = default; + GuestOperatingSystemArchitecture? operatingSystemArchitecture = default; + DateTimeOffset? createdTimestamp = default; + DateTimeOffset? updatedTimestamp = default; + string displayName = default; + AssessedMachineType? type0 = default; + string description = default; + ResourceIdentifier datacenterMachineArmId = default; + ResourceIdentifier datacenterManagementServerArmId = default; + string datacenterManagementServerName = default; + double? megabytesOfMemory = default; + int? numberOfCores = default; + double? confidenceRatingInPercentage = default; + double? percentageCoresUtilization = default; + double? percentageMemoryUtilization = default; + MigrationAssessmentCloudSuitability? suitability = default; + AssessmentSizingCriterion? sizingCriterion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(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("biosGuid"u8)) + { + biosGuid = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("fqdn"u8)) + { + fqdn = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("sqlInstances"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(AssessedSqlInstanceSummary.DeserializeAssessedSqlInstanceSummary(item, options)); + } + sqlInstances = array; + continue; + } + if (property0.NameEquals("suitabilityDetail"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitabilityDetail = new AzureVmSuitabilityDetail(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("suitabilityExplanation"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitabilityExplanation = new AzureVmSuitabilityExplanation(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("recommendedVmSize"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendedVmSize = new AzureVmSize(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("recommendedVmFamily"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendedVmFamily = new AzureVmFamily(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("productSupportStatus"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + productSupportStatus = ProductSupportStatus.DeserializeProductSupportStatus(property0.Value, options); + continue; + } + if (property0.NameEquals("recommendedVmSizeNumberOfCores"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendedVmSizeNumberOfCores = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("recommendedVmSizeMegabytesOfMemory"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendedVmSizeMegabytesOfMemory = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("monthlyComputeCost"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyComputeCost = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("disks"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, AssessedDataDisk.DeserializeAssessedDataDisk(property1.Value, options)); + } + disks = dictionary; + continue; + } + if (property0.NameEquals("networkAdapters"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, SqlAssessedNetworkAdapter.DeserializeSqlAssessedNetworkAdapter(property1.Value, options)); + } + networkAdapters = dictionary; + continue; + } + if (property0.NameEquals("monthlyBandwidthCost"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyBandwidthCost = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("monthlyStorageCost"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyStorageCost = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("costComponents"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(CostComponent.DeserializeCostComponent(item, options)); + } + costComponents = array; + continue; + } + if (property0.NameEquals("securitySuitability"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securitySuitability = new MigrationAssessmentCloudSuitability(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("migrationGuidelines"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(SqlMigrationGuideline.DeserializeSqlMigrationGuideline(item, options)); + } + migrationGuidelines = array; + continue; + } + if (property0.NameEquals("bootType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bootType = new MachineBootType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("operatingSystemType"u8)) + { + operatingSystemType = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("operatingSystemName"u8)) + { + operatingSystemName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("operatingSystemVersion"u8)) + { + operatingSystemVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("operatingSystemArchitecture"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + operatingSystemArchitecture = new GuestOperatingSystemArchitecture(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("createdTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("updatedTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("displayName"u8)) + { + displayName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("type"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type0 = new AssessedMachineType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("description"u8)) + { + description = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("datacenterMachineArmId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + datacenterMachineArmId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("datacenterManagementServerArmId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + datacenterManagementServerArmId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("datacenterManagementServerName"u8)) + { + datacenterManagementServerName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("megabytesOfMemory"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + megabytesOfMemory = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("numberOfCores"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfCores = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("confidenceRatingInPercentage"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + confidenceRatingInPercentage = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("percentageCoresUtilization"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + percentageCoresUtilization = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("percentageMemoryUtilization"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + percentageMemoryUtilization = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("suitability"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitability = new MigrationAssessmentCloudSuitability(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("sizingCriterion"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sizingCriterion = new AssessmentSizingCriterion(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssessedSqlMachineData( + id, + name, + type, + systemData, + biosGuid, + fqdn, + sqlInstances ?? new ChangeTrackingList(), + suitabilityDetail, + suitabilityExplanation, + recommendedVmSize, + recommendedVmFamily, + productSupportStatus, + recommendedVmSizeNumberOfCores, + recommendedVmSizeMegabytesOfMemory, + monthlyComputeCost, + disks ?? new ChangeTrackingDictionary(), + networkAdapters ?? new ChangeTrackingDictionary(), + monthlyBandwidthCost, + monthlyStorageCost, + costComponents ?? new ChangeTrackingList(), + securitySuitability, + migrationGuidelines ?? new ChangeTrackingList(), + bootType, + operatingSystemType, + operatingSystemName, + operatingSystemVersion, + operatingSystemArchitecture, + createdTimestamp, + updatedTimestamp, + displayName, + type0, + description, + datacenterMachineArmId, + datacenterManagementServerArmId, + datacenterManagementServerName, + megabytesOfMemory, + numberOfCores, + confidenceRatingInPercentage, + percentageCoresUtilization, + percentageMemoryUtilization, + suitability, + sizingCriterion, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssessedSqlMachineData)} does not support writing '{options.Format}' format."); + } + } + + AssessedSqlMachineData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssessedSqlMachineData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssessedSqlMachineData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlMachineData.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlMachineData.cs new file mode 100644 index 000000000000..4ad9c8a8ae5f --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlMachineData.cs @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing the AssessedSqlMachine data model. + /// SQL Assessment REST resource. + /// + public partial class AssessedSqlMachineData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AssessedSqlMachineData() + { + SqlInstances = new ChangeTrackingList(); + Disks = new ChangeTrackingDictionary(); + NetworkAdapters = new ChangeTrackingDictionary(); + CostComponents = new ChangeTrackingList(); + MigrationGuidelines = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets or sets the BIOS GUID for the machine. + /// Gets or sets the FQDN for the machine. + /// Gets the list of SQL instances discovered on the machine. + /// + /// Gets or sets the detailed messages that were set on the machine during + /// evaluation. + /// + /// Gets or sets the explanation if machine is not suitable for cloud. + /// Gets or sets the Recommended Azure Size for the machine. + /// Gets or sets the Recommended Azure VM Family for the machine. + /// Gets the product support status related details. + /// Gets or sets the Number of cores for recommended size. + /// Gets or sets the Megabytes of memory for recommended size. + /// Gets or sets the monthly compute cost calculated for recommended size. + /// Gets the list of data disks that were assessed as part of this assessment. + /// Gets the list of network adapters that were assessed as part of this assessment. + /// Gets or sets the monthly networking cost. + /// Gets or sets the monthly total storage cost. + /// Gets the collection of cost components. + /// Gets the suitability for Microsoft cloud defender. + /// Gets the list of migration guidelines applicable. + /// Boot type of machine discovered in private data center. + /// Operating system as reported by datacenter management solution. + /// Operating system as reported by datacenter management solution. + /// Operating system version as reported by datacenter management solution. + /// Operating system architecture as reported by datacenter management solution. + /// When was machine first created. + /// When was machine last updated. + /// Display Name of the Machine. + /// Assessed machine type. + /// Description for the machine. + /// Data center machine ARM id. + /// Data center management server ARM id. + /// Data center management server name. + /// Megabytes of memory found allocated for the machine in private data center. + /// Number of CPU cores found on the machine. + /// Confidence Rating in Percentage. + /// + /// Percentile of Percentage of Cores Utilized noted during time period T. + /// + /// Here N and T are settings on Assessment. + /// + /// + /// Percentile of Percentage of Memory Utilized noted during time period T. + /// + /// Here N and T are settings on Assessment. + /// + /// + /// Gets a value indicating whether machine is suitable for the cloud platform + /// selected. + /// + /// Assessment sizing criterion. + /// Keeps track of any properties unknown to the library. + internal AssessedSqlMachineData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string biosGuid, string fqdn, IReadOnlyList sqlInstances, AzureVmSuitabilityDetail? suitabilityDetail, AzureVmSuitabilityExplanation? suitabilityExplanation, AzureVmSize? recommendedVmSize, AzureVmFamily? recommendedVmFamily, ProductSupportStatus productSupportStatus, int? recommendedVmSizeNumberOfCores, double? recommendedVmSizeMegabytesOfMemory, double? monthlyComputeCost, IReadOnlyDictionary disks, IReadOnlyDictionary networkAdapters, double? monthlyBandwidthCost, double? monthlyStorageCost, IList costComponents, MigrationAssessmentCloudSuitability? securitySuitability, IReadOnlyList migrationGuidelines, MachineBootType? bootType, string operatingSystemType, string operatingSystemName, string operatingSystemVersion, GuestOperatingSystemArchitecture? operatingSystemArchitecture, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, string displayName, AssessedMachineType? typePropertiesType, string description, ResourceIdentifier datacenterMachineArmId, ResourceIdentifier datacenterManagementServerArmId, string datacenterManagementServerName, double? megabytesOfMemory, int? numberOfCores, double? confidenceRatingInPercentage, double? percentageCoresUtilization, double? percentageMemoryUtilization, MigrationAssessmentCloudSuitability? suitability, AssessmentSizingCriterion? sizingCriterion, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + BiosGuid = biosGuid; + Fqdn = fqdn; + SqlInstances = sqlInstances; + SuitabilityDetail = suitabilityDetail; + SuitabilityExplanation = suitabilityExplanation; + RecommendedVmSize = recommendedVmSize; + RecommendedVmFamily = recommendedVmFamily; + ProductSupportStatus = productSupportStatus; + RecommendedVmSizeNumberOfCores = recommendedVmSizeNumberOfCores; + RecommendedVmSizeMegabytesOfMemory = recommendedVmSizeMegabytesOfMemory; + MonthlyComputeCost = monthlyComputeCost; + Disks = disks; + NetworkAdapters = networkAdapters; + MonthlyBandwidthCost = monthlyBandwidthCost; + MonthlyStorageCost = monthlyStorageCost; + CostComponents = costComponents; + SecuritySuitability = securitySuitability; + MigrationGuidelines = migrationGuidelines; + BootType = bootType; + OperatingSystemType = operatingSystemType; + OperatingSystemName = operatingSystemName; + OperatingSystemVersion = operatingSystemVersion; + OperatingSystemArchitecture = operatingSystemArchitecture; + CreatedOn = createdOn; + UpdatedOn = updatedOn; + DisplayName = displayName; + TypePropertiesType = typePropertiesType; + Description = description; + DatacenterMachineArmId = datacenterMachineArmId; + DatacenterManagementServerArmId = datacenterManagementServerArmId; + DatacenterManagementServerName = datacenterManagementServerName; + MegabytesOfMemory = megabytesOfMemory; + NumberOfCores = numberOfCores; + ConfidenceRatingInPercentage = confidenceRatingInPercentage; + PercentageCoresUtilization = percentageCoresUtilization; + PercentageMemoryUtilization = percentageMemoryUtilization; + Suitability = suitability; + SizingCriterion = sizingCriterion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the BIOS GUID for the machine. + public string BiosGuid { get; } + /// Gets or sets the FQDN for the machine. + public string Fqdn { get; } + /// Gets the list of SQL instances discovered on the machine. + public IReadOnlyList SqlInstances { get; } + /// + /// Gets or sets the detailed messages that were set on the machine during + /// evaluation. + /// + public AzureVmSuitabilityDetail? SuitabilityDetail { get; } + /// Gets or sets the explanation if machine is not suitable for cloud. + public AzureVmSuitabilityExplanation? SuitabilityExplanation { get; } + /// Gets or sets the Recommended Azure Size for the machine. + public AzureVmSize? RecommendedVmSize { get; } + /// Gets or sets the Recommended Azure VM Family for the machine. + public AzureVmFamily? RecommendedVmFamily { get; } + /// Gets the product support status related details. + public ProductSupportStatus ProductSupportStatus { get; } + /// Gets or sets the Number of cores for recommended size. + public int? RecommendedVmSizeNumberOfCores { get; } + /// Gets or sets the Megabytes of memory for recommended size. + public double? RecommendedVmSizeMegabytesOfMemory { get; } + /// Gets or sets the monthly compute cost calculated for recommended size. + public double? MonthlyComputeCost { get; } + /// Gets the list of data disks that were assessed as part of this assessment. + public IReadOnlyDictionary Disks { get; } + /// Gets the list of network adapters that were assessed as part of this assessment. + public IReadOnlyDictionary NetworkAdapters { get; } + /// Gets or sets the monthly networking cost. + public double? MonthlyBandwidthCost { get; } + /// Gets or sets the monthly total storage cost. + public double? MonthlyStorageCost { get; } + /// Gets the collection of cost components. + public IList CostComponents { get; } + /// Gets the suitability for Microsoft cloud defender. + public MigrationAssessmentCloudSuitability? SecuritySuitability { get; } + /// Gets the list of migration guidelines applicable. + public IReadOnlyList MigrationGuidelines { get; } + /// Boot type of machine discovered in private data center. + public MachineBootType? BootType { get; } + /// Operating system as reported by datacenter management solution. + public string OperatingSystemType { get; } + /// Operating system as reported by datacenter management solution. + public string OperatingSystemName { get; } + /// Operating system version as reported by datacenter management solution. + public string OperatingSystemVersion { get; } + /// Operating system architecture as reported by datacenter management solution. + public GuestOperatingSystemArchitecture? OperatingSystemArchitecture { get; } + /// When was machine first created. + public DateTimeOffset? CreatedOn { get; } + /// When was machine last updated. + public DateTimeOffset? UpdatedOn { get; } + /// Display Name of the Machine. + public string DisplayName { get; } + /// Assessed machine type. + public AssessedMachineType? TypePropertiesType { get; } + /// Description for the machine. + public string Description { get; } + /// Data center machine ARM id. + public ResourceIdentifier DatacenterMachineArmId { get; } + /// Data center management server ARM id. + public ResourceIdentifier DatacenterManagementServerArmId { get; } + /// Data center management server name. + public string DatacenterManagementServerName { get; } + /// Megabytes of memory found allocated for the machine in private data center. + public double? MegabytesOfMemory { get; } + /// Number of CPU cores found on the machine. + public int? NumberOfCores { get; } + /// Confidence Rating in Percentage. + public double? ConfidenceRatingInPercentage { get; } + /// + /// Percentile of Percentage of Cores Utilized noted during time period T. + /// + /// Here N and T are settings on Assessment. + /// + public double? PercentageCoresUtilization { get; } + /// + /// Percentile of Percentage of Memory Utilized noted during time period T. + /// + /// Here N and T are settings on Assessment. + /// + public double? PercentageMemoryUtilization { get; } + /// + /// Gets a value indicating whether machine is suitable for the cloud platform + /// selected. + /// + public MigrationAssessmentCloudSuitability? Suitability { get; } + /// Assessment sizing criterion. + public AssessmentSizingCriterion? SizingCriterion { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlMachineResource.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlMachineResource.Serialization.cs new file mode 100644 index 000000000000..c2995667eda7 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlMachineResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class AssessedSqlMachineResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + AssessedSqlMachineData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + AssessedSqlMachineData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlMachineResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlMachineResource.cs new file mode 100644 index 000000000000..e19b46ac5554 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlMachineResource.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A Class representing an AssessedSqlMachine along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetAssessedSqlMachineResource method. + /// Otherwise you can get one from its parent resource using the GetAssessedSqlMachine method. + /// + public partial class AssessedSqlMachineResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The groupName. + /// The assessmentName. + /// The assessedSqlMachineName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedSqlMachineName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlMachines/{assessedSqlMachineName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _assessedSqlMachineAssessedSqlMachinesOperationsClientDiagnostics; + private readonly AssessedSqlMachinesRestOperations _assessedSqlMachineAssessedSqlMachinesOperationsRestClient; + private readonly AssessedSqlMachineData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/groups/sqlAssessments/assessedSqlMachines"; + + /// Initializes a new instance of the class for mocking. + protected AssessedSqlMachineResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AssessedSqlMachineResource(ArmClient client, AssessedSqlMachineData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal AssessedSqlMachineResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _assessedSqlMachineAssessedSqlMachinesOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string assessedSqlMachineAssessedSqlMachinesOperationsApiVersion); + _assessedSqlMachineAssessedSqlMachinesOperationsRestClient = new AssessedSqlMachinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, assessedSqlMachineAssessedSqlMachinesOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual AssessedSqlMachineData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a AssessedSqlMachine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlMachines/{assessedSqlMachineName} + /// + /// + /// Operation Id + /// AssessedSqlMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _assessedSqlMachineAssessedSqlMachinesOperationsClientDiagnostics.CreateScope("AssessedSqlMachineResource.Get"); + scope.Start(); + try + { + var response = await _assessedSqlMachineAssessedSqlMachinesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AssessedSqlMachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AssessedSqlMachine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlMachines/{assessedSqlMachineName} + /// + /// + /// Operation Id + /// AssessedSqlMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _assessedSqlMachineAssessedSqlMachinesOperationsClientDiagnostics.CreateScope("AssessedSqlMachineResource.Get"); + scope.Start(); + try + { + var response = _assessedSqlMachineAssessedSqlMachinesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AssessedSqlMachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlRecommendedEntityCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlRecommendedEntityCollection.cs new file mode 100644 index 000000000000..25cb056700d2 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlRecommendedEntityCollection.cs @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetAssessedSqlRecommendedEntities method from an instance of . + /// + public partial class AssessedSqlRecommendedEntityCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsClientDiagnostics; + private readonly AssessedSqlRecommendedEntityRestOperations _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected AssessedSqlRecommendedEntityCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal AssessedSqlRecommendedEntityCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", AssessedSqlRecommendedEntityResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AssessedSqlRecommendedEntityResource.ResourceType, out string assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsApiVersion); + _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsRestClient = new AssessedSqlRecommendedEntityRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MigrationAssessmentSqlAssessmentV2Resource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MigrationAssessmentSqlAssessmentV2Resource.ResourceType), nameof(id)); + } + + /// + /// Get a AssessedSqlRecommendedEntity + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/recommendedAssessedEntities/{recommendedAssessedEntityName} + /// + /// + /// Operation Id + /// AssessedSqlRecommendedEntityOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Recommended Entity ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string recommendedAssessedEntityName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recommendedAssessedEntityName, nameof(recommendedAssessedEntityName)); + + using var scope = _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsClientDiagnostics.CreateScope("AssessedSqlRecommendedEntityCollection.Get"); + scope.Start(); + try + { + var response = await _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, recommendedAssessedEntityName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AssessedSqlRecommendedEntityResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AssessedSqlRecommendedEntity + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/recommendedAssessedEntities/{recommendedAssessedEntityName} + /// + /// + /// Operation Id + /// AssessedSqlRecommendedEntityOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Recommended Entity ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string recommendedAssessedEntityName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recommendedAssessedEntityName, nameof(recommendedAssessedEntityName)); + + using var scope = _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsClientDiagnostics.CreateScope("AssessedSqlRecommendedEntityCollection.Get"); + scope.Start(); + try + { + var response = _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, recommendedAssessedEntityName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AssessedSqlRecommendedEntityResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List AssessedSqlRecommendedEntity resources by SqlAssessmentV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/recommendedAssessedEntities + /// + /// + /// Operation Id + /// AssessedSqlRecommendedEntityOperations_ListBySqlAssessmentV2 + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsRestClient.CreateListBySqlAssessmentV2Request(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsRestClient.CreateListBySqlAssessmentV2NextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AssessedSqlRecommendedEntityResource(Client, AssessedSqlRecommendedEntityData.DeserializeAssessedSqlRecommendedEntityData(e)), _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsClientDiagnostics, Pipeline, "AssessedSqlRecommendedEntityCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List AssessedSqlRecommendedEntity resources by SqlAssessmentV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/recommendedAssessedEntities + /// + /// + /// Operation Id + /// AssessedSqlRecommendedEntityOperations_ListBySqlAssessmentV2 + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsRestClient.CreateListBySqlAssessmentV2Request(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsRestClient.CreateListBySqlAssessmentV2NextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AssessedSqlRecommendedEntityResource(Client, AssessedSqlRecommendedEntityData.DeserializeAssessedSqlRecommendedEntityData(e)), _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsClientDiagnostics, Pipeline, "AssessedSqlRecommendedEntityCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/recommendedAssessedEntities/{recommendedAssessedEntityName} + /// + /// + /// Operation Id + /// AssessedSqlRecommendedEntityOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Recommended Entity ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string recommendedAssessedEntityName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recommendedAssessedEntityName, nameof(recommendedAssessedEntityName)); + + using var scope = _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsClientDiagnostics.CreateScope("AssessedSqlRecommendedEntityCollection.Exists"); + scope.Start(); + try + { + var response = await _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, recommendedAssessedEntityName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/recommendedAssessedEntities/{recommendedAssessedEntityName} + /// + /// + /// Operation Id + /// AssessedSqlRecommendedEntityOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Recommended Entity ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string recommendedAssessedEntityName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recommendedAssessedEntityName, nameof(recommendedAssessedEntityName)); + + using var scope = _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsClientDiagnostics.CreateScope("AssessedSqlRecommendedEntityCollection.Exists"); + scope.Start(); + try + { + var response = _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, recommendedAssessedEntityName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/recommendedAssessedEntities/{recommendedAssessedEntityName} + /// + /// + /// Operation Id + /// AssessedSqlRecommendedEntityOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Recommended Entity ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string recommendedAssessedEntityName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recommendedAssessedEntityName, nameof(recommendedAssessedEntityName)); + + using var scope = _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsClientDiagnostics.CreateScope("AssessedSqlRecommendedEntityCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, recommendedAssessedEntityName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AssessedSqlRecommendedEntityResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/recommendedAssessedEntities/{recommendedAssessedEntityName} + /// + /// + /// Operation Id + /// AssessedSqlRecommendedEntityOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Recommended Entity ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string recommendedAssessedEntityName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recommendedAssessedEntityName, nameof(recommendedAssessedEntityName)); + + using var scope = _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsClientDiagnostics.CreateScope("AssessedSqlRecommendedEntityCollection.GetIfExists"); + scope.Start(); + try + { + var response = _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, recommendedAssessedEntityName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AssessedSqlRecommendedEntityResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlRecommendedEntityData.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlRecommendedEntityData.Serialization.cs new file mode 100644 index 000000000000..0b08ee584476 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlRecommendedEntityData.Serialization.cs @@ -0,0 +1,410 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class AssessedSqlRecommendedEntityData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedSqlRecommendedEntityData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(MachineName)) + { + writer.WritePropertyName("machineName"u8); + writer.WriteStringValue(MachineName); + } + if (options.Format != "W" && Optional.IsDefined(InstanceName)) + { + writer.WritePropertyName("instanceName"u8); + writer.WriteStringValue(InstanceName); + } + if (options.Format != "W" && Optional.IsDefined(ProductSupportStatus)) + { + writer.WritePropertyName("productSupportStatus"u8); + writer.WriteObjectValue(ProductSupportStatus, options); + } + if (options.Format != "W" && Optional.IsDefined(DBCount)) + { + writer.WritePropertyName("dbCount"u8); + writer.WriteNumberValue(DBCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(DiscoveredDBCount)) + { + writer.WritePropertyName("discoveredDBCount"u8); + writer.WriteNumberValue(DiscoveredDBCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(HasScanOccurred)) + { + writer.WritePropertyName("hasScanOccurred"u8); + writer.WriteBooleanValue(HasScanOccurred.Value); + } + if (options.Format != "W" && Optional.IsDefined(RecommendedAzureSqlTargetType)) + { + writer.WritePropertyName("recommendedAzureSqlTargetType"u8); + writer.WriteStringValue(RecommendedAzureSqlTargetType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(RecommendedSuitability)) + { + writer.WritePropertyName("recommendedSuitability"u8); + writer.WriteStringValue(RecommendedSuitability.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(AzureSqlMISuitabilityDetails)) + { + writer.WritePropertyName("azureSqlMISuitabilityDetails"u8); + writer.WriteObjectValue(AzureSqlMISuitabilityDetails, options); + } + if (options.Format != "W" && Optional.IsDefined(AzureSqlDBSuitabilityDetails)) + { + writer.WritePropertyName("azureSqlDBSuitabilityDetails"u8); + writer.WriteObjectValue(AzureSqlDBSuitabilityDetails, options); + } + if (options.Format != "W" && Optional.IsDefined(AzureSqlVmSuitabilityDetails)) + { + writer.WritePropertyName("azureSqlVMSuitabilityDetails"u8); + writer.WriteObjectValue(AzureSqlVmSuitabilityDetails, options); + } + if (Optional.IsDefined(AssessedSqlEntityArmId)) + { + writer.WritePropertyName("assessedSqlEntityArmId"u8); + writer.WriteStringValue(AssessedSqlEntityArmId); + } + if (options.Format != "W" && Optional.IsDefined(IsClustered)) + { + writer.WritePropertyName("isClustered"u8); + writer.WriteBooleanValue(IsClustered.Value); + } + if (options.Format != "W" && Optional.IsDefined(IsHighAvailabilityEnabled)) + { + writer.WritePropertyName("isHighAvailabilityEnabled"u8); + writer.WriteBooleanValue(IsHighAvailabilityEnabled.Value); + } + if (options.Format != "W" && Optional.IsDefined(SqlEdition)) + { + writer.WritePropertyName("sqlEdition"u8); + writer.WriteStringValue(SqlEdition); + } + if (options.Format != "W" && Optional.IsDefined(SqlVersion)) + { + writer.WritePropertyName("sqlVersion"u8); + writer.WriteStringValue(SqlVersion); + } + if (options.Format != "W" && Optional.IsDefined(SizingCriterion)) + { + writer.WritePropertyName("sizingCriterion"u8); + writer.WriteStringValue(SizingCriterion.Value.ToString()); + } + writer.WriteEndObject(); + } + + AssessedSqlRecommendedEntityData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedSqlRecommendedEntityData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssessedSqlRecommendedEntityData(document.RootElement, options); + } + + internal static AssessedSqlRecommendedEntityData DeserializeAssessedSqlRecommendedEntityData(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; + string machineName = default; + string instanceName = default; + ProductSupportStatus productSupportStatus = default; + int? dbCount = default; + int? discoveredDBCount = default; + bool? hasScanOccurred = default; + MigrationAssessmentTargetType? recommendedAzureSqlTargetType = default; + RecommendedSuitability? recommendedSuitability = default; + SqlAssessmentV2PaasSuitabilityDetails azureSqlMISuitabilityDetails = default; + SqlAssessmentV2PaasSuitabilityDetails azureSqlDBSuitabilityDetails = default; + SqlAssessmentV2IaasSuitabilityDetails azureSqlVmSuitabilityDetails = default; + ResourceIdentifier assessedSqlEntityArmId = default; + bool? isClustered = default; + bool? isHighAvailabilityEnabled = default; + string sqlEdition = default; + string sqlVersion = default; + AssessmentSizingCriterion? sizingCriterion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(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("machineName"u8)) + { + machineName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("instanceName"u8)) + { + instanceName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("productSupportStatus"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + productSupportStatus = ProductSupportStatus.DeserializeProductSupportStatus(property0.Value, options); + continue; + } + if (property0.NameEquals("dbCount"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dbCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("discoveredDBCount"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + discoveredDBCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("hasScanOccurred"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hasScanOccurred = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("recommendedAzureSqlTargetType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendedAzureSqlTargetType = new MigrationAssessmentTargetType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("recommendedSuitability"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendedSuitability = new RecommendedSuitability(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("azureSqlMISuitabilityDetails"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSqlMISuitabilityDetails = SqlAssessmentV2PaasSuitabilityDetails.DeserializeSqlAssessmentV2PaasSuitabilityDetails(property0.Value, options); + continue; + } + if (property0.NameEquals("azureSqlDBSuitabilityDetails"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSqlDBSuitabilityDetails = SqlAssessmentV2PaasSuitabilityDetails.DeserializeSqlAssessmentV2PaasSuitabilityDetails(property0.Value, options); + continue; + } + if (property0.NameEquals("azureSqlVMSuitabilityDetails"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSqlVmSuitabilityDetails = SqlAssessmentV2IaasSuitabilityDetails.DeserializeSqlAssessmentV2IaasSuitabilityDetails(property0.Value, options); + continue; + } + if (property0.NameEquals("assessedSqlEntityArmId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assessedSqlEntityArmId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("isClustered"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isClustered = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("isHighAvailabilityEnabled"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isHighAvailabilityEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("sqlEdition"u8)) + { + sqlEdition = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("sqlVersion"u8)) + { + sqlVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("sizingCriterion"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sizingCriterion = new AssessmentSizingCriterion(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssessedSqlRecommendedEntityData( + id, + name, + type, + systemData, + machineName, + instanceName, + productSupportStatus, + dbCount, + discoveredDBCount, + hasScanOccurred, + recommendedAzureSqlTargetType, + recommendedSuitability, + azureSqlMISuitabilityDetails, + azureSqlDBSuitabilityDetails, + azureSqlVmSuitabilityDetails, + assessedSqlEntityArmId, + isClustered, + isHighAvailabilityEnabled, + sqlEdition, + sqlVersion, + sizingCriterion, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssessedSqlRecommendedEntityData)} does not support writing '{options.Format}' format."); + } + } + + AssessedSqlRecommendedEntityData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssessedSqlRecommendedEntityData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssessedSqlRecommendedEntityData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlRecommendedEntityData.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlRecommendedEntityData.cs new file mode 100644 index 000000000000..5aa0a531ea2f --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlRecommendedEntityData.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing the AssessedSqlRecommendedEntity data model. + /// SQL Assessment REST resource. + /// + public partial class AssessedSqlRecommendedEntityData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AssessedSqlRecommendedEntityData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets or sets machine name. + /// Gets or sets SQL instance name. + /// Gets the product support status related details. + /// Gets or sets assessed database count. + /// Gets or sets the total discovered database count. + /// + /// Gets or sets a value indicating whether instance deep discovery has occurred or + /// not. + /// + /// Gets or sets the recommended azure SQL target type. + /// Gets or sets the recommended azure SQL suitability. + /// SQL instance azure SQL MI suitability details. + /// SQL instance azure SQL DB suitability details. + /// SQL instance azure SQL VM suitability details. + /// Gets or sets Arm id of assessed entity. + /// Gets or sets a value indicating whether the SQL instance is clustered or not. + /// Gets or sets a value indicating whether the high availability is enabled or not. + /// Gets the SQL edition from the recommended entity if applicable. + /// Gets the SQL version from the recommended entity if applicable. + /// Assessment sizing criterion. + /// Keeps track of any properties unknown to the library. + internal AssessedSqlRecommendedEntityData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string machineName, string instanceName, ProductSupportStatus productSupportStatus, int? dbCount, int? discoveredDBCount, bool? hasScanOccurred, MigrationAssessmentTargetType? recommendedAzureSqlTargetType, RecommendedSuitability? recommendedSuitability, SqlAssessmentV2PaasSuitabilityDetails azureSqlMISuitabilityDetails, SqlAssessmentV2PaasSuitabilityDetails azureSqlDBSuitabilityDetails, SqlAssessmentV2IaasSuitabilityDetails azureSqlVmSuitabilityDetails, ResourceIdentifier assessedSqlEntityArmId, bool? isClustered, bool? isHighAvailabilityEnabled, string sqlEdition, string sqlVersion, AssessmentSizingCriterion? sizingCriterion, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + MachineName = machineName; + InstanceName = instanceName; + ProductSupportStatus = productSupportStatus; + DBCount = dbCount; + DiscoveredDBCount = discoveredDBCount; + HasScanOccurred = hasScanOccurred; + RecommendedAzureSqlTargetType = recommendedAzureSqlTargetType; + RecommendedSuitability = recommendedSuitability; + AzureSqlMISuitabilityDetails = azureSqlMISuitabilityDetails; + AzureSqlDBSuitabilityDetails = azureSqlDBSuitabilityDetails; + AzureSqlVmSuitabilityDetails = azureSqlVmSuitabilityDetails; + AssessedSqlEntityArmId = assessedSqlEntityArmId; + IsClustered = isClustered; + IsHighAvailabilityEnabled = isHighAvailabilityEnabled; + SqlEdition = sqlEdition; + SqlVersion = sqlVersion; + SizingCriterion = sizingCriterion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets machine name. + public string MachineName { get; } + /// Gets or sets SQL instance name. + public string InstanceName { get; } + /// Gets the product support status related details. + public ProductSupportStatus ProductSupportStatus { get; } + /// Gets or sets assessed database count. + public int? DBCount { get; } + /// Gets or sets the total discovered database count. + public int? DiscoveredDBCount { get; } + /// + /// Gets or sets a value indicating whether instance deep discovery has occurred or + /// not. + /// + public bool? HasScanOccurred { get; } + /// Gets or sets the recommended azure SQL target type. + public MigrationAssessmentTargetType? RecommendedAzureSqlTargetType { get; } + /// Gets or sets the recommended azure SQL suitability. + public RecommendedSuitability? RecommendedSuitability { get; } + /// SQL instance azure SQL MI suitability details. + public SqlAssessmentV2PaasSuitabilityDetails AzureSqlMISuitabilityDetails { get; } + /// SQL instance azure SQL DB suitability details. + public SqlAssessmentV2PaasSuitabilityDetails AzureSqlDBSuitabilityDetails { get; } + /// SQL instance azure SQL VM suitability details. + public SqlAssessmentV2IaasSuitabilityDetails AzureSqlVmSuitabilityDetails { get; } + /// Gets or sets Arm id of assessed entity. + public ResourceIdentifier AssessedSqlEntityArmId { get; set; } + /// Gets or sets a value indicating whether the SQL instance is clustered or not. + public bool? IsClustered { get; } + /// Gets or sets a value indicating whether the high availability is enabled or not. + public bool? IsHighAvailabilityEnabled { get; } + /// Gets the SQL edition from the recommended entity if applicable. + public string SqlEdition { get; } + /// Gets the SQL version from the recommended entity if applicable. + public string SqlVersion { get; } + /// Assessment sizing criterion. + public AssessmentSizingCriterion? SizingCriterion { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlRecommendedEntityResource.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlRecommendedEntityResource.Serialization.cs new file mode 100644 index 000000000000..ae883655fa5f --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlRecommendedEntityResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class AssessedSqlRecommendedEntityResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + AssessedSqlRecommendedEntityData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + AssessedSqlRecommendedEntityData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlRecommendedEntityResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlRecommendedEntityResource.cs new file mode 100644 index 000000000000..487fb53ea547 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/AssessedSqlRecommendedEntityResource.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A Class representing an AssessedSqlRecommendedEntity along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetAssessedSqlRecommendedEntityResource method. + /// Otherwise you can get one from its parent resource using the GetAssessedSqlRecommendedEntity method. + /// + public partial class AssessedSqlRecommendedEntityResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The groupName. + /// The assessmentName. + /// The recommendedAssessedEntityName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string recommendedAssessedEntityName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/recommendedAssessedEntities/{recommendedAssessedEntityName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsClientDiagnostics; + private readonly AssessedSqlRecommendedEntityRestOperations _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsRestClient; + private readonly AssessedSqlRecommendedEntityData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/groups/sqlAssessments/recommendedAssessedEntities"; + + /// Initializes a new instance of the class for mocking. + protected AssessedSqlRecommendedEntityResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AssessedSqlRecommendedEntityResource(ArmClient client, AssessedSqlRecommendedEntityData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal AssessedSqlRecommendedEntityResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsApiVersion); + _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsRestClient = new AssessedSqlRecommendedEntityRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual AssessedSqlRecommendedEntityData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a AssessedSqlRecommendedEntity + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/recommendedAssessedEntities/{recommendedAssessedEntityName} + /// + /// + /// Operation Id + /// AssessedSqlRecommendedEntityOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsClientDiagnostics.CreateScope("AssessedSqlRecommendedEntityResource.Get"); + scope.Start(); + try + { + var response = await _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AssessedSqlRecommendedEntityResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AssessedSqlRecommendedEntity + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/recommendedAssessedEntities/{recommendedAssessedEntityName} + /// + /// + /// Operation Id + /// AssessedSqlRecommendedEntityOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsClientDiagnostics.CreateScope("AssessedSqlRecommendedEntityResource.Get"); + scope.Start(); + try + { + var response = _assessedSqlRecommendedEntityAssessedSqlRecommendedEntityOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AssessedSqlRecommendedEntityResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Extensions/MigrationAssessmentExtensions.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Extensions/MigrationAssessmentExtensions.cs new file mode 100644 index 000000000000..ede6e0c482be --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Extensions/MigrationAssessmentExtensions.cs @@ -0,0 +1,656 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Mocking; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// A class to add extension methods to Azure.ResourceManager.Migration.Assessment. + public static partial class MigrationAssessmentExtensions + { + private static MockableMigrationAssessmentArmClient GetMockableMigrationAssessmentArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableMigrationAssessmentArmClient(client0)); + } + + private static MockableMigrationAssessmentResourceGroupResource GetMockableMigrationAssessmentResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableMigrationAssessmentResourceGroupResource(client, resource.Id)); + } + + private static MockableMigrationAssessmentSubscriptionResource GetMockableMigrationAssessmentSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableMigrationAssessmentSubscriptionResource(client, resource.Id)); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MigrationAssessmentAssessmentProjectResource GetMigrationAssessmentAssessmentProjectResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrationAssessmentArmClient(client).GetMigrationAssessmentAssessmentProjectResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MigrationAssessmentAssessmentOptionResource GetMigrationAssessmentAssessmentOptionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrationAssessmentArmClient(client).GetMigrationAssessmentAssessmentOptionResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MigrationAssessmentAvsAssessmentOptionResource GetMigrationAssessmentAvsAssessmentOptionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrationAssessmentArmClient(client).GetMigrationAssessmentAvsAssessmentOptionResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MigrationAssessmentGroupResource GetMigrationAssessmentGroupResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrationAssessmentArmClient(client).GetMigrationAssessmentGroupResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MigrationAssessmentAssessmentResource GetMigrationAssessmentAssessmentResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrationAssessmentArmClient(client).GetMigrationAssessmentAssessmentResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static AssessedMachineResource GetAssessedMachineResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrationAssessmentArmClient(client).GetAssessedMachineResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MigrationAssessmentAvsAssessmentResource GetMigrationAssessmentAvsAssessmentResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrationAssessmentArmClient(client).GetMigrationAssessmentAvsAssessmentResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MigrationAssessmentAvsAssessedMachineResource GetMigrationAssessmentAvsAssessedMachineResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrationAssessmentArmClient(client).GetMigrationAssessmentAvsAssessedMachineResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MigrationAssessmentSqlAssessmentV2Resource GetMigrationAssessmentSqlAssessmentV2Resource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrationAssessmentArmClient(client).GetMigrationAssessmentSqlAssessmentV2Resource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static AssessedSqlDatabaseV2Resource GetAssessedSqlDatabaseV2Resource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrationAssessmentArmClient(client).GetAssessedSqlDatabaseV2Resource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static AssessedSqlInstanceV2Resource GetAssessedSqlInstanceV2Resource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrationAssessmentArmClient(client).GetAssessedSqlInstanceV2Resource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static AssessedSqlMachineResource GetAssessedSqlMachineResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrationAssessmentArmClient(client).GetAssessedSqlMachineResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static AssessedSqlRecommendedEntityResource GetAssessedSqlRecommendedEntityResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrationAssessmentArmClient(client).GetAssessedSqlRecommendedEntityResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MigrationAssessmentSqlAssessmentV2SummaryResource GetMigrationAssessmentSqlAssessmentV2SummaryResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrationAssessmentArmClient(client).GetMigrationAssessmentSqlAssessmentV2SummaryResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MigrationAssessmentHyperVCollectorResource GetMigrationAssessmentHyperVCollectorResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrationAssessmentArmClient(client).GetMigrationAssessmentHyperVCollectorResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MigrationAssessmentImportCollectorResource GetMigrationAssessmentImportCollectorResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrationAssessmentArmClient(client).GetMigrationAssessmentImportCollectorResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MigrationAssessmentMachineResource GetMigrationAssessmentMachineResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrationAssessmentArmClient(client).GetMigrationAssessmentMachineResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MigrationAssessmentPrivateEndpointConnectionResource GetMigrationAssessmentPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrationAssessmentArmClient(client).GetMigrationAssessmentPrivateEndpointConnectionResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MigrationAssessmentPrivateLinkResource GetMigrationAssessmentPrivateLinkResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrationAssessmentArmClient(client).GetMigrationAssessmentPrivateLinkResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MigrationAssessmentAssessmentProjectSummaryResource GetMigrationAssessmentAssessmentProjectSummaryResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrationAssessmentArmClient(client).GetMigrationAssessmentAssessmentProjectSummaryResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MigrationAssessmentServerCollectorResource GetMigrationAssessmentServerCollectorResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrationAssessmentArmClient(client).GetMigrationAssessmentServerCollectorResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MigrationAssessmentSqlAssessmentOptionResource GetMigrationAssessmentSqlAssessmentOptionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrationAssessmentArmClient(client).GetMigrationAssessmentSqlAssessmentOptionResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MigrationAssessmentSqlCollectorResource GetMigrationAssessmentSqlCollectorResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrationAssessmentArmClient(client).GetMigrationAssessmentSqlCollectorResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MigrationAssessmentVMwareCollectorResource GetMigrationAssessmentVMwareCollectorResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrationAssessmentArmClient(client).GetMigrationAssessmentVMwareCollectorResource(id); + } + + /// + /// Gets a collection of MigrationAssessmentAssessmentProjectResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of MigrationAssessmentAssessmentProjectResources and their operations over a MigrationAssessmentAssessmentProjectResource. + public static MigrationAssessmentAssessmentProjectCollection GetMigrationAssessmentAssessmentProjects(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableMigrationAssessmentResourceGroupResource(resourceGroupResource).GetMigrationAssessmentAssessmentProjects(); + } + + /// + /// Get a AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Assessment Project Name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetMigrationAssessmentAssessmentProjectAsync(this ResourceGroupResource resourceGroupResource, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableMigrationAssessmentResourceGroupResource(resourceGroupResource).GetMigrationAssessmentAssessmentProjectAsync(projectName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Assessment Project Name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetMigrationAssessmentAssessmentProject(this ResourceGroupResource resourceGroupResource, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableMigrationAssessmentResourceGroupResource(resourceGroupResource).GetMigrationAssessmentAssessmentProject(projectName, cancellationToken); + } + + /// + /// List AssessmentProject resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Migrate/assessmentProjects + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_ListBySubscription + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetMigrationAssessmentAssessmentProjectsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableMigrationAssessmentSubscriptionResource(subscriptionResource).GetMigrationAssessmentAssessmentProjectsAsync(cancellationToken); + } + + /// + /// List AssessmentProject resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Migrate/assessmentProjects + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_ListBySubscription + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetMigrationAssessmentAssessmentProjects(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableMigrationAssessmentSubscriptionResource(subscriptionResource).GetMigrationAssessmentAssessmentProjects(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Extensions/MockableMigrationAssessmentArmClient.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Extensions/MockableMigrationAssessmentArmClient.cs new file mode 100644 index 000000000000..7e0e42e8e3e6 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Extensions/MockableMigrationAssessmentArmClient.cs @@ -0,0 +1,325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableMigrationAssessmentArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableMigrationAssessmentArmClient() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableMigrationAssessmentArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableMigrationAssessmentArmClient(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MigrationAssessmentAssessmentProjectResource GetMigrationAssessmentAssessmentProjectResource(ResourceIdentifier id) + { + MigrationAssessmentAssessmentProjectResource.ValidateResourceId(id); + return new MigrationAssessmentAssessmentProjectResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MigrationAssessmentAssessmentOptionResource GetMigrationAssessmentAssessmentOptionResource(ResourceIdentifier id) + { + MigrationAssessmentAssessmentOptionResource.ValidateResourceId(id); + return new MigrationAssessmentAssessmentOptionResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MigrationAssessmentAvsAssessmentOptionResource GetMigrationAssessmentAvsAssessmentOptionResource(ResourceIdentifier id) + { + MigrationAssessmentAvsAssessmentOptionResource.ValidateResourceId(id); + return new MigrationAssessmentAvsAssessmentOptionResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MigrationAssessmentGroupResource GetMigrationAssessmentGroupResource(ResourceIdentifier id) + { + MigrationAssessmentGroupResource.ValidateResourceId(id); + return new MigrationAssessmentGroupResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MigrationAssessmentAssessmentResource GetMigrationAssessmentAssessmentResource(ResourceIdentifier id) + { + MigrationAssessmentAssessmentResource.ValidateResourceId(id); + return new MigrationAssessmentAssessmentResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AssessedMachineResource GetAssessedMachineResource(ResourceIdentifier id) + { + AssessedMachineResource.ValidateResourceId(id); + return new AssessedMachineResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MigrationAssessmentAvsAssessmentResource GetMigrationAssessmentAvsAssessmentResource(ResourceIdentifier id) + { + MigrationAssessmentAvsAssessmentResource.ValidateResourceId(id); + return new MigrationAssessmentAvsAssessmentResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MigrationAssessmentAvsAssessedMachineResource GetMigrationAssessmentAvsAssessedMachineResource(ResourceIdentifier id) + { + MigrationAssessmentAvsAssessedMachineResource.ValidateResourceId(id); + return new MigrationAssessmentAvsAssessedMachineResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MigrationAssessmentSqlAssessmentV2Resource GetMigrationAssessmentSqlAssessmentV2Resource(ResourceIdentifier id) + { + MigrationAssessmentSqlAssessmentV2Resource.ValidateResourceId(id); + return new MigrationAssessmentSqlAssessmentV2Resource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AssessedSqlDatabaseV2Resource GetAssessedSqlDatabaseV2Resource(ResourceIdentifier id) + { + AssessedSqlDatabaseV2Resource.ValidateResourceId(id); + return new AssessedSqlDatabaseV2Resource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AssessedSqlInstanceV2Resource GetAssessedSqlInstanceV2Resource(ResourceIdentifier id) + { + AssessedSqlInstanceV2Resource.ValidateResourceId(id); + return new AssessedSqlInstanceV2Resource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AssessedSqlMachineResource GetAssessedSqlMachineResource(ResourceIdentifier id) + { + AssessedSqlMachineResource.ValidateResourceId(id); + return new AssessedSqlMachineResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AssessedSqlRecommendedEntityResource GetAssessedSqlRecommendedEntityResource(ResourceIdentifier id) + { + AssessedSqlRecommendedEntityResource.ValidateResourceId(id); + return new AssessedSqlRecommendedEntityResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MigrationAssessmentSqlAssessmentV2SummaryResource GetMigrationAssessmentSqlAssessmentV2SummaryResource(ResourceIdentifier id) + { + MigrationAssessmentSqlAssessmentV2SummaryResource.ValidateResourceId(id); + return new MigrationAssessmentSqlAssessmentV2SummaryResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MigrationAssessmentHyperVCollectorResource GetMigrationAssessmentHyperVCollectorResource(ResourceIdentifier id) + { + MigrationAssessmentHyperVCollectorResource.ValidateResourceId(id); + return new MigrationAssessmentHyperVCollectorResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MigrationAssessmentImportCollectorResource GetMigrationAssessmentImportCollectorResource(ResourceIdentifier id) + { + MigrationAssessmentImportCollectorResource.ValidateResourceId(id); + return new MigrationAssessmentImportCollectorResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MigrationAssessmentMachineResource GetMigrationAssessmentMachineResource(ResourceIdentifier id) + { + MigrationAssessmentMachineResource.ValidateResourceId(id); + return new MigrationAssessmentMachineResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MigrationAssessmentPrivateEndpointConnectionResource GetMigrationAssessmentPrivateEndpointConnectionResource(ResourceIdentifier id) + { + MigrationAssessmentPrivateEndpointConnectionResource.ValidateResourceId(id); + return new MigrationAssessmentPrivateEndpointConnectionResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MigrationAssessmentPrivateLinkResource GetMigrationAssessmentPrivateLinkResource(ResourceIdentifier id) + { + MigrationAssessmentPrivateLinkResource.ValidateResourceId(id); + return new MigrationAssessmentPrivateLinkResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MigrationAssessmentAssessmentProjectSummaryResource GetMigrationAssessmentAssessmentProjectSummaryResource(ResourceIdentifier id) + { + MigrationAssessmentAssessmentProjectSummaryResource.ValidateResourceId(id); + return new MigrationAssessmentAssessmentProjectSummaryResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MigrationAssessmentServerCollectorResource GetMigrationAssessmentServerCollectorResource(ResourceIdentifier id) + { + MigrationAssessmentServerCollectorResource.ValidateResourceId(id); + return new MigrationAssessmentServerCollectorResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MigrationAssessmentSqlAssessmentOptionResource GetMigrationAssessmentSqlAssessmentOptionResource(ResourceIdentifier id) + { + MigrationAssessmentSqlAssessmentOptionResource.ValidateResourceId(id); + return new MigrationAssessmentSqlAssessmentOptionResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MigrationAssessmentSqlCollectorResource GetMigrationAssessmentSqlCollectorResource(ResourceIdentifier id) + { + MigrationAssessmentSqlCollectorResource.ValidateResourceId(id); + return new MigrationAssessmentSqlCollectorResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MigrationAssessmentVMwareCollectorResource GetMigrationAssessmentVMwareCollectorResource(ResourceIdentifier id) + { + MigrationAssessmentVMwareCollectorResource.ValidateResourceId(id); + return new MigrationAssessmentVMwareCollectorResource(Client, id); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Extensions/MockableMigrationAssessmentResourceGroupResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Extensions/MockableMigrationAssessmentResourceGroupResource.cs new file mode 100644 index 000000000000..a15d68a8745c --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Extensions/MockableMigrationAssessmentResourceGroupResource.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableMigrationAssessmentResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableMigrationAssessmentResourceGroupResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableMigrationAssessmentResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of MigrationAssessmentAssessmentProjectResources in the ResourceGroupResource. + /// An object representing collection of MigrationAssessmentAssessmentProjectResources and their operations over a MigrationAssessmentAssessmentProjectResource. + public virtual MigrationAssessmentAssessmentProjectCollection GetMigrationAssessmentAssessmentProjects() + { + return GetCachedClient(client => new MigrationAssessmentAssessmentProjectCollection(client, Id)); + } + + /// + /// Get a AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Assessment Project Name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMigrationAssessmentAssessmentProjectAsync(string projectName, CancellationToken cancellationToken = default) + { + return await GetMigrationAssessmentAssessmentProjects().GetAsync(projectName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Assessment Project Name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMigrationAssessmentAssessmentProject(string projectName, CancellationToken cancellationToken = default) + { + return GetMigrationAssessmentAssessmentProjects().Get(projectName, cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Extensions/MockableMigrationAssessmentSubscriptionResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Extensions/MockableMigrationAssessmentSubscriptionResource.cs new file mode 100644 index 000000000000..0c0c62b4f0c7 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Extensions/MockableMigrationAssessmentSubscriptionResource.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableMigrationAssessmentSubscriptionResource : ArmResource + { + private ClientDiagnostics _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics; + private AssessmentProjectsRestOperations _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableMigrationAssessmentSubscriptionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableMigrationAssessmentSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics MigrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics => _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", MigrationAssessmentAssessmentProjectResource.ResourceType.Namespace, Diagnostics); + private AssessmentProjectsRestOperations MigrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient => _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient ??= new AssessmentProjectsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(MigrationAssessmentAssessmentProjectResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// List AssessmentProject resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Migrate/assessmentProjects + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_ListBySubscription + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetMigrationAssessmentAssessmentProjectsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => MigrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MigrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentAssessmentProjectResource(Client, MigrationAssessmentAssessmentProjectData.DeserializeMigrationAssessmentAssessmentProjectData(e)), MigrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics, Pipeline, "MockableMigrationAssessmentSubscriptionResource.GetMigrationAssessmentAssessmentProjects", "value", "nextLink", cancellationToken); + } + + /// + /// List AssessmentProject resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Migrate/assessmentProjects + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_ListBySubscription + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetMigrationAssessmentAssessmentProjects(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => MigrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MigrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentAssessmentProjectResource(Client, MigrationAssessmentAssessmentProjectData.DeserializeMigrationAssessmentAssessmentProjectData(e)), MigrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics, Pipeline, "MockableMigrationAssessmentSubscriptionResource.GetMigrationAssessmentAssessmentProjects", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Internal/Argument.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..c39ff89ff588 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..a90fb4f9f050 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Internal/ChangeTrackingList.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..b9c77c15522e --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..74085d326146 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Internal/Optional.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..c1ff37b64592 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..a6ac130541a4 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/AssessmentArmOperation.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/AssessmentArmOperation.cs new file mode 100644 index 000000000000..86f7d61f2c3e --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/AssessmentArmOperation.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ +#pragma warning disable SA1649 // File name should match first type name + internal class AssessmentArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of AssessmentArmOperation for mocking. + protected AssessmentArmOperation() + { + } + + internal AssessmentArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal AssessmentArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "AssessmentArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); + + /// + public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/AssessmentArmOperationOfT.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/AssessmentArmOperationOfT.cs new file mode 100644 index 000000000000..9f227ab152d2 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/AssessmentArmOperationOfT.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ +#pragma warning disable SA1649 // File name should match first type name + internal class AssessmentArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of AssessmentArmOperation for mocking. + protected AssessmentArmOperation() + { + } + + internal AssessmentArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal AssessmentArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "AssessmentArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override T Value => _operation.Value; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); + + /// + public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/AssessmentReportDownloadUriOperationSource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/AssessmentReportDownloadUriOperationSource.cs new file mode 100644 index 000000000000..9ee43cd1d908 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/AssessmentReportDownloadUriOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal class AssessmentReportDownloadUriOperationSource : IOperationSource + { + AssessmentReportDownloadUri IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + return AssessmentReportDownloadUri.DeserializeAssessmentReportDownloadUri(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + return AssessmentReportDownloadUri.DeserializeAssessmentReportDownloadUri(document.RootElement); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentAssessmentOperationSource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentAssessmentOperationSource.cs new file mode 100644 index 000000000000..a9ad080ee7b7 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentAssessmentOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal class MigrationAssessmentAssessmentOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal MigrationAssessmentAssessmentOperationSource(ArmClient client) + { + _client = client; + } + + MigrationAssessmentAssessmentResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = MigrationAssessmentAssessmentData.DeserializeMigrationAssessmentAssessmentData(document.RootElement); + return new MigrationAssessmentAssessmentResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = MigrationAssessmentAssessmentData.DeserializeMigrationAssessmentAssessmentData(document.RootElement); + return new MigrationAssessmentAssessmentResource(_client, data); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentAssessmentProjectOperationSource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentAssessmentProjectOperationSource.cs new file mode 100644 index 000000000000..e72a26a3b4b3 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentAssessmentProjectOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal class MigrationAssessmentAssessmentProjectOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal MigrationAssessmentAssessmentProjectOperationSource(ArmClient client) + { + _client = client; + } + + MigrationAssessmentAssessmentProjectResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = MigrationAssessmentAssessmentProjectData.DeserializeMigrationAssessmentAssessmentProjectData(document.RootElement); + return new MigrationAssessmentAssessmentProjectResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = MigrationAssessmentAssessmentProjectData.DeserializeMigrationAssessmentAssessmentProjectData(document.RootElement); + return new MigrationAssessmentAssessmentProjectResource(_client, data); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentAvsAssessmentOperationSource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentAvsAssessmentOperationSource.cs new file mode 100644 index 000000000000..be8cc5918370 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentAvsAssessmentOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal class MigrationAssessmentAvsAssessmentOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal MigrationAssessmentAvsAssessmentOperationSource(ArmClient client) + { + _client = client; + } + + MigrationAssessmentAvsAssessmentResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = MigrationAssessmentAvsAssessmentData.DeserializeMigrationAssessmentAvsAssessmentData(document.RootElement); + return new MigrationAssessmentAvsAssessmentResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = MigrationAssessmentAvsAssessmentData.DeserializeMigrationAssessmentAvsAssessmentData(document.RootElement); + return new MigrationAssessmentAvsAssessmentResource(_client, data); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentGroupOperationSource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentGroupOperationSource.cs new file mode 100644 index 000000000000..5b33be4c41da --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentGroupOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal class MigrationAssessmentGroupOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal MigrationAssessmentGroupOperationSource(ArmClient client) + { + _client = client; + } + + MigrationAssessmentGroupResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = MigrationAssessmentGroupData.DeserializeMigrationAssessmentGroupData(document.RootElement); + return new MigrationAssessmentGroupResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = MigrationAssessmentGroupData.DeserializeMigrationAssessmentGroupData(document.RootElement); + return new MigrationAssessmentGroupResource(_client, data); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentHyperVCollectorOperationSource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentHyperVCollectorOperationSource.cs new file mode 100644 index 000000000000..907a544e93a7 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentHyperVCollectorOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal class MigrationAssessmentHyperVCollectorOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal MigrationAssessmentHyperVCollectorOperationSource(ArmClient client) + { + _client = client; + } + + MigrationAssessmentHyperVCollectorResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = MigrationAssessmentHyperVCollectorData.DeserializeMigrationAssessmentHyperVCollectorData(document.RootElement); + return new MigrationAssessmentHyperVCollectorResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = MigrationAssessmentHyperVCollectorData.DeserializeMigrationAssessmentHyperVCollectorData(document.RootElement); + return new MigrationAssessmentHyperVCollectorResource(_client, data); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentImportCollectorOperationSource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentImportCollectorOperationSource.cs new file mode 100644 index 000000000000..fc8aec7753b4 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentImportCollectorOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal class MigrationAssessmentImportCollectorOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal MigrationAssessmentImportCollectorOperationSource(ArmClient client) + { + _client = client; + } + + MigrationAssessmentImportCollectorResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = MigrationAssessmentImportCollectorData.DeserializeMigrationAssessmentImportCollectorData(document.RootElement); + return new MigrationAssessmentImportCollectorResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = MigrationAssessmentImportCollectorData.DeserializeMigrationAssessmentImportCollectorData(document.RootElement); + return new MigrationAssessmentImportCollectorResource(_client, data); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentPrivateEndpointConnectionOperationSource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentPrivateEndpointConnectionOperationSource.cs new file mode 100644 index 000000000000..cd1f0b067ce8 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentPrivateEndpointConnectionOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal class MigrationAssessmentPrivateEndpointConnectionOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal MigrationAssessmentPrivateEndpointConnectionOperationSource(ArmClient client) + { + _client = client; + } + + MigrationAssessmentPrivateEndpointConnectionResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = MigrationAssessmentPrivateEndpointConnectionData.DeserializeMigrationAssessmentPrivateEndpointConnectionData(document.RootElement); + return new MigrationAssessmentPrivateEndpointConnectionResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = MigrationAssessmentPrivateEndpointConnectionData.DeserializeMigrationAssessmentPrivateEndpointConnectionData(document.RootElement); + return new MigrationAssessmentPrivateEndpointConnectionResource(_client, data); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentServerCollectorOperationSource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentServerCollectorOperationSource.cs new file mode 100644 index 000000000000..239c40ff22c4 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentServerCollectorOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal class MigrationAssessmentServerCollectorOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal MigrationAssessmentServerCollectorOperationSource(ArmClient client) + { + _client = client; + } + + MigrationAssessmentServerCollectorResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = MigrationAssessmentServerCollectorData.DeserializeMigrationAssessmentServerCollectorData(document.RootElement); + return new MigrationAssessmentServerCollectorResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = MigrationAssessmentServerCollectorData.DeserializeMigrationAssessmentServerCollectorData(document.RootElement); + return new MigrationAssessmentServerCollectorResource(_client, data); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentSqlAssessmentV2OperationSource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentSqlAssessmentV2OperationSource.cs new file mode 100644 index 000000000000..f631bcf9ee74 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentSqlAssessmentV2OperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal class MigrationAssessmentSqlAssessmentV2OperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal MigrationAssessmentSqlAssessmentV2OperationSource(ArmClient client) + { + _client = client; + } + + MigrationAssessmentSqlAssessmentV2Resource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = MigrationAssessmentSqlAssessmentV2Data.DeserializeMigrationAssessmentSqlAssessmentV2Data(document.RootElement); + return new MigrationAssessmentSqlAssessmentV2Resource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = MigrationAssessmentSqlAssessmentV2Data.DeserializeMigrationAssessmentSqlAssessmentV2Data(document.RootElement); + return new MigrationAssessmentSqlAssessmentV2Resource(_client, data); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentSqlCollectorOperationSource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentSqlCollectorOperationSource.cs new file mode 100644 index 000000000000..5dbf1074e1ac --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentSqlCollectorOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal class MigrationAssessmentSqlCollectorOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal MigrationAssessmentSqlCollectorOperationSource(ArmClient client) + { + _client = client; + } + + MigrationAssessmentSqlCollectorResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = MigrationAssessmentSqlCollectorData.DeserializeMigrationAssessmentSqlCollectorData(document.RootElement); + return new MigrationAssessmentSqlCollectorResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = MigrationAssessmentSqlCollectorData.DeserializeMigrationAssessmentSqlCollectorData(document.RootElement); + return new MigrationAssessmentSqlCollectorResource(_client, data); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentVMwareCollectorOperationSource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentVMwareCollectorOperationSource.cs new file mode 100644 index 000000000000..cad8a82a43e8 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/LongRunningOperation/MigrationAssessmentVMwareCollectorOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal class MigrationAssessmentVMwareCollectorOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal MigrationAssessmentVMwareCollectorOperationSource(ArmClient client) + { + _client = client; + } + + MigrationAssessmentVMwareCollectorResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = MigrationAssessmentVMwareCollectorData.DeserializeMigrationAssessmentVMwareCollectorData(document.RootElement); + return new MigrationAssessmentVMwareCollectorResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = MigrationAssessmentVMwareCollectorData.DeserializeMigrationAssessmentVMwareCollectorData(document.RootElement); + return new MigrationAssessmentVMwareCollectorResource(_client, data); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentCollection.cs new file mode 100644 index 000000000000..7f7277265447 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMigrationAssessmentAssessments method from an instance of . + /// + public partial class MigrationAssessmentAssessmentCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics; + private readonly AssessmentsRestOperations _migrationAssessmentAssessmentAssessmentsOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentAssessmentCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MigrationAssessmentAssessmentCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", MigrationAssessmentAssessmentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MigrationAssessmentAssessmentResource.ResourceType, out string migrationAssessmentAssessmentAssessmentsOperationsApiVersion); + _migrationAssessmentAssessmentAssessmentsOperationsRestClient = new AssessmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentAssessmentAssessmentsOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MigrationAssessmentGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MigrationAssessmentGroupResource.ResourceType), nameof(id)); + } + + /// + /// Create a Assessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// + /// + /// Operation Id + /// AssessmentsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Machine Assessment ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string assessmentName, MigrationAssessmentAssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _migrationAssessmentAssessmentAssessmentsOperationsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, data, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new MigrationAssessmentAssessmentOperationSource(Client), _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics, Pipeline, _migrationAssessmentAssessmentAssessmentsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a Assessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// + /// + /// Operation Id + /// AssessmentsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Machine Assessment ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string assessmentName, MigrationAssessmentAssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _migrationAssessmentAssessmentAssessmentsOperationsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, data, cancellationToken); + var operation = new AssessmentArmOperation(new MigrationAssessmentAssessmentOperationSource(Client), _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics, Pipeline, _migrationAssessmentAssessmentAssessmentsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Assessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// + /// + /// Operation Id + /// AssessmentsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Machine Assessment ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var scope = _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentCollection.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentAssessmentAssessmentsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Assessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// + /// + /// Operation Id + /// AssessmentsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Machine Assessment ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var scope = _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentCollection.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentAssessmentAssessmentsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Assessment resources by Group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments + /// + /// + /// Operation Id + /// AssessmentsOperations_ListByGroup + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentAssessmentAssessmentsOperationsRestClient.CreateListByGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentAssessmentAssessmentsOperationsRestClient.CreateListByGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentAssessmentResource(Client, MigrationAssessmentAssessmentData.DeserializeMigrationAssessmentAssessmentData(e)), _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics, Pipeline, "MigrationAssessmentAssessmentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List Assessment resources by Group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments + /// + /// + /// Operation Id + /// AssessmentsOperations_ListByGroup + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentAssessmentAssessmentsOperationsRestClient.CreateListByGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentAssessmentAssessmentsOperationsRestClient.CreateListByGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentAssessmentResource(Client, MigrationAssessmentAssessmentData.DeserializeMigrationAssessmentAssessmentData(e)), _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics, Pipeline, "MigrationAssessmentAssessmentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// + /// + /// Operation Id + /// AssessmentsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Machine Assessment ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var scope = _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentCollection.Exists"); + scope.Start(); + try + { + var response = await _migrationAssessmentAssessmentAssessmentsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// + /// + /// Operation Id + /// AssessmentsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Machine Assessment ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var scope = _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentCollection.Exists"); + scope.Start(); + try + { + var response = _migrationAssessmentAssessmentAssessmentsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// + /// + /// Operation Id + /// AssessmentsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Machine Assessment ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var scope = _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _migrationAssessmentAssessmentAssessmentsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// + /// + /// Operation Id + /// AssessmentsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Machine Assessment ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var scope = _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentCollection.GetIfExists"); + scope.Start(); + try + { + var response = _migrationAssessmentAssessmentAssessmentsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentData.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentData.Serialization.cs new file mode 100644 index 000000000000..824643e147bd --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentData.Serialization.cs @@ -0,0 +1,887 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentAssessmentData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentAssessmentData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(AssessmentErrorSummary)) + { + writer.WritePropertyName("assessmentErrorSummary"u8); + writer.WriteStartObject(); + foreach (var item in AssessmentErrorSummary) + { + writer.WritePropertyName(item.Key); + writer.WriteNumberValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsDefined(MonthlyUltraStorageCost)) + { + writer.WritePropertyName("monthlyUltraStorageCost"u8); + writer.WriteNumberValue(MonthlyUltraStorageCost.Value); + } + if (options.Format != "W" && Optional.IsCollectionDefined(CostComponents)) + { + writer.WritePropertyName("costComponents"u8); + writer.WriteStartArray(); + foreach (var item in CostComponents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(EASubscriptionId)) + { + writer.WritePropertyName("eaSubscriptionId"u8); + writer.WriteStringValue(EASubscriptionId); + } + if (Optional.IsDefined(AzurePricingTier)) + { + writer.WritePropertyName("azurePricingTier"u8); + writer.WriteStringValue(AzurePricingTier.Value.ToString()); + } + if (Optional.IsDefined(AzureStorageRedundancy)) + { + writer.WritePropertyName("azureStorageRedundancy"u8); + writer.WriteStringValue(AzureStorageRedundancy.Value.ToString()); + } + if (Optional.IsDefined(ReservedInstance)) + { + writer.WritePropertyName("reservedInstance"u8); + writer.WriteStringValue(ReservedInstance.Value.ToString()); + } + if (Optional.IsDefined(AzureHybridUseBenefit)) + { + writer.WritePropertyName("azureHybridUseBenefit"u8); + writer.WriteStringValue(AzureHybridUseBenefit.Value.ToString()); + } + if (Optional.IsCollectionDefined(AzureDiskTypes)) + { + writer.WritePropertyName("azureDiskTypes"u8); + writer.WriteStartArray(); + foreach (var item in AzureDiskTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(AzureVmFamilies)) + { + writer.WritePropertyName("azureVmFamilies"u8); + writer.WriteStartArray(); + foreach (var item in AzureVmFamilies) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(DistributionBySupportStatus)) + { + writer.WritePropertyName("distributionBySupportStatus"u8); + writer.WriteStartObject(); + foreach (var item in DistributionBySupportStatus) + { + writer.WritePropertyName(item.Key); + writer.WriteNumberValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(DistributionByServicePackInsight)) + { + writer.WritePropertyName("distributionByServicePackInsight"u8); + writer.WriteStartObject(); + foreach (var item in DistributionByServicePackInsight) + { + writer.WritePropertyName(item.Key); + writer.WriteNumberValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(DistributionByOSName)) + { + writer.WritePropertyName("distributionByOsName"u8); + writer.WriteStartObject(); + foreach (var item in DistributionByOSName) + { + writer.WritePropertyName(item.Key); + writer.WriteNumberValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsDefined(MonthlyComputeCost)) + { + writer.WritePropertyName("monthlyComputeCost"u8); + writer.WriteNumberValue(MonthlyComputeCost.Value); + } + if (options.Format != "W" && Optional.IsDefined(MonthlyBandwidthCost)) + { + writer.WritePropertyName("monthlyBandwidthCost"u8); + writer.WriteNumberValue(MonthlyBandwidthCost.Value); + } + if (options.Format != "W" && Optional.IsDefined(MonthlyStorageCost)) + { + writer.WritePropertyName("monthlyStorageCost"u8); + writer.WriteNumberValue(MonthlyStorageCost.Value); + } + if (options.Format != "W" && Optional.IsDefined(MonthlyPremiumStorageCost)) + { + writer.WritePropertyName("monthlyPremiumStorageCost"u8); + writer.WriteNumberValue(MonthlyPremiumStorageCost.Value); + } + if (options.Format != "W" && Optional.IsDefined(MonthlyStandardSsdStorageCost)) + { + writer.WritePropertyName("monthlyStandardSsdStorageCost"u8); + writer.WriteNumberValue(MonthlyStandardSsdStorageCost.Value); + } + if (options.Format != "W" && Optional.IsCollectionDefined(SuitabilitySummary)) + { + writer.WritePropertyName("suitabilitySummary"u8); + writer.WriteStartObject(); + foreach (var item in SuitabilitySummary) + { + writer.WritePropertyName(item.Key); + writer.WriteNumberValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfMachines)) + { + writer.WritePropertyName("numberOfMachines"u8); + writer.WriteNumberValue(NumberOfMachines.Value); + } + if (Optional.IsDefined(VmUptime)) + { + writer.WritePropertyName("vmUptime"u8); + writer.WriteObjectValue(VmUptime, options); + } + if (options.Format != "W" && Optional.IsDefined(GroupType)) + { + writer.WritePropertyName("groupType"u8); + writer.WriteStringValue(GroupType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(AssessmentType)) + { + writer.WritePropertyName("assessmentType"u8); + writer.WriteStringValue(AssessmentType.Value.ToString()); + } + if (Optional.IsDefined(AzureLocation)) + { + writer.WritePropertyName("azureLocation"u8); + writer.WriteStringValue(AzureLocation.Value); + } + if (Optional.IsDefined(AzureOfferCode)) + { + writer.WritePropertyName("azureOfferCode"u8); + writer.WriteStringValue(AzureOfferCode.Value.ToString()); + } + if (Optional.IsDefined(Currency)) + { + writer.WritePropertyName("currency"u8); + writer.WriteStringValue(Currency.Value.ToString()); + } + if (Optional.IsDefined(ScalingFactor)) + { + writer.WritePropertyName("scalingFactor"u8); + writer.WriteNumberValue(ScalingFactor.Value); + } + if (Optional.IsDefined(Percentile)) + { + writer.WritePropertyName("percentile"u8); + writer.WriteStringValue(Percentile.Value.ToString()); + } + if (Optional.IsDefined(TimeRange)) + { + writer.WritePropertyName("timeRange"u8); + writer.WriteStringValue(TimeRange.Value.ToString()); + } + if (Optional.IsDefined(PerfDataStartOn)) + { + writer.WritePropertyName("perfDataStartTime"u8); + writer.WriteStringValue(PerfDataStartOn.Value, "O"); + } + if (Optional.IsDefined(PerfDataEndOn)) + { + writer.WritePropertyName("perfDataEndTime"u8); + writer.WriteStringValue(PerfDataEndOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Stage)) + { + writer.WritePropertyName("stage"u8); + writer.WriteStringValue(Stage.Value.ToString()); + } + if (Optional.IsDefined(DiscountPercentage)) + { + writer.WritePropertyName("discountPercentage"u8); + writer.WriteNumberValue(DiscountPercentage.Value); + } + if (Optional.IsDefined(SizingCriterion)) + { + writer.WritePropertyName("sizingCriterion"u8); + writer.WriteStringValue(SizingCriterion.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ConfidenceRatingInPercentage)) + { + writer.WritePropertyName("confidenceRatingInPercentage"u8); + writer.WriteNumberValue(ConfidenceRatingInPercentage.Value); + } + if (options.Format != "W" && Optional.IsDefined(PricesQueriedOn)) + { + writer.WritePropertyName("pricesTimestamp"u8); + writer.WriteStringValue(PricesQueriedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("createdTimestamp"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(UpdatedOn)) + { + writer.WritePropertyName("updatedTimestamp"u8); + writer.WriteStringValue(UpdatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(SchemaVersion)) + { + writer.WritePropertyName("schemaVersion"u8); + writer.WriteStringValue(SchemaVersion); + } + writer.WriteEndObject(); + } + + MigrationAssessmentAssessmentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentAssessmentData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentAssessmentData(document.RootElement, options); + } + + internal static MigrationAssessmentAssessmentData DeserializeMigrationAssessmentAssessmentData(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; + MigrationAssessmentProvisioningState? provisioningState = default; + IReadOnlyDictionary assessmentErrorSummary = default; + double? monthlyUltraStorageCost = default; + IReadOnlyList costComponents = default; + string eaSubscriptionId = default; + AzurePricingTier? azurePricingTier = default; + AzureStorageRedundancy? azureStorageRedundancy = default; + AzureReservedInstance? reservedInstance = default; + AzureHybridUseBenefit? azureHybridUseBenefit = default; + IList azureDiskTypes = default; + IList azureVmFamilies = default; + IReadOnlyDictionary distributionBySupportStatus = default; + IReadOnlyDictionary distributionByServicePackInsight = default; + IReadOnlyDictionary distributionByOSName = default; + double? monthlyComputeCost = default; + double? monthlyBandwidthCost = default; + double? monthlyStorageCost = default; + double? monthlyPremiumStorageCost = default; + double? monthlyStandardSsdStorageCost = default; + IReadOnlyDictionary suitabilitySummary = default; + int? numberOfMachines = default; + VmUptime vmUptime = default; + MigrationAssessmentGroupType? groupType = default; + AssessmentType? assessmentType = default; + AzureLocation? azureLocation = default; + AzureOfferCode? azureOfferCode = default; + AzureCurrency? currency = default; + double? scalingFactor = default; + PercentileOfUtilization? percentile = default; + AssessmentTimeRange? timeRange = default; + DateTimeOffset? perfDataStartTime = default; + DateTimeOffset? perfDataEndTime = default; + AssessmentStage? stage = default; + double? discountPercentage = default; + AssessmentSizingCriterion? sizingCriterion = default; + double? confidenceRatingInPercentage = default; + DateTimeOffset? pricesTimestamp = default; + DateTimeOffset? createdTimestamp = default; + DateTimeOffset? updatedTimestamp = default; + AssessmentStatus? status = default; + string schemaVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(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("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new MigrationAssessmentProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("assessmentErrorSummary"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetInt32()); + } + assessmentErrorSummary = dictionary; + continue; + } + if (property0.NameEquals("monthlyUltraStorageCost"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyUltraStorageCost = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("costComponents"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(CostComponent.DeserializeCostComponent(item, options)); + } + costComponents = array; + continue; + } + if (property0.NameEquals("eaSubscriptionId"u8)) + { + eaSubscriptionId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("azurePricingTier"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azurePricingTier = new AzurePricingTier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("azureStorageRedundancy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureStorageRedundancy = new AzureStorageRedundancy(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("reservedInstance"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + reservedInstance = new AzureReservedInstance(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("azureHybridUseBenefit"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureHybridUseBenefit = new AzureHybridUseBenefit(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("azureDiskTypes"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new AzureDiskType(item.GetString())); + } + azureDiskTypes = array; + continue; + } + if (property0.NameEquals("azureVmFamilies"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new AzureVmFamily(item.GetString())); + } + azureVmFamilies = array; + continue; + } + if (property0.NameEquals("distributionBySupportStatus"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetInt32()); + } + distributionBySupportStatus = dictionary; + continue; + } + if (property0.NameEquals("distributionByServicePackInsight"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetInt32()); + } + distributionByServicePackInsight = dictionary; + continue; + } + if (property0.NameEquals("distributionByOsName"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetInt32()); + } + distributionByOSName = dictionary; + continue; + } + if (property0.NameEquals("monthlyComputeCost"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyComputeCost = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("monthlyBandwidthCost"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyBandwidthCost = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("monthlyStorageCost"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyStorageCost = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("monthlyPremiumStorageCost"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyPremiumStorageCost = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("monthlyStandardSsdStorageCost"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyStandardSsdStorageCost = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("suitabilitySummary"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetInt32()); + } + suitabilitySummary = dictionary; + continue; + } + if (property0.NameEquals("numberOfMachines"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfMachines = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("vmUptime"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vmUptime = VmUptime.DeserializeVmUptime(property0.Value, options); + continue; + } + if (property0.NameEquals("groupType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + groupType = new MigrationAssessmentGroupType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("assessmentType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assessmentType = new AssessmentType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("azureLocation"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureLocation = new AzureLocation(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("azureOfferCode"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureOfferCode = new AzureOfferCode(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("currency"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + currency = new AzureCurrency(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("scalingFactor"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scalingFactor = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("percentile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + percentile = new PercentileOfUtilization(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("timeRange"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeRange = new AssessmentTimeRange(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("perfDataStartTime"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + perfDataStartTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("perfDataEndTime"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + perfDataEndTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("stage"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stage = new AssessmentStage(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("discountPercentage"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + discountPercentage = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("sizingCriterion"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sizingCriterion = new AssessmentSizingCriterion(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("confidenceRatingInPercentage"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + confidenceRatingInPercentage = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("pricesTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + pricesTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("createdTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("updatedTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("status"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new AssessmentStatus(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("schemaVersion"u8)) + { + schemaVersion = property0.Value.GetString(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentAssessmentData( + id, + name, + type, + systemData, + provisioningState, + assessmentErrorSummary ?? new ChangeTrackingDictionary(), + monthlyUltraStorageCost, + costComponents ?? new ChangeTrackingList(), + eaSubscriptionId, + azurePricingTier, + azureStorageRedundancy, + reservedInstance, + azureHybridUseBenefit, + azureDiskTypes ?? new ChangeTrackingList(), + azureVmFamilies ?? new ChangeTrackingList(), + distributionBySupportStatus ?? new ChangeTrackingDictionary(), + distributionByServicePackInsight ?? new ChangeTrackingDictionary(), + distributionByOSName ?? new ChangeTrackingDictionary(), + monthlyComputeCost, + monthlyBandwidthCost, + monthlyStorageCost, + monthlyPremiumStorageCost, + monthlyStandardSsdStorageCost, + suitabilitySummary ?? new ChangeTrackingDictionary(), + numberOfMachines, + vmUptime, + groupType, + assessmentType, + azureLocation, + azureOfferCode, + currency, + scalingFactor, + percentile, + timeRange, + perfDataStartTime, + perfDataEndTime, + stage, + discountPercentage, + sizingCriterion, + confidenceRatingInPercentage, + pricesTimestamp, + createdTimestamp, + updatedTimestamp, + status, + schemaVersion, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentAssessmentData)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentAssessmentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentAssessmentData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentAssessmentData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentData.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentData.cs new file mode 100644 index 000000000000..f0fa41f8b42f --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentData.cs @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing the MigrationAssessmentAssessment data model. + /// Machine assessment resource. + /// + public partial class MigrationAssessmentAssessmentData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MigrationAssessmentAssessmentData() + { + AssessmentErrorSummary = new ChangeTrackingDictionary(); + CostComponents = new ChangeTrackingList(); + AzureDiskTypes = new ChangeTrackingList(); + AzureVmFamilies = new ChangeTrackingList(); + DistributionBySupportStatus = new ChangeTrackingDictionary(); + DistributionByServicePackInsight = new ChangeTrackingDictionary(); + DistributionByOSName = new ChangeTrackingDictionary(); + SuitabilitySummary = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The status of the last operation. + /// + /// Gets or sets the assessment error summary. + /// This is the number of + /// machines affected by each type of error in this assessment. + /// + /// + /// Gets or sets the aggregate ultra storage cost for all machines in the + /// assessment. + /// + /// Gets the collection of cost components. + /// Gets or sets enterprise agreement subscription id. + /// Gets or sets Azure Pricing Tier - Free, Basic, etc. + /// Gets or sets the Azure Storage Redundancy. Example: Locally Redundant Storage. + /// Gets or sets the Azure Reserved Instance - 1-Year, 3-Year. + /// + /// Gets or sets the user configurable setting to display the azure hybrid use + /// benefit. + /// + /// Gets or sets the azure storage type. Premium, Standard etc. + /// Gets or sets the Azure VM families. + /// Gets the distribution of sqlInstances by support status. + /// Gets the distribution distribution of sqlInstances by service pack insight. + /// Gets the distribution by os name. + /// Gets or sets the aggregate Compute Cost for all machines in the assessment. + /// Gets or sets the aggregate Bandwidth Cost for all machines in the assessment. + /// Gets or sets the aggregate Storage Cost for all machines in the assessment. + /// + /// Gets or sets the aggregate premium storage cost for all machines in the + /// assessment. + /// + /// + /// Gets or sets the aggregate standard SSD storage cost for all the machines in + /// the assessment. + /// + /// + /// Gets or sets the Cloud suitability summary for all the machines in the + /// assessment. + /// + /// Gets or sets the Number of machines part of the assessment. + /// + /// Gets or sets the duration for which the VMs are up in the on-premises + /// environment. + /// + /// Gets the group type for the assessment. + /// Assessment type of the assessment. + /// Azure Location or Azure region where to which the machines will be migrated. + /// Azure Offer Code. + /// Currency in which prices should be reported. + /// + /// Percentage of buffer that user wants on performance metrics when recommending + /// Azure sizes. + /// + /// + /// Percentile of the utilization data values to be considered while assessing + /// machines. + /// + /// + /// Time Range for which the historic utilization data should be considered for + /// assessment. + /// + /// Gets or sets the start time to consider performance data for assessment. + /// Gets or sets the end time to consider performance data for assessment. + /// User configurable setting to display the Stage of Assessment. + /// Custom discount percentage. + /// Assessment sizing criterion. + /// Confidence Rating in Percentage. + /// Last time when rates were queried. + /// Date and Time when assessment was created. + /// Date and Time when assessment was last updated. + /// Whether assessment is in valid state and all machines have been assessed. + /// Schema version. + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentAssessmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MigrationAssessmentProvisioningState? provisioningState, IReadOnlyDictionary assessmentErrorSummary, double? monthlyUltraStorageCost, IReadOnlyList costComponents, string eaSubscriptionId, AzurePricingTier? azurePricingTier, AzureStorageRedundancy? azureStorageRedundancy, AzureReservedInstance? reservedInstance, AzureHybridUseBenefit? azureHybridUseBenefit, IList azureDiskTypes, IList azureVmFamilies, IReadOnlyDictionary distributionBySupportStatus, IReadOnlyDictionary distributionByServicePackInsight, IReadOnlyDictionary distributionByOSName, double? monthlyComputeCost, double? monthlyBandwidthCost, double? monthlyStorageCost, double? monthlyPremiumStorageCost, double? monthlyStandardSsdStorageCost, IReadOnlyDictionary suitabilitySummary, int? numberOfMachines, VmUptime vmUptime, MigrationAssessmentGroupType? groupType, AssessmentType? assessmentType, AzureLocation? azureLocation, AzureOfferCode? azureOfferCode, AzureCurrency? currency, double? scalingFactor, PercentileOfUtilization? percentile, AssessmentTimeRange? timeRange, DateTimeOffset? perfDataStartOn, DateTimeOffset? perfDataEndOn, AssessmentStage? stage, double? discountPercentage, AssessmentSizingCriterion? sizingCriterion, double? confidenceRatingInPercentage, DateTimeOffset? pricesQueriedOn, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, AssessmentStatus? status, string schemaVersion, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + AssessmentErrorSummary = assessmentErrorSummary; + MonthlyUltraStorageCost = monthlyUltraStorageCost; + CostComponents = costComponents; + EASubscriptionId = eaSubscriptionId; + AzurePricingTier = azurePricingTier; + AzureStorageRedundancy = azureStorageRedundancy; + ReservedInstance = reservedInstance; + AzureHybridUseBenefit = azureHybridUseBenefit; + AzureDiskTypes = azureDiskTypes; + AzureVmFamilies = azureVmFamilies; + DistributionBySupportStatus = distributionBySupportStatus; + DistributionByServicePackInsight = distributionByServicePackInsight; + DistributionByOSName = distributionByOSName; + MonthlyComputeCost = monthlyComputeCost; + MonthlyBandwidthCost = monthlyBandwidthCost; + MonthlyStorageCost = monthlyStorageCost; + MonthlyPremiumStorageCost = monthlyPremiumStorageCost; + MonthlyStandardSsdStorageCost = monthlyStandardSsdStorageCost; + SuitabilitySummary = suitabilitySummary; + NumberOfMachines = numberOfMachines; + VmUptime = vmUptime; + GroupType = groupType; + AssessmentType = assessmentType; + AzureLocation = azureLocation; + AzureOfferCode = azureOfferCode; + Currency = currency; + ScalingFactor = scalingFactor; + Percentile = percentile; + TimeRange = timeRange; + PerfDataStartOn = perfDataStartOn; + PerfDataEndOn = perfDataEndOn; + Stage = stage; + DiscountPercentage = discountPercentage; + SizingCriterion = sizingCriterion; + ConfidenceRatingInPercentage = confidenceRatingInPercentage; + PricesQueriedOn = pricesQueriedOn; + CreatedOn = createdOn; + UpdatedOn = updatedOn; + Status = status; + SchemaVersion = schemaVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The status of the last operation. + public MigrationAssessmentProvisioningState? ProvisioningState { get; set; } + /// + /// Gets or sets the assessment error summary. + /// This is the number of + /// machines affected by each type of error in this assessment. + /// + public IReadOnlyDictionary AssessmentErrorSummary { get; } + /// + /// Gets or sets the aggregate ultra storage cost for all machines in the + /// assessment. + /// + public double? MonthlyUltraStorageCost { get; } + /// Gets the collection of cost components. + public IReadOnlyList CostComponents { get; } + /// Gets or sets enterprise agreement subscription id. + public string EASubscriptionId { get; set; } + /// Gets or sets Azure Pricing Tier - Free, Basic, etc. + public AzurePricingTier? AzurePricingTier { get; set; } + /// Gets or sets the Azure Storage Redundancy. Example: Locally Redundant Storage. + public AzureStorageRedundancy? AzureStorageRedundancy { get; set; } + /// Gets or sets the Azure Reserved Instance - 1-Year, 3-Year. + public AzureReservedInstance? ReservedInstance { get; set; } + /// + /// Gets or sets the user configurable setting to display the azure hybrid use + /// benefit. + /// + public AzureHybridUseBenefit? AzureHybridUseBenefit { get; set; } + /// Gets or sets the azure storage type. Premium, Standard etc. + public IList AzureDiskTypes { get; } + /// Gets or sets the Azure VM families. + public IList AzureVmFamilies { get; } + /// Gets the distribution of sqlInstances by support status. + public IReadOnlyDictionary DistributionBySupportStatus { get; } + /// Gets the distribution distribution of sqlInstances by service pack insight. + public IReadOnlyDictionary DistributionByServicePackInsight { get; } + /// Gets the distribution by os name. + public IReadOnlyDictionary DistributionByOSName { get; } + /// Gets or sets the aggregate Compute Cost for all machines in the assessment. + public double? MonthlyComputeCost { get; } + /// Gets or sets the aggregate Bandwidth Cost for all machines in the assessment. + public double? MonthlyBandwidthCost { get; } + /// Gets or sets the aggregate Storage Cost for all machines in the assessment. + public double? MonthlyStorageCost { get; } + /// + /// Gets or sets the aggregate premium storage cost for all machines in the + /// assessment. + /// + public double? MonthlyPremiumStorageCost { get; } + /// + /// Gets or sets the aggregate standard SSD storage cost for all the machines in + /// the assessment. + /// + public double? MonthlyStandardSsdStorageCost { get; } + /// + /// Gets or sets the Cloud suitability summary for all the machines in the + /// assessment. + /// + public IReadOnlyDictionary SuitabilitySummary { get; } + /// Gets or sets the Number of machines part of the assessment. + public int? NumberOfMachines { get; } + /// + /// Gets or sets the duration for which the VMs are up in the on-premises + /// environment. + /// + public VmUptime VmUptime { get; set; } + /// Gets the group type for the assessment. + public MigrationAssessmentGroupType? GroupType { get; } + /// Assessment type of the assessment. + public AssessmentType? AssessmentType { get; } + /// Azure Location or Azure region where to which the machines will be migrated. + public AzureLocation? AzureLocation { get; set; } + /// Azure Offer Code. + public AzureOfferCode? AzureOfferCode { get; set; } + /// Currency in which prices should be reported. + public AzureCurrency? Currency { get; set; } + /// + /// Percentage of buffer that user wants on performance metrics when recommending + /// Azure sizes. + /// + public double? ScalingFactor { get; set; } + /// + /// Percentile of the utilization data values to be considered while assessing + /// machines. + /// + public PercentileOfUtilization? Percentile { get; set; } + /// + /// Time Range for which the historic utilization data should be considered for + /// assessment. + /// + public AssessmentTimeRange? TimeRange { get; set; } + /// Gets or sets the start time to consider performance data for assessment. + public DateTimeOffset? PerfDataStartOn { get; set; } + /// Gets or sets the end time to consider performance data for assessment. + public DateTimeOffset? PerfDataEndOn { get; set; } + /// User configurable setting to display the Stage of Assessment. + public AssessmentStage? Stage { get; } + /// Custom discount percentage. + public double? DiscountPercentage { get; set; } + /// Assessment sizing criterion. + public AssessmentSizingCriterion? SizingCriterion { get; set; } + /// Confidence Rating in Percentage. + public double? ConfidenceRatingInPercentage { get; } + /// Last time when rates were queried. + public DateTimeOffset? PricesQueriedOn { get; } + /// Date and Time when assessment was created. + public DateTimeOffset? CreatedOn { get; } + /// Date and Time when assessment was last updated. + public DateTimeOffset? UpdatedOn { get; } + /// Whether assessment is in valid state and all machines have been assessed. + public AssessmentStatus? Status { get; } + /// Schema version. + public string SchemaVersion { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentOptionCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentOptionCollection.cs new file mode 100644 index 000000000000..132825a24bc1 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentOptionCollection.cs @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMigrationAssessmentAssessmentOptions method from an instance of . + /// + public partial class MigrationAssessmentAssessmentOptionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsClientDiagnostics; + private readonly AssessmentOptionsRestOperations _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentAssessmentOptionCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MigrationAssessmentAssessmentOptionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", MigrationAssessmentAssessmentOptionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MigrationAssessmentAssessmentOptionResource.ResourceType, out string migrationAssessmentAssessmentOptionAssessmentOptionsOperationsApiVersion); + _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsRestClient = new AssessmentOptionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentAssessmentOptionAssessmentOptionsOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MigrationAssessmentAssessmentProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MigrationAssessmentAssessmentProjectResource.ResourceType), nameof(id)); + } + + /// + /// Get a AssessmentOptions + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessmentOptions/{assessmentOptionsName} + /// + /// + /// Operation Id + /// AssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// assessment options ARM name. Accepted value is 'default'. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string assessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentOptionsName, nameof(assessmentOptionsName)); + + using var scope = _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentOptionCollection.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assessmentOptionsName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAssessmentOptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AssessmentOptions + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessmentOptions/{assessmentOptionsName} + /// + /// + /// Operation Id + /// AssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// assessment options ARM name. Accepted value is 'default'. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string assessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentOptionsName, nameof(assessmentOptionsName)); + + using var scope = _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentOptionCollection.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assessmentOptionsName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAssessmentOptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List AssessmentOptions resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessmentOptions + /// + /// + /// Operation Id + /// AssessmentOptionsOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentAssessmentOptionResource(Client, MigrationAssessmentAssessmentOptionData.DeserializeMigrationAssessmentAssessmentOptionData(e)), _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsClientDiagnostics, Pipeline, "MigrationAssessmentAssessmentOptionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List AssessmentOptions resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessmentOptions + /// + /// + /// Operation Id + /// AssessmentOptionsOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentAssessmentOptionResource(Client, MigrationAssessmentAssessmentOptionData.DeserializeMigrationAssessmentAssessmentOptionData(e)), _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsClientDiagnostics, Pipeline, "MigrationAssessmentAssessmentOptionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessmentOptions/{assessmentOptionsName} + /// + /// + /// Operation Id + /// AssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// assessment options ARM name. Accepted value is 'default'. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string assessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentOptionsName, nameof(assessmentOptionsName)); + + using var scope = _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentOptionCollection.Exists"); + scope.Start(); + try + { + var response = await _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assessmentOptionsName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessmentOptions/{assessmentOptionsName} + /// + /// + /// Operation Id + /// AssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// assessment options ARM name. Accepted value is 'default'. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string assessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentOptionsName, nameof(assessmentOptionsName)); + + using var scope = _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentOptionCollection.Exists"); + scope.Start(); + try + { + var response = _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assessmentOptionsName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessmentOptions/{assessmentOptionsName} + /// + /// + /// Operation Id + /// AssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// assessment options ARM name. Accepted value is 'default'. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string assessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentOptionsName, nameof(assessmentOptionsName)); + + using var scope = _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentOptionCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assessmentOptionsName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAssessmentOptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessmentOptions/{assessmentOptionsName} + /// + /// + /// Operation Id + /// AssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// assessment options ARM name. Accepted value is 'default'. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string assessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentOptionsName, nameof(assessmentOptionsName)); + + using var scope = _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentOptionCollection.GetIfExists"); + scope.Start(); + try + { + var response = _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assessmentOptionsName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAssessmentOptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentOptionData.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentOptionData.Serialization.cs new file mode 100644 index 000000000000..9e7e5f76a601 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentOptionData.Serialization.cs @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentAssessmentOptionData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentAssessmentOptionData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsCollectionDefined(VmFamilies)) + { + writer.WritePropertyName("vmFamilies"u8); + writer.WriteStartArray(); + foreach (var item in VmFamilies) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ReservedInstanceVmFamilies)) + { + writer.WritePropertyName("reservedInstanceVmFamilies"u8); + writer.WriteStartArray(); + foreach (var item in ReservedInstanceVmFamilies) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ReservedInstanceSupportedLocations)) + { + writer.WritePropertyName("reservedInstanceSupportedLocations"u8); + writer.WriteStartArray(); + foreach (var item in ReservedInstanceSupportedLocations) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ReservedInstanceSupportedCurrencies)) + { + writer.WritePropertyName("reservedInstanceSupportedCurrencies"u8); + writer.WriteStartArray(); + foreach (var item in ReservedInstanceSupportedCurrencies) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ReservedInstanceSupportedOffers)) + { + writer.WritePropertyName("reservedInstanceSupportedOffers"u8); + writer.WriteStartArray(); + foreach (var item in ReservedInstanceSupportedOffers) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(UltraDiskVmFamilies)) + { + writer.WritePropertyName("ultraDiskVmFamilies"u8); + writer.WriteStartArray(); + foreach (var item in UltraDiskVmFamilies) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(PremiumDiskVmFamilies)) + { + writer.WritePropertyName("premiumDiskVmFamilies"u8); + writer.WriteStartArray(); + foreach (var item in PremiumDiskVmFamilies) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(SavingsPlanVmFamilies)) + { + writer.WritePropertyName("savingsPlanVmFamilies"u8); + writer.WriteStartArray(); + foreach (var item in SavingsPlanVmFamilies) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(SavingsPlanSupportedLocations)) + { + writer.WritePropertyName("savingsPlanSupportedLocations"u8); + writer.WriteStartArray(); + foreach (var item in SavingsPlanSupportedLocations) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + MigrationAssessmentAssessmentOptionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentAssessmentOptionData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentAssessmentOptionData(document.RootElement, options); + } + + internal static MigrationAssessmentAssessmentOptionData DeserializeMigrationAssessmentAssessmentOptionData(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; + IReadOnlyList vmFamilies = default; + IReadOnlyList reservedInstanceVmFamilies = default; + IReadOnlyList reservedInstanceSupportedLocations = default; + IReadOnlyList reservedInstanceSupportedCurrencies = default; + IReadOnlyList reservedInstanceSupportedOffers = default; + IReadOnlyList ultraDiskVmFamilies = default; + IReadOnlyList premiumDiskVmFamilies = default; + IReadOnlyList savingsPlanVmFamilies = default; + IReadOnlyList savingsPlanSupportedLocations = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(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("vmFamilies"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(VmFamilyConfig.DeserializeVmFamilyConfig(item, options)); + } + vmFamilies = array; + continue; + } + if (property0.NameEquals("reservedInstanceVmFamilies"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + reservedInstanceVmFamilies = array; + continue; + } + if (property0.NameEquals("reservedInstanceSupportedLocations"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + reservedInstanceSupportedLocations = array; + continue; + } + if (property0.NameEquals("reservedInstanceSupportedCurrencies"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + reservedInstanceSupportedCurrencies = array; + continue; + } + if (property0.NameEquals("reservedInstanceSupportedOffers"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + reservedInstanceSupportedOffers = array; + continue; + } + if (property0.NameEquals("ultraDiskVmFamilies"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(UltraDiskAssessmentConfig.DeserializeUltraDiskAssessmentConfig(item, options)); + } + ultraDiskVmFamilies = array; + continue; + } + if (property0.NameEquals("premiumDiskVmFamilies"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + premiumDiskVmFamilies = array; + continue; + } + if (property0.NameEquals("savingsPlanVmFamilies"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + savingsPlanVmFamilies = array; + continue; + } + if (property0.NameEquals("savingsPlanSupportedLocations"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + savingsPlanSupportedLocations = array; + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentAssessmentOptionData( + id, + name, + type, + systemData, + vmFamilies ?? new ChangeTrackingList(), + reservedInstanceVmFamilies ?? new ChangeTrackingList(), + reservedInstanceSupportedLocations ?? new ChangeTrackingList(), + reservedInstanceSupportedCurrencies ?? new ChangeTrackingList(), + reservedInstanceSupportedOffers ?? new ChangeTrackingList(), + ultraDiskVmFamilies ?? new ChangeTrackingList(), + premiumDiskVmFamilies ?? new ChangeTrackingList(), + savingsPlanVmFamilies ?? new ChangeTrackingList(), + savingsPlanSupportedLocations ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentAssessmentOptionData)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentAssessmentOptionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentAssessmentOptionData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentAssessmentOptionData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentOptionData.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentOptionData.cs new file mode 100644 index 000000000000..0de6fa984c3d --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentOptionData.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing the MigrationAssessmentAssessmentOption data model. + /// Assessment options resource. + /// + public partial class MigrationAssessmentAssessmentOptionData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MigrationAssessmentAssessmentOptionData() + { + VmFamilies = new ChangeTrackingList(); + ReservedInstanceVmFamilies = new ChangeTrackingList(); + ReservedInstanceSupportedLocations = new ChangeTrackingList(); + ReservedInstanceSupportedCurrencies = new ChangeTrackingList(); + ReservedInstanceSupportedOffers = new ChangeTrackingList(); + UltraDiskVmFamilies = new ChangeTrackingList(); + PremiumDiskVmFamilies = new ChangeTrackingList(); + SavingsPlanVmFamilies = new ChangeTrackingList(); + SavingsPlanSupportedLocations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// Dictionary of VM families grouped by vm family name describing the targeted + /// azure locations of VM family and the category of the family. + /// + /// List of supported VM Families. + /// List of supported Azure regions for reserved instances. + /// List of supported currencies for reserved instances. + /// List of supported Azure offer codes for reserved instances. + /// Ultra disk related assessment options. + /// List of VM Families that support premium disks for assessments. + /// List of VM Families that support Savings plan offer for assessments. + /// List of Azure locations that support Savings plan offer for assessments. + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentAssessmentOptionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IReadOnlyList vmFamilies, IReadOnlyList reservedInstanceVmFamilies, IReadOnlyList reservedInstanceSupportedLocations, IReadOnlyList reservedInstanceSupportedCurrencies, IReadOnlyList reservedInstanceSupportedOffers, IReadOnlyList ultraDiskVmFamilies, IReadOnlyList premiumDiskVmFamilies, IReadOnlyList savingsPlanVmFamilies, IReadOnlyList savingsPlanSupportedLocations, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + VmFamilies = vmFamilies; + ReservedInstanceVmFamilies = reservedInstanceVmFamilies; + ReservedInstanceSupportedLocations = reservedInstanceSupportedLocations; + ReservedInstanceSupportedCurrencies = reservedInstanceSupportedCurrencies; + ReservedInstanceSupportedOffers = reservedInstanceSupportedOffers; + UltraDiskVmFamilies = ultraDiskVmFamilies; + PremiumDiskVmFamilies = premiumDiskVmFamilies; + SavingsPlanVmFamilies = savingsPlanVmFamilies; + SavingsPlanSupportedLocations = savingsPlanSupportedLocations; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Dictionary of VM families grouped by vm family name describing the targeted + /// azure locations of VM family and the category of the family. + /// + public IReadOnlyList VmFamilies { get; } + /// List of supported VM Families. + public IReadOnlyList ReservedInstanceVmFamilies { get; } + /// List of supported Azure regions for reserved instances. + public IReadOnlyList ReservedInstanceSupportedLocations { get; } + /// List of supported currencies for reserved instances. + public IReadOnlyList ReservedInstanceSupportedCurrencies { get; } + /// List of supported Azure offer codes for reserved instances. + public IReadOnlyList ReservedInstanceSupportedOffers { get; } + /// Ultra disk related assessment options. + public IReadOnlyList UltraDiskVmFamilies { get; } + /// List of VM Families that support premium disks for assessments. + public IReadOnlyList PremiumDiskVmFamilies { get; } + /// List of VM Families that support Savings plan offer for assessments. + public IReadOnlyList SavingsPlanVmFamilies { get; } + /// List of Azure locations that support Savings plan offer for assessments. + public IReadOnlyList SavingsPlanSupportedLocations { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentOptionResource.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentOptionResource.Serialization.cs new file mode 100644 index 000000000000..bc03527a51af --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentOptionResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentAssessmentOptionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MigrationAssessmentAssessmentOptionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MigrationAssessmentAssessmentOptionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentOptionResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentOptionResource.cs new file mode 100644 index 000000000000..ab29c2127567 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentOptionResource.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A Class representing a MigrationAssessmentAssessmentOption along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMigrationAssessmentAssessmentOptionResource method. + /// Otherwise you can get one from its parent resource using the GetMigrationAssessmentAssessmentOption method. + /// + public partial class MigrationAssessmentAssessmentOptionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The assessmentOptionsName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string assessmentOptionsName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessmentOptions/{assessmentOptionsName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsClientDiagnostics; + private readonly AssessmentOptionsRestOperations _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsRestClient; + private readonly MigrationAssessmentAssessmentOptionData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/assessmentOptions"; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentAssessmentOptionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MigrationAssessmentAssessmentOptionResource(ArmClient client, MigrationAssessmentAssessmentOptionData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MigrationAssessmentAssessmentOptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string migrationAssessmentAssessmentOptionAssessmentOptionsOperationsApiVersion); + _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsRestClient = new AssessmentOptionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentAssessmentOptionAssessmentOptionsOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MigrationAssessmentAssessmentOptionData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a AssessmentOptions + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessmentOptions/{assessmentOptionsName} + /// + /// + /// Operation Id + /// AssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentOptionResource.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAssessmentOptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AssessmentOptions + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessmentOptions/{assessmentOptionsName} + /// + /// + /// Operation Id + /// AssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentOptionResource.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentAssessmentOptionAssessmentOptionsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAssessmentOptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectCollection.cs new file mode 100644 index 000000000000..1d8563b77b5f --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectCollection.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMigrationAssessmentAssessmentProjects method from an instance of . + /// + public partial class MigrationAssessmentAssessmentProjectCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics; + private readonly AssessmentProjectsRestOperations _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentAssessmentProjectCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MigrationAssessmentAssessmentProjectCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", MigrationAssessmentAssessmentProjectResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MigrationAssessmentAssessmentProjectResource.ResourceType, out string migrationAssessmentAssessmentProjectAssessmentProjectsOperationsApiVersion); + _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient = new AssessmentProjectsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentAssessmentProjectAssessmentProjectsOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Create a AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Assessment Project Name. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string projectName, MigrationAssessmentAssessmentProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, projectName, data, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new MigrationAssessmentAssessmentProjectOperationSource(Client), _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics, Pipeline, _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, projectName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Assessment Project Name. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string projectName, MigrationAssessmentAssessmentProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, projectName, data, cancellationToken); + var operation = new AssessmentArmOperation(new MigrationAssessmentAssessmentProjectOperationSource(Client), _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics, Pipeline, _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, projectName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Assessment Project Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectCollection.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, projectName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAssessmentProjectResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Assessment Project Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectCollection.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, projectName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAssessmentProjectResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List AssessmentProject resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentAssessmentProjectResource(Client, MigrationAssessmentAssessmentProjectData.DeserializeMigrationAssessmentAssessmentProjectData(e)), _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics, Pipeline, "MigrationAssessmentAssessmentProjectCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List AssessmentProject resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentAssessmentProjectResource(Client, MigrationAssessmentAssessmentProjectData.DeserializeMigrationAssessmentAssessmentProjectData(e)), _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics, Pipeline, "MigrationAssessmentAssessmentProjectCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Assessment Project Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectCollection.Exists"); + scope.Start(); + try + { + var response = await _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, projectName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Assessment Project Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectCollection.Exists"); + scope.Start(); + try + { + var response = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, projectName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Assessment Project Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, projectName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAssessmentProjectResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Assessment Project Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectCollection.GetIfExists"); + scope.Start(); + try + { + var response = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, projectName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAssessmentProjectResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectData.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectData.Serialization.cs new file mode 100644 index 000000000000..fe87c084ac9f --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectData.Serialization.cs @@ -0,0 +1,343 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentAssessmentProjectData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentAssessmentProjectData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(CreateOn)) + { + writer.WritePropertyName("createdTimestamp"u8); + writer.WriteStringValue(CreateOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(UpdatedOn)) + { + writer.WritePropertyName("updatedTimestamp"u8); + writer.WriteStringValue(UpdatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(ServiceEndpoint)) + { + writer.WritePropertyName("serviceEndpoint"u8); + writer.WriteStringValue(ServiceEndpoint); + } + if (Optional.IsDefined(AssessmentSolutionId)) + { + writer.WritePropertyName("assessmentSolutionId"u8); + writer.WriteStringValue(AssessmentSolutionId); + } + if (Optional.IsDefined(ProjectStatus)) + { + writer.WritePropertyName("projectStatus"u8); + writer.WriteStringValue(ProjectStatus.Value.ToString()); + } + if (Optional.IsDefined(CustomerWorkspaceId)) + { + writer.WritePropertyName("customerWorkspaceId"u8); + writer.WriteStringValue(CustomerWorkspaceId); + } + if (Optional.IsDefined(CustomerWorkspaceLocation)) + { + writer.WritePropertyName("customerWorkspaceLocation"u8); + writer.WriteStringValue(CustomerWorkspaceLocation); + } + if (Optional.IsDefined(PublicNetworkAccess)) + { + writer.WritePropertyName("publicNetworkAccess"u8); + writer.WriteStringValue(PublicNetworkAccess); + } + if (options.Format != "W" && Optional.IsCollectionDefined(PrivateEndpointConnections)) + { + writer.WritePropertyName("privateEndpointConnections"u8); + writer.WriteStartArray(); + foreach (var item in PrivateEndpointConnections) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(CustomerStorageAccountArmId)) + { + writer.WritePropertyName("customerStorageAccountArmId"u8); + writer.WriteStringValue(CustomerStorageAccountArmId); + } + writer.WriteEndObject(); + } + + MigrationAssessmentAssessmentProjectData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentAssessmentProjectData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentAssessmentProjectData(document.RootElement, options); + } + + internal static MigrationAssessmentAssessmentProjectData DeserializeMigrationAssessmentAssessmentProjectData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + MigrationAssessmentProvisioningState? provisioningState = default; + DateTimeOffset? createdTimestamp = default; + DateTimeOffset? updatedTimestamp = default; + string serviceEndpoint = default; + string assessmentSolutionId = default; + AssessmentProjectStatus? projectStatus = default; + string customerWorkspaceId = default; + string customerWorkspaceLocation = default; + string publicNetworkAccess = default; + IReadOnlyList privateEndpointConnections = default; + ResourceIdentifier customerStorageAccountArmId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + 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(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("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new MigrationAssessmentProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("createdTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("updatedTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("serviceEndpoint"u8)) + { + serviceEndpoint = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("assessmentSolutionId"u8)) + { + assessmentSolutionId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("projectStatus"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + projectStatus = new AssessmentProjectStatus(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("customerWorkspaceId"u8)) + { + customerWorkspaceId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("customerWorkspaceLocation"u8)) + { + customerWorkspaceLocation = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("publicNetworkAccess"u8)) + { + publicNetworkAccess = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("privateEndpointConnections"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(MigrationAssessmentPrivateEndpointConnectionData.DeserializeMigrationAssessmentPrivateEndpointConnectionData(item, options)); + } + privateEndpointConnections = array; + continue; + } + if (property0.NameEquals("customerStorageAccountArmId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customerStorageAccountArmId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentAssessmentProjectData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + provisioningState, + createdTimestamp, + updatedTimestamp, + serviceEndpoint, + assessmentSolutionId, + projectStatus, + customerWorkspaceId, + customerWorkspaceLocation, + publicNetworkAccess, + privateEndpointConnections ?? new ChangeTrackingList(), + customerStorageAccountArmId, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentAssessmentProjectData)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentAssessmentProjectData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentAssessmentProjectData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentAssessmentProjectData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectData.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectData.cs new file mode 100644 index 000000000000..e387420ac602 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectData.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing the MigrationAssessmentAssessmentProject data model. + /// An Assessment project site resource. + /// + public partial class MigrationAssessmentAssessmentProjectData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public MigrationAssessmentAssessmentProjectData(AzureLocation location) : base(location) + { + PrivateEndpointConnections = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The status of the last operation. + /// Time when this project was created. Date-Time represented in ISO-8601 format. + /// + /// Time when this project was last updated. Date-Time represented in ISO-8601 + /// format. + /// + /// Endpoint at which the collector agent can call agent REST API. + /// Assessment solution ARM id tracked by Microsoft.Migrate/migrateProjects. + /// Assessment project status. + /// The ARM id of service map workspace created by customer. + /// Location of service map workspace created by customer. + /// + /// This value can be set to 'enabled' to avoid breaking changes on existing + /// customer resources and templates. If set to 'disabled', traffic over public + /// interface is not allowed, and private endpoint connections would be the + /// exclusive access method. + /// + /// The list of private endpoint connections to the project. + /// + /// The ARM id of the storage account used for interactions when public access is + /// disabled. + /// + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentAssessmentProjectData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MigrationAssessmentProvisioningState? provisioningState, DateTimeOffset? createOn, DateTimeOffset? updatedOn, string serviceEndpoint, string assessmentSolutionId, AssessmentProjectStatus? projectStatus, string customerWorkspaceId, string customerWorkspaceLocation, string publicNetworkAccess, IReadOnlyList privateEndpointConnections, ResourceIdentifier customerStorageAccountArmId, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + ProvisioningState = provisioningState; + CreateOn = createOn; + UpdatedOn = updatedOn; + ServiceEndpoint = serviceEndpoint; + AssessmentSolutionId = assessmentSolutionId; + ProjectStatus = projectStatus; + CustomerWorkspaceId = customerWorkspaceId; + CustomerWorkspaceLocation = customerWorkspaceLocation; + PublicNetworkAccess = publicNetworkAccess; + PrivateEndpointConnections = privateEndpointConnections; + CustomerStorageAccountArmId = customerStorageAccountArmId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MigrationAssessmentAssessmentProjectData() + { + } + + /// The status of the last operation. + public MigrationAssessmentProvisioningState? ProvisioningState { get; set; } + /// Time when this project was created. Date-Time represented in ISO-8601 format. + public DateTimeOffset? CreateOn { get; } + /// + /// Time when this project was last updated. Date-Time represented in ISO-8601 + /// format. + /// + public DateTimeOffset? UpdatedOn { get; } + /// Endpoint at which the collector agent can call agent REST API. + public string ServiceEndpoint { get; } + /// Assessment solution ARM id tracked by Microsoft.Migrate/migrateProjects. + public string AssessmentSolutionId { get; set; } + /// Assessment project status. + public AssessmentProjectStatus? ProjectStatus { get; set; } + /// The ARM id of service map workspace created by customer. + public string CustomerWorkspaceId { get; set; } + /// Location of service map workspace created by customer. + public string CustomerWorkspaceLocation { get; set; } + /// + /// This value can be set to 'enabled' to avoid breaking changes on existing + /// customer resources and templates. If set to 'disabled', traffic over public + /// interface is not allowed, and private endpoint connections would be the + /// exclusive access method. + /// + public string PublicNetworkAccess { get; set; } + /// The list of private endpoint connections to the project. + public IReadOnlyList PrivateEndpointConnections { get; } + /// + /// The ARM id of the storage account used for interactions when public access is + /// disabled. + /// + public ResourceIdentifier CustomerStorageAccountArmId { get; set; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectResource.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectResource.Serialization.cs new file mode 100644 index 000000000000..9dc1d1d588c5 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentAssessmentProjectResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MigrationAssessmentAssessmentProjectData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MigrationAssessmentAssessmentProjectData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectResource.cs new file mode 100644 index 000000000000..0e40d79706ed --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectResource.cs @@ -0,0 +1,1608 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A Class representing a MigrationAssessmentAssessmentProject along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMigrationAssessmentAssessmentProjectResource method. + /// Otherwise you can get one from its parent resource using the GetMigrationAssessmentAssessmentProject method. + /// + public partial class MigrationAssessmentAssessmentProjectResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics; + private readonly AssessmentProjectsRestOperations _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient; + private readonly MigrationAssessmentAssessmentProjectData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects"; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentAssessmentProjectResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MigrationAssessmentAssessmentProjectResource(ArmClient client, MigrationAssessmentAssessmentProjectData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MigrationAssessmentAssessmentProjectResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string migrationAssessmentAssessmentProjectAssessmentProjectsOperationsApiVersion); + _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient = new AssessmentProjectsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentAssessmentProjectAssessmentProjectsOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MigrationAssessmentAssessmentProjectData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of MigrationAssessmentAssessmentOptionResources in the MigrationAssessmentAssessmentProject. + /// An object representing collection of MigrationAssessmentAssessmentOptionResources and their operations over a MigrationAssessmentAssessmentOptionResource. + public virtual MigrationAssessmentAssessmentOptionCollection GetMigrationAssessmentAssessmentOptions() + { + return GetCachedClient(client => new MigrationAssessmentAssessmentOptionCollection(client, Id)); + } + + /// + /// Get a AssessmentOptions + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessmentOptions/{assessmentOptionsName} + /// + /// + /// Operation Id + /// AssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// assessment options ARM name. Accepted value is 'default'. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMigrationAssessmentAssessmentOptionAsync(string assessmentOptionsName, CancellationToken cancellationToken = default) + { + return await GetMigrationAssessmentAssessmentOptions().GetAsync(assessmentOptionsName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AssessmentOptions + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessmentOptions/{assessmentOptionsName} + /// + /// + /// Operation Id + /// AssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// assessment options ARM name. Accepted value is 'default'. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMigrationAssessmentAssessmentOption(string assessmentOptionsName, CancellationToken cancellationToken = default) + { + return GetMigrationAssessmentAssessmentOptions().Get(assessmentOptionsName, cancellationToken); + } + + /// Gets a collection of MigrationAssessmentAvsAssessmentOptionResources in the MigrationAssessmentAssessmentProject. + /// An object representing collection of MigrationAssessmentAvsAssessmentOptionResources and their operations over a MigrationAssessmentAvsAssessmentOptionResource. + public virtual MigrationAssessmentAvsAssessmentOptionCollection GetMigrationAssessmentAvsAssessmentOptions() + { + return GetCachedClient(client => new MigrationAssessmentAvsAssessmentOptionCollection(client, Id)); + } + + /// + /// Get a AvsAssessmentOptions + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/avsAssessmentOptions/{avsAssessmentOptionsName} + /// + /// + /// Operation Id + /// AvsAssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// AVS Assessment options ARM name. Accepted value is 'default'. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMigrationAssessmentAvsAssessmentOptionAsync(string avsAssessmentOptionsName, CancellationToken cancellationToken = default) + { + return await GetMigrationAssessmentAvsAssessmentOptions().GetAsync(avsAssessmentOptionsName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AvsAssessmentOptions + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/avsAssessmentOptions/{avsAssessmentOptionsName} + /// + /// + /// Operation Id + /// AvsAssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// AVS Assessment options ARM name. Accepted value is 'default'. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMigrationAssessmentAvsAssessmentOption(string avsAssessmentOptionsName, CancellationToken cancellationToken = default) + { + return GetMigrationAssessmentAvsAssessmentOptions().Get(avsAssessmentOptionsName, cancellationToken); + } + + /// Gets a collection of MigrationAssessmentGroupResources in the MigrationAssessmentAssessmentProject. + /// An object representing collection of MigrationAssessmentGroupResources and their operations over a MigrationAssessmentGroupResource. + public virtual MigrationAssessmentGroupCollection GetMigrationAssessmentGroups() + { + return GetCachedClient(client => new MigrationAssessmentGroupCollection(client, Id)); + } + + /// + /// Get a Group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// + /// + /// Operation Id + /// GroupsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Group ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMigrationAssessmentGroupAsync(string groupName, CancellationToken cancellationToken = default) + { + return await GetMigrationAssessmentGroups().GetAsync(groupName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// + /// + /// Operation Id + /// GroupsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Group ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMigrationAssessmentGroup(string groupName, CancellationToken cancellationToken = default) + { + return GetMigrationAssessmentGroups().Get(groupName, cancellationToken); + } + + /// Gets a collection of MigrationAssessmentHyperVCollectorResources in the MigrationAssessmentAssessmentProject. + /// An object representing collection of MigrationAssessmentHyperVCollectorResources and their operations over a MigrationAssessmentHyperVCollectorResource. + public virtual MigrationAssessmentHyperVCollectorCollection GetMigrationAssessmentHyperVCollectors() + { + return GetCachedClient(client => new MigrationAssessmentHyperVCollectorCollection(client, Id)); + } + + /// + /// Get a HypervCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hypervCollectorName} + /// + /// + /// Operation Id + /// HypervCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Hyper-V collector ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMigrationAssessmentHyperVCollectorAsync(string hyperVCollectorName, CancellationToken cancellationToken = default) + { + return await GetMigrationAssessmentHyperVCollectors().GetAsync(hyperVCollectorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a HypervCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hypervCollectorName} + /// + /// + /// Operation Id + /// HypervCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Hyper-V collector ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMigrationAssessmentHyperVCollector(string hyperVCollectorName, CancellationToken cancellationToken = default) + { + return GetMigrationAssessmentHyperVCollectors().Get(hyperVCollectorName, cancellationToken); + } + + /// Gets a collection of MigrationAssessmentImportCollectorResources in the MigrationAssessmentAssessmentProject. + /// An object representing collection of MigrationAssessmentImportCollectorResources and their operations over a MigrationAssessmentImportCollectorResource. + public virtual MigrationAssessmentImportCollectorCollection GetMigrationAssessmentImportCollectors() + { + return GetCachedClient(client => new MigrationAssessmentImportCollectorCollection(client, Id)); + } + + /// + /// Get a ImportCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// + /// + /// Operation Id + /// ImportCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Import collector ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMigrationAssessmentImportCollectorAsync(string importCollectorName, CancellationToken cancellationToken = default) + { + return await GetMigrationAssessmentImportCollectors().GetAsync(importCollectorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a ImportCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// + /// + /// Operation Id + /// ImportCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Import collector ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMigrationAssessmentImportCollector(string importCollectorName, CancellationToken cancellationToken = default) + { + return GetMigrationAssessmentImportCollectors().Get(importCollectorName, cancellationToken); + } + + /// Gets a collection of MigrationAssessmentMachineResources in the MigrationAssessmentAssessmentProject. + /// An object representing collection of MigrationAssessmentMachineResources and their operations over a MigrationAssessmentMachineResource. + public virtual MigrationAssessmentMachineCollection GetMigrationAssessmentMachines() + { + return GetCachedClient(client => new MigrationAssessmentMachineCollection(client, Id)); + } + + /// + /// Get a Machine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/machines/{machineName} + /// + /// + /// Operation Id + /// MachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Assessible Machine ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMigrationAssessmentMachineAsync(string machineName, CancellationToken cancellationToken = default) + { + return await GetMigrationAssessmentMachines().GetAsync(machineName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Machine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/machines/{machineName} + /// + /// + /// Operation Id + /// MachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Assessible Machine ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMigrationAssessmentMachine(string machineName, CancellationToken cancellationToken = default) + { + return GetMigrationAssessmentMachines().Get(machineName, cancellationToken); + } + + /// Gets a collection of MigrationAssessmentPrivateEndpointConnectionResources in the MigrationAssessmentAssessmentProject. + /// An object representing collection of MigrationAssessmentPrivateEndpointConnectionResources and their operations over a MigrationAssessmentPrivateEndpointConnectionResource. + public virtual MigrationAssessmentPrivateEndpointConnectionCollection GetMigrationAssessmentPrivateEndpointConnections() + { + return GetCachedClient(client => new MigrationAssessmentPrivateEndpointConnectionCollection(client, Id)); + } + + /// + /// Get a PrivateEndpointConnection + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Private endpoint connection ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMigrationAssessmentPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + return await GetMigrationAssessmentPrivateEndpointConnections().GetAsync(privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a PrivateEndpointConnection + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Private endpoint connection ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMigrationAssessmentPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + return GetMigrationAssessmentPrivateEndpointConnections().Get(privateEndpointConnectionName, cancellationToken); + } + + /// Gets a collection of MigrationAssessmentPrivateLinkResources in the MigrationAssessmentAssessmentProject. + /// An object representing collection of MigrationAssessmentPrivateLinkResources and their operations over a MigrationAssessmentPrivateLinkResource. + public virtual MigrationAssessmentPrivateLinkResourceCollection GetMigrationAssessmentPrivateLinkResources() + { + return GetCachedClient(client => new MigrationAssessmentPrivateLinkResourceCollection(client, Id)); + } + + /// + /// Get a PrivateLinkResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResourceOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Private link resource ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMigrationAssessmentPrivateLinkResourceAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + return await GetMigrationAssessmentPrivateLinkResources().GetAsync(privateLinkResourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a PrivateLinkResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResourceOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Private link resource ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMigrationAssessmentPrivateLinkResource(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + return GetMigrationAssessmentPrivateLinkResources().Get(privateLinkResourceName, cancellationToken); + } + + /// Gets a collection of MigrationAssessmentAssessmentProjectSummaryResources in the MigrationAssessmentAssessmentProject. + /// An object representing collection of MigrationAssessmentAssessmentProjectSummaryResources and their operations over a MigrationAssessmentAssessmentProjectSummaryResource. + public virtual MigrationAssessmentAssessmentProjectSummaryCollection GetMigrationAssessmentAssessmentProjectSummaries() + { + return GetCachedClient(client => new MigrationAssessmentAssessmentProjectSummaryCollection(client, Id)); + } + + /// + /// Get a AssessmentProjectSummary + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/projectSummary/{projectSummaryName} + /// + /// + /// Operation Id + /// AssessmentProjectSummaryOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Group ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMigrationAssessmentAssessmentProjectSummaryAsync(string projectSummaryName, CancellationToken cancellationToken = default) + { + return await GetMigrationAssessmentAssessmentProjectSummaries().GetAsync(projectSummaryName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AssessmentProjectSummary + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/projectSummary/{projectSummaryName} + /// + /// + /// Operation Id + /// AssessmentProjectSummaryOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Group ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMigrationAssessmentAssessmentProjectSummary(string projectSummaryName, CancellationToken cancellationToken = default) + { + return GetMigrationAssessmentAssessmentProjectSummaries().Get(projectSummaryName, cancellationToken); + } + + /// Gets a collection of MigrationAssessmentServerCollectorResources in the MigrationAssessmentAssessmentProject. + /// An object representing collection of MigrationAssessmentServerCollectorResources and their operations over a MigrationAssessmentServerCollectorResource. + public virtual MigrationAssessmentServerCollectorCollection GetMigrationAssessmentServerCollectors() + { + return GetCachedClient(client => new MigrationAssessmentServerCollectorCollection(client, Id)); + } + + /// + /// Get a ServerCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// + /// + /// Operation Id + /// ServerCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Physical server collector ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMigrationAssessmentServerCollectorAsync(string serverCollectorName, CancellationToken cancellationToken = default) + { + return await GetMigrationAssessmentServerCollectors().GetAsync(serverCollectorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a ServerCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// + /// + /// Operation Id + /// ServerCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Physical server collector ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMigrationAssessmentServerCollector(string serverCollectorName, CancellationToken cancellationToken = default) + { + return GetMigrationAssessmentServerCollectors().Get(serverCollectorName, cancellationToken); + } + + /// Gets a collection of MigrationAssessmentSqlAssessmentOptionResources in the MigrationAssessmentAssessmentProject. + /// An object representing collection of MigrationAssessmentSqlAssessmentOptionResources and their operations over a MigrationAssessmentSqlAssessmentOptionResource. + public virtual MigrationAssessmentSqlAssessmentOptionCollection GetMigrationAssessmentSqlAssessmentOptions() + { + return GetCachedClient(client => new MigrationAssessmentSqlAssessmentOptionCollection(client, Id)); + } + + /// + /// Get a SqlAssessmentOptions + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessmentOptions/{assessmentOptionsName} + /// + /// + /// Operation Id + /// SqlAssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment options ARM name. Accepted values is 'default'. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMigrationAssessmentSqlAssessmentOptionAsync(string assessmentOptionsName, CancellationToken cancellationToken = default) + { + return await GetMigrationAssessmentSqlAssessmentOptions().GetAsync(assessmentOptionsName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a SqlAssessmentOptions + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessmentOptions/{assessmentOptionsName} + /// + /// + /// Operation Id + /// SqlAssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment options ARM name. Accepted values is 'default'. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMigrationAssessmentSqlAssessmentOption(string assessmentOptionsName, CancellationToken cancellationToken = default) + { + return GetMigrationAssessmentSqlAssessmentOptions().Get(assessmentOptionsName, cancellationToken); + } + + /// Gets a collection of MigrationAssessmentSqlCollectorResources in the MigrationAssessmentAssessmentProject. + /// An object representing collection of MigrationAssessmentSqlCollectorResources and their operations over a MigrationAssessmentSqlCollectorResource. + public virtual MigrationAssessmentSqlCollectorCollection GetMigrationAssessmentSqlCollectors() + { + return GetCachedClient(client => new MigrationAssessmentSqlCollectorCollection(client, Id)); + } + + /// + /// Get a SqlCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlcollectors/{collectorName} + /// + /// + /// Operation Id + /// SqlCollectorOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql collector ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMigrationAssessmentSqlCollectorAsync(string collectorName, CancellationToken cancellationToken = default) + { + return await GetMigrationAssessmentSqlCollectors().GetAsync(collectorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a SqlCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlcollectors/{collectorName} + /// + /// + /// Operation Id + /// SqlCollectorOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql collector ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMigrationAssessmentSqlCollector(string collectorName, CancellationToken cancellationToken = default) + { + return GetMigrationAssessmentSqlCollectors().Get(collectorName, cancellationToken); + } + + /// Gets a collection of MigrationAssessmentVMwareCollectorResources in the MigrationAssessmentAssessmentProject. + /// An object representing collection of MigrationAssessmentVMwareCollectorResources and their operations over a MigrationAssessmentVMwareCollectorResource. + public virtual MigrationAssessmentVMwareCollectorCollection GetMigrationAssessmentVMwareCollectors() + { + return GetCachedClient(client => new MigrationAssessmentVMwareCollectorCollection(client, Id)); + } + + /// + /// Get a VmwareCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// + /// + /// Operation Id + /// VmwareCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// VMware collector ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMigrationAssessmentVMwareCollectorAsync(string vmWareCollectorName, CancellationToken cancellationToken = default) + { + return await GetMigrationAssessmentVMwareCollectors().GetAsync(vmWareCollectorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a VmwareCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// + /// + /// Operation Id + /// VmwareCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// VMware collector ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMigrationAssessmentVMwareCollector(string vmWareCollectorName, CancellationToken cancellationToken = default) + { + return GetMigrationAssessmentVMwareCollectors().Get(vmWareCollectorName, cancellationToken); + } + + /// + /// Get a AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectResource.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAssessmentProjectResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectResource.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAssessmentProjectResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_Delete + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectResource.Delete"); + scope.Start(); + try + { + var response = await _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AssessmentArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_Delete + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectResource.Delete"); + scope.Start(); + try + { + var response = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var uri = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AssessmentArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_Update + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, MigrationAssessmentAssessmentProjectPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectResource.Update"); + scope.Start(); + try + { + var response = await _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new MigrationAssessmentAssessmentProjectOperationSource(Client), _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics, Pipeline, _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_Update + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, MigrationAssessmentAssessmentProjectPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectResource.Update"); + scope.Start(); + try + { + var response = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new AssessmentArmOperation(new MigrationAssessmentAssessmentProjectOperationSource(Client), _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics, Pipeline, _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new MigrationAssessmentAssessmentProjectResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new MigrationAssessmentAssessmentProjectPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new MigrationAssessmentAssessmentProjectResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new MigrationAssessmentAssessmentProjectPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new MigrationAssessmentAssessmentProjectResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new MigrationAssessmentAssessmentProjectPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new MigrationAssessmentAssessmentProjectResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new MigrationAssessmentAssessmentProjectPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new MigrationAssessmentAssessmentProjectResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new MigrationAssessmentAssessmentProjectPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// + /// + /// Operation Id + /// AssessmentProjectsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _migrationAssessmentAssessmentProjectAssessmentProjectsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new MigrationAssessmentAssessmentProjectResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new MigrationAssessmentAssessmentProjectPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectSummaryCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectSummaryCollection.cs new file mode 100644 index 000000000000..9717270bf99d --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectSummaryCollection.cs @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMigrationAssessmentAssessmentProjectSummaries method from an instance of . + /// + public partial class MigrationAssessmentAssessmentProjectSummaryCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsClientDiagnostics; + private readonly AssessmentProjectSummaryRestOperations _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentAssessmentProjectSummaryCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MigrationAssessmentAssessmentProjectSummaryCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", MigrationAssessmentAssessmentProjectSummaryResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MigrationAssessmentAssessmentProjectSummaryResource.ResourceType, out string migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsApiVersion); + _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsRestClient = new AssessmentProjectSummaryRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MigrationAssessmentAssessmentProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MigrationAssessmentAssessmentProjectResource.ResourceType), nameof(id)); + } + + /// + /// Get a AssessmentProjectSummary + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/projectSummary/{projectSummaryName} + /// + /// + /// Operation Id + /// AssessmentProjectSummaryOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Group ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string projectSummaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectSummaryName, nameof(projectSummaryName)); + + using var scope = _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectSummaryCollection.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectSummaryName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAssessmentProjectSummaryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AssessmentProjectSummary + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/projectSummary/{projectSummaryName} + /// + /// + /// Operation Id + /// AssessmentProjectSummaryOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Group ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string projectSummaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectSummaryName, nameof(projectSummaryName)); + + using var scope = _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectSummaryCollection.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectSummaryName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAssessmentProjectSummaryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List AssessmentProjectSummary resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/projectSummary + /// + /// + /// Operation Id + /// AssessmentProjectSummaryOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentAssessmentProjectSummaryResource(Client, MigrationAssessmentAssessmentProjectSummaryData.DeserializeMigrationAssessmentAssessmentProjectSummaryData(e)), _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsClientDiagnostics, Pipeline, "MigrationAssessmentAssessmentProjectSummaryCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List AssessmentProjectSummary resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/projectSummary + /// + /// + /// Operation Id + /// AssessmentProjectSummaryOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentAssessmentProjectSummaryResource(Client, MigrationAssessmentAssessmentProjectSummaryData.DeserializeMigrationAssessmentAssessmentProjectSummaryData(e)), _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsClientDiagnostics, Pipeline, "MigrationAssessmentAssessmentProjectSummaryCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/projectSummary/{projectSummaryName} + /// + /// + /// Operation Id + /// AssessmentProjectSummaryOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Group ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string projectSummaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectSummaryName, nameof(projectSummaryName)); + + using var scope = _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectSummaryCollection.Exists"); + scope.Start(); + try + { + var response = await _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectSummaryName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/projectSummary/{projectSummaryName} + /// + /// + /// Operation Id + /// AssessmentProjectSummaryOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Group ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string projectSummaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectSummaryName, nameof(projectSummaryName)); + + using var scope = _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectSummaryCollection.Exists"); + scope.Start(); + try + { + var response = _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectSummaryName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/projectSummary/{projectSummaryName} + /// + /// + /// Operation Id + /// AssessmentProjectSummaryOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Group ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string projectSummaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectSummaryName, nameof(projectSummaryName)); + + using var scope = _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectSummaryCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectSummaryName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAssessmentProjectSummaryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/projectSummary/{projectSummaryName} + /// + /// + /// Operation Id + /// AssessmentProjectSummaryOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Group ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string projectSummaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectSummaryName, nameof(projectSummaryName)); + + using var scope = _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectSummaryCollection.GetIfExists"); + scope.Start(); + try + { + var response = _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectSummaryName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAssessmentProjectSummaryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectSummaryData.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectSummaryData.Serialization.cs new file mode 100644 index 000000000000..b3f5ecd80a7b --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectSummaryData.Serialization.cs @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentAssessmentProjectSummaryData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentAssessmentProjectSummaryData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsCollectionDefined(ErrorSummaryAffectedEntities)) + { + writer.WritePropertyName("errorSummaryAffectedEntities"u8); + writer.WriteStartArray(); + foreach (var item in ErrorSummaryAffectedEntities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfPrivateEndpointConnections)) + { + writer.WritePropertyName("numberOfPrivateEndpointConnections"u8); + writer.WriteNumberValue(NumberOfPrivateEndpointConnections.Value); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfGroups)) + { + writer.WritePropertyName("numberOfGroups"u8); + writer.WriteNumberValue(NumberOfGroups.Value); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfMachines)) + { + writer.WritePropertyName("numberOfMachines"u8); + writer.WriteNumberValue(NumberOfMachines.Value); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfImportMachines)) + { + writer.WritePropertyName("numberOfImportMachines"u8); + writer.WriteNumberValue(NumberOfImportMachines.Value); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfAssessments)) + { + writer.WritePropertyName("numberOfAssessments"u8); + writer.WriteNumberValue(NumberOfAssessments.Value); + } + if (options.Format != "W" && Optional.IsDefined(LastAssessedOn)) + { + writer.WritePropertyName("lastAssessmentTimestamp"u8); + writer.WriteStringValue(LastAssessedOn.Value, "O"); + } + writer.WriteEndObject(); + } + + MigrationAssessmentAssessmentProjectSummaryData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentAssessmentProjectSummaryData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentAssessmentProjectSummaryData(document.RootElement, options); + } + + internal static MigrationAssessmentAssessmentProjectSummaryData DeserializeMigrationAssessmentAssessmentProjectSummaryData(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; + IReadOnlyList errorSummaryAffectedEntities = default; + int? numberOfPrivateEndpointConnections = default; + int? numberOfGroups = default; + int? numberOfMachines = default; + int? numberOfImportMachines = default; + int? numberOfAssessments = default; + DateTimeOffset? lastAssessmentTimestamp = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(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("errorSummaryAffectedEntities"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(AssessmentErrorSummary.DeserializeAssessmentErrorSummary(item, options)); + } + errorSummaryAffectedEntities = array; + continue; + } + if (property0.NameEquals("numberOfPrivateEndpointConnections"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfPrivateEndpointConnections = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("numberOfGroups"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfGroups = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("numberOfMachines"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfMachines = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("numberOfImportMachines"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfImportMachines = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("numberOfAssessments"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfAssessments = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("lastAssessmentTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastAssessmentTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentAssessmentProjectSummaryData( + id, + name, + type, + systemData, + errorSummaryAffectedEntities ?? new ChangeTrackingList(), + numberOfPrivateEndpointConnections, + numberOfGroups, + numberOfMachines, + numberOfImportMachines, + numberOfAssessments, + lastAssessmentTimestamp, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentAssessmentProjectSummaryData)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentAssessmentProjectSummaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentAssessmentProjectSummaryData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentAssessmentProjectSummaryData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectSummaryData.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectSummaryData.cs new file mode 100644 index 000000000000..aeae2e2dc57f --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectSummaryData.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing the MigrationAssessmentAssessmentProjectSummary data model. + /// Assessment project summary resource. + /// + public partial class MigrationAssessmentAssessmentProjectSummaryData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MigrationAssessmentAssessmentProjectSummaryData() + { + ErrorSummaryAffectedEntities = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// Gets the Error summary by feature. Contains number of affected Entities per + /// feature. + /// + /// Gets the number of private endpoint connections. + /// Gets the number of groups created in this project. + /// Gets the number of machines part of this project. + /// Gets the number of import machines part of this project. + /// Gets the number of assessments created in this project. + /// Gets the last assessment timestamp. + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentAssessmentProjectSummaryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IReadOnlyList errorSummaryAffectedEntities, int? numberOfPrivateEndpointConnections, int? numberOfGroups, int? numberOfMachines, int? numberOfImportMachines, int? numberOfAssessments, DateTimeOffset? lastAssessedOn, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ErrorSummaryAffectedEntities = errorSummaryAffectedEntities; + NumberOfPrivateEndpointConnections = numberOfPrivateEndpointConnections; + NumberOfGroups = numberOfGroups; + NumberOfMachines = numberOfMachines; + NumberOfImportMachines = numberOfImportMachines; + NumberOfAssessments = numberOfAssessments; + LastAssessedOn = lastAssessedOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Gets the Error summary by feature. Contains number of affected Entities per + /// feature. + /// + public IReadOnlyList ErrorSummaryAffectedEntities { get; } + /// Gets the number of private endpoint connections. + public int? NumberOfPrivateEndpointConnections { get; } + /// Gets the number of groups created in this project. + public int? NumberOfGroups { get; } + /// Gets the number of machines part of this project. + public int? NumberOfMachines { get; } + /// Gets the number of import machines part of this project. + public int? NumberOfImportMachines { get; } + /// Gets the number of assessments created in this project. + public int? NumberOfAssessments { get; } + /// Gets the last assessment timestamp. + public DateTimeOffset? LastAssessedOn { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectSummaryResource.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectSummaryResource.Serialization.cs new file mode 100644 index 000000000000..cea077c454ef --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectSummaryResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentAssessmentProjectSummaryResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MigrationAssessmentAssessmentProjectSummaryData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MigrationAssessmentAssessmentProjectSummaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectSummaryResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectSummaryResource.cs new file mode 100644 index 000000000000..5487e9335856 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentProjectSummaryResource.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A Class representing a MigrationAssessmentAssessmentProjectSummary along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMigrationAssessmentAssessmentProjectSummaryResource method. + /// Otherwise you can get one from its parent resource using the GetMigrationAssessmentAssessmentProjectSummary method. + /// + public partial class MigrationAssessmentAssessmentProjectSummaryResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The projectSummaryName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string projectSummaryName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/projectSummary/{projectSummaryName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsClientDiagnostics; + private readonly AssessmentProjectSummaryRestOperations _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsRestClient; + private readonly MigrationAssessmentAssessmentProjectSummaryData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/projectSummary"; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentAssessmentProjectSummaryResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MigrationAssessmentAssessmentProjectSummaryResource(ArmClient client, MigrationAssessmentAssessmentProjectSummaryData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MigrationAssessmentAssessmentProjectSummaryResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsApiVersion); + _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsRestClient = new AssessmentProjectSummaryRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MigrationAssessmentAssessmentProjectSummaryData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a AssessmentProjectSummary + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/projectSummary/{projectSummaryName} + /// + /// + /// Operation Id + /// AssessmentProjectSummaryOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectSummaryResource.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAssessmentProjectSummaryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AssessmentProjectSummary + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/projectSummary/{projectSummaryName} + /// + /// + /// Operation Id + /// AssessmentProjectSummaryOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentProjectSummaryResource.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentAssessmentProjectSummaryAssessmentProjectSummaryOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAssessmentProjectSummaryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentResource.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentResource.Serialization.cs new file mode 100644 index 000000000000..3674194f97f8 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentAssessmentResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MigrationAssessmentAssessmentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MigrationAssessmentAssessmentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentResource.cs new file mode 100644 index 000000000000..fdcdb78bff81 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAssessmentResource.cs @@ -0,0 +1,514 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A Class representing a MigrationAssessmentAssessment along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMigrationAssessmentAssessmentResource method. + /// Otherwise you can get one from its parent resource using the GetMigrationAssessmentAssessment method. + /// + public partial class MigrationAssessmentAssessmentResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The groupName. + /// The assessmentName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics; + private readonly AssessmentsRestOperations _migrationAssessmentAssessmentAssessmentsOperationsRestClient; + private readonly MigrationAssessmentAssessmentData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/groups/assessments"; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentAssessmentResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MigrationAssessmentAssessmentResource(ArmClient client, MigrationAssessmentAssessmentData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MigrationAssessmentAssessmentResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string migrationAssessmentAssessmentAssessmentsOperationsApiVersion); + _migrationAssessmentAssessmentAssessmentsOperationsRestClient = new AssessmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentAssessmentAssessmentsOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MigrationAssessmentAssessmentData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of AssessedMachineResources in the MigrationAssessmentAssessment. + /// An object representing collection of AssessedMachineResources and their operations over a AssessedMachineResource. + public virtual AssessedMachineCollection GetAssessedMachines() + { + return GetCachedClient(client => new AssessedMachineCollection(client, Id)); + } + + /// + /// Get a AssessedMachine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName} + /// + /// + /// Operation Id + /// AssessedMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Machine assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAssessedMachineAsync(string assessedMachineName, CancellationToken cancellationToken = default) + { + return await GetAssessedMachines().GetAsync(assessedMachineName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AssessedMachine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName} + /// + /// + /// Operation Id + /// AssessedMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Machine assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAssessedMachine(string assessedMachineName, CancellationToken cancellationToken = default) + { + return GetAssessedMachines().Get(assessedMachineName, cancellationToken); + } + + /// + /// Get a Assessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// + /// + /// Operation Id + /// AssessmentsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentResource.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentAssessmentAssessmentsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Assessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// + /// + /// Operation Id + /// AssessmentsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentResource.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentAssessmentAssessmentsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Assessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// + /// + /// Operation Id + /// AssessmentsOperations_Delete + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentResource.Delete"); + scope.Start(); + try + { + var response = await _migrationAssessmentAssessmentAssessmentsOperationsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _migrationAssessmentAssessmentAssessmentsOperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AssessmentArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Assessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// + /// + /// Operation Id + /// AssessmentsOperations_Delete + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentResource.Delete"); + scope.Start(); + try + { + var response = _migrationAssessmentAssessmentAssessmentsOperationsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _migrationAssessmentAssessmentAssessmentsOperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AssessmentArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a Assessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// + /// + /// Operation Id + /// AssessmentsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, MigrationAssessmentAssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentResource.Update"); + scope.Start(); + try + { + var response = await _migrationAssessmentAssessmentAssessmentsOperationsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new MigrationAssessmentAssessmentOperationSource(Client), _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics, Pipeline, _migrationAssessmentAssessmentAssessmentsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a Assessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// + /// + /// Operation Id + /// AssessmentsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, MigrationAssessmentAssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentResource.Update"); + scope.Start(); + try + { + var response = _migrationAssessmentAssessmentAssessmentsOperationsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new AssessmentArmOperation(new MigrationAssessmentAssessmentOperationSource(Client), _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics, Pipeline, _migrationAssessmentAssessmentAssessmentsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the URL for downloading the assessment in a report format. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/downloadUrl + /// + /// + /// Operation Id + /// AssessmentsOperations_DownloadUrl + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> DownloadUrlAsync(WaitUntil waitUntil, BinaryData body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentResource.DownloadUrl"); + scope.Start(); + try + { + var response = await _migrationAssessmentAssessmentAssessmentsOperationsRestClient.DownloadUrlAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new AssessmentReportDownloadUriOperationSource(), _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics, Pipeline, _migrationAssessmentAssessmentAssessmentsOperationsRestClient.CreateDownloadUrlRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the URL for downloading the assessment in a report format. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/downloadUrl + /// + /// + /// Operation Id + /// AssessmentsOperations_DownloadUrl + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation DownloadUrl(WaitUntil waitUntil, BinaryData body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAssessmentResource.DownloadUrl"); + scope.Start(); + try + { + var response = _migrationAssessmentAssessmentAssessmentsOperationsRestClient.DownloadUrl(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new AssessmentArmOperation(new AssessmentReportDownloadUriOperationSource(), _migrationAssessmentAssessmentAssessmentsOperationsClientDiagnostics, Pipeline, _migrationAssessmentAssessmentAssessmentsOperationsRestClient.CreateDownloadUrlRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessedMachineCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessedMachineCollection.cs new file mode 100644 index 000000000000..e914c0917d13 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessedMachineCollection.cs @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMigrationAssessmentAvsAssessedMachines method from an instance of . + /// + public partial class MigrationAssessmentAvsAssessedMachineCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsClientDiagnostics; + private readonly AvsAssessedMachinesRestOperations _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentAvsAssessedMachineCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MigrationAssessmentAvsAssessedMachineCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", MigrationAssessmentAvsAssessedMachineResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MigrationAssessmentAvsAssessedMachineResource.ResourceType, out string migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsApiVersion); + _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsRestClient = new AvsAssessedMachinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MigrationAssessmentAvsAssessmentResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MigrationAssessmentAvsAssessmentResource.ResourceType), nameof(id)); + } + + /// + /// Get a AvsAssessedMachine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName}/avsAssessedMachines/{avsAssessedMachineName} + /// + /// + /// Operation Id + /// AvsAssessedMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// AVS assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string avsAssessedMachineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(avsAssessedMachineName, nameof(avsAssessedMachineName)); + + using var scope = _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessedMachineCollection.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, avsAssessedMachineName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAvsAssessedMachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AvsAssessedMachine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName}/avsAssessedMachines/{avsAssessedMachineName} + /// + /// + /// Operation Id + /// AvsAssessedMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// AVS assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string avsAssessedMachineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(avsAssessedMachineName, nameof(avsAssessedMachineName)); + + using var scope = _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessedMachineCollection.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, avsAssessedMachineName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAvsAssessedMachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List AvsAssessedMachine resources by AvsAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName}/avsAssessedMachines + /// + /// + /// Operation Id + /// AvsAssessedMachinesOperations_ListByAvsAssessment + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsRestClient.CreateListByAvsAssessmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsRestClient.CreateListByAvsAssessmentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentAvsAssessedMachineResource(Client, MigrationAssessmentAvsAssessedMachineData.DeserializeMigrationAssessmentAvsAssessedMachineData(e)), _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsClientDiagnostics, Pipeline, "MigrationAssessmentAvsAssessedMachineCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List AvsAssessedMachine resources by AvsAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName}/avsAssessedMachines + /// + /// + /// Operation Id + /// AvsAssessedMachinesOperations_ListByAvsAssessment + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsRestClient.CreateListByAvsAssessmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsRestClient.CreateListByAvsAssessmentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentAvsAssessedMachineResource(Client, MigrationAssessmentAvsAssessedMachineData.DeserializeMigrationAssessmentAvsAssessedMachineData(e)), _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsClientDiagnostics, Pipeline, "MigrationAssessmentAvsAssessedMachineCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName}/avsAssessedMachines/{avsAssessedMachineName} + /// + /// + /// Operation Id + /// AvsAssessedMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// AVS assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string avsAssessedMachineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(avsAssessedMachineName, nameof(avsAssessedMachineName)); + + using var scope = _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessedMachineCollection.Exists"); + scope.Start(); + try + { + var response = await _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, avsAssessedMachineName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName}/avsAssessedMachines/{avsAssessedMachineName} + /// + /// + /// Operation Id + /// AvsAssessedMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// AVS assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string avsAssessedMachineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(avsAssessedMachineName, nameof(avsAssessedMachineName)); + + using var scope = _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessedMachineCollection.Exists"); + scope.Start(); + try + { + var response = _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, avsAssessedMachineName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName}/avsAssessedMachines/{avsAssessedMachineName} + /// + /// + /// Operation Id + /// AvsAssessedMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// AVS assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string avsAssessedMachineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(avsAssessedMachineName, nameof(avsAssessedMachineName)); + + using var scope = _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessedMachineCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, avsAssessedMachineName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAvsAssessedMachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName}/avsAssessedMachines/{avsAssessedMachineName} + /// + /// + /// Operation Id + /// AvsAssessedMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// AVS assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string avsAssessedMachineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(avsAssessedMachineName, nameof(avsAssessedMachineName)); + + using var scope = _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessedMachineCollection.GetIfExists"); + scope.Start(); + try + { + var response = _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, avsAssessedMachineName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAvsAssessedMachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessedMachineData.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessedMachineData.Serialization.cs new file mode 100644 index 000000000000..d60acb576f57 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessedMachineData.Serialization.cs @@ -0,0 +1,562 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentAvsAssessedMachineData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentAvsAssessedMachineData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Disks)) + { + writer.WritePropertyName("disks"u8); + writer.WriteStartObject(); + foreach (var item in Disks) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(NetworkAdapters)) + { + writer.WritePropertyName("networkAdapters"u8); + writer.WriteStartObject(); + foreach (var item in NetworkAdapters) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsDefined(StorageInUseGB)) + { + writer.WritePropertyName("storageInUseGB"u8); + writer.WriteNumberValue(StorageInUseGB.Value); + } + if (options.Format != "W" && Optional.IsDefined(SuitabilityExplanation)) + { + writer.WritePropertyName("suitabilityExplanation"u8); + writer.WriteStringValue(SuitabilityExplanation.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(SuitabilityDetail)) + { + writer.WritePropertyName("suitabilityDetail"u8); + writer.WriteStringValue(SuitabilityDetail.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(TypePropertiesType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(TypePropertiesType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(BootType)) + { + writer.WritePropertyName("bootType"u8); + writer.WriteStringValue(BootType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(OperatingSystemType)) + { + writer.WritePropertyName("operatingSystemType"u8); + writer.WriteStringValue(OperatingSystemType); + } + if (options.Format != "W" && Optional.IsDefined(OperatingSystemName)) + { + writer.WritePropertyName("operatingSystemName"u8); + writer.WriteStringValue(OperatingSystemName); + } + if (options.Format != "W" && Optional.IsDefined(OperatingSystemVersion)) + { + writer.WritePropertyName("operatingSystemVersion"u8); + writer.WriteStringValue(OperatingSystemVersion); + } + if (options.Format != "W" && Optional.IsDefined(OperatingSystemArchitecture)) + { + writer.WritePropertyName("operatingSystemArchitecture"u8); + writer.WriteStringValue(OperatingSystemArchitecture.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("createdTimestamp"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(UpdatedOn)) + { + writer.WritePropertyName("updatedTimestamp"u8); + writer.WriteStringValue(UpdatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (options.Format != "W" && Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && Optional.IsDefined(DatacenterMachineArmId)) + { + writer.WritePropertyName("datacenterMachineArmId"u8); + writer.WriteStringValue(DatacenterMachineArmId); + } + if (options.Format != "W" && Optional.IsDefined(DatacenterManagementServerArmId)) + { + writer.WritePropertyName("datacenterManagementServerArmId"u8); + writer.WriteStringValue(DatacenterManagementServerArmId); + } + if (options.Format != "W" && Optional.IsDefined(DatacenterManagementServerName)) + { + writer.WritePropertyName("datacenterManagementServerName"u8); + writer.WriteStringValue(DatacenterManagementServerName); + } + if (options.Format != "W" && Optional.IsDefined(MegabytesOfMemory)) + { + writer.WritePropertyName("megabytesOfMemory"u8); + writer.WriteNumberValue(MegabytesOfMemory.Value); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfCores)) + { + writer.WritePropertyName("numberOfCores"u8); + writer.WriteNumberValue(NumberOfCores.Value); + } + if (options.Format != "W" && Optional.IsDefined(ConfidenceRatingInPercentage)) + { + writer.WritePropertyName("confidenceRatingInPercentage"u8); + writer.WriteNumberValue(ConfidenceRatingInPercentage.Value); + } + if (options.Format != "W" && Optional.IsDefined(PercentageCoresUtilization)) + { + writer.WritePropertyName("percentageCoresUtilization"u8); + writer.WriteNumberValue(PercentageCoresUtilization.Value); + } + if (options.Format != "W" && Optional.IsDefined(PercentageMemoryUtilization)) + { + writer.WritePropertyName("percentageMemoryUtilization"u8); + writer.WriteNumberValue(PercentageMemoryUtilization.Value); + } + if (options.Format != "W" && Optional.IsDefined(Suitability)) + { + writer.WritePropertyName("suitability"u8); + writer.WriteStringValue(Suitability.Value.ToString()); + } + writer.WriteEndObject(); + } + + MigrationAssessmentAvsAssessedMachineData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentAvsAssessedMachineData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentAvsAssessedMachineData(document.RootElement, options); + } + + internal static MigrationAssessmentAvsAssessedMachineData DeserializeMigrationAssessmentAvsAssessedMachineData(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; + IReadOnlyList errors = default; + IReadOnlyDictionary disks = default; + IReadOnlyDictionary networkAdapters = default; + double? storageInUseGB = default; + AvsVmSuitabilityExplanation? suitabilityExplanation = default; + AvsVmSuitabilityDetail? suitabilityDetail = default; + AssessedMachineType? type0 = default; + MachineBootType? bootType = default; + string operatingSystemType = default; + string operatingSystemName = default; + string operatingSystemVersion = default; + GuestOperatingSystemArchitecture? operatingSystemArchitecture = default; + DateTimeOffset? createdTimestamp = default; + DateTimeOffset? updatedTimestamp = default; + string displayName = default; + string description = default; + ResourceIdentifier datacenterMachineArmId = default; + ResourceIdentifier datacenterManagementServerArmId = default; + string datacenterManagementServerName = default; + double? megabytesOfMemory = default; + int? numberOfCores = default; + double? confidenceRatingInPercentage = default; + double? percentageCoresUtilization = default; + double? percentageMemoryUtilization = default; + MigrationAssessmentCloudSuitability? suitability = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(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("errors"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(MigrationAssessmentError.DeserializeMigrationAssessmentError(item, options)); + } + errors = array; + continue; + } + if (property0.NameEquals("disks"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, AvsAssessedDisk.DeserializeAvsAssessedDisk(property1.Value, options)); + } + disks = dictionary; + continue; + } + if (property0.NameEquals("networkAdapters"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, AvsAssessedNetworkAdapter.DeserializeAvsAssessedNetworkAdapter(property1.Value, options)); + } + networkAdapters = dictionary; + continue; + } + if (property0.NameEquals("storageInUseGB"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageInUseGB = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("suitabilityExplanation"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitabilityExplanation = new AvsVmSuitabilityExplanation(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("suitabilityDetail"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitabilityDetail = new AvsVmSuitabilityDetail(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("type"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type0 = new AssessedMachineType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("bootType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bootType = new MachineBootType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("operatingSystemType"u8)) + { + operatingSystemType = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("operatingSystemName"u8)) + { + operatingSystemName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("operatingSystemVersion"u8)) + { + operatingSystemVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("operatingSystemArchitecture"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + operatingSystemArchitecture = new GuestOperatingSystemArchitecture(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("createdTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("updatedTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("displayName"u8)) + { + displayName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("description"u8)) + { + description = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("datacenterMachineArmId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + datacenterMachineArmId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("datacenterManagementServerArmId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + datacenterManagementServerArmId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("datacenterManagementServerName"u8)) + { + datacenterManagementServerName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("megabytesOfMemory"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + megabytesOfMemory = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("numberOfCores"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfCores = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("confidenceRatingInPercentage"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + confidenceRatingInPercentage = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("percentageCoresUtilization"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + percentageCoresUtilization = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("percentageMemoryUtilization"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + percentageMemoryUtilization = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("suitability"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitability = new MigrationAssessmentCloudSuitability(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentAvsAssessedMachineData( + id, + name, + type, + systemData, + errors ?? new ChangeTrackingList(), + disks ?? new ChangeTrackingDictionary(), + networkAdapters ?? new ChangeTrackingDictionary(), + storageInUseGB, + suitabilityExplanation, + suitabilityDetail, + type0, + bootType, + operatingSystemType, + operatingSystemName, + operatingSystemVersion, + operatingSystemArchitecture, + createdTimestamp, + updatedTimestamp, + displayName, + description, + datacenterMachineArmId, + datacenterManagementServerArmId, + datacenterManagementServerName, + megabytesOfMemory, + numberOfCores, + confidenceRatingInPercentage, + percentageCoresUtilization, + percentageMemoryUtilization, + suitability, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentAvsAssessedMachineData)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentAvsAssessedMachineData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentAvsAssessedMachineData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentAvsAssessedMachineData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessedMachineData.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessedMachineData.cs new file mode 100644 index 000000000000..3fc6375228ed --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessedMachineData.cs @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing the MigrationAssessmentAvsAssessedMachine data model. + /// AVS assessment Assessed Machine resource. + /// + public partial class MigrationAssessmentAvsAssessedMachineData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MigrationAssessmentAvsAssessedMachineData() + { + Errors = new ChangeTrackingList(); + Disks = new ChangeTrackingDictionary(); + NetworkAdapters = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// List of errors for this machine. + /// List of Disks that were assessed as part of this machine's assessment. + /// + /// List of Network Adapters that were assessed as part of this machine's + /// assessment. + /// + /// Gets the storage in use. + /// Gets the explanation if machine is not suitable for cloud. + /// Gets the details if machine is not suitable for cloud. + /// Assessed machine type. + /// Boot type of machine discovered in private data center. + /// Operating system as reported by datacenter management solution. + /// Operating system as reported by datacenter management solution. + /// Operating system version as reported by datacenter management solution. + /// Operating system architecture as reported by datacenter management solution. + /// When was machine first created. + /// When was machine last updated. + /// Display Name of the Machine. + /// Description for the machine. + /// Data center machine ARM id. + /// Data center management server ARM id. + /// Data center management server name. + /// Megabytes of memory found allocated for the machine in private data center. + /// Number of CPU cores found on the machine. + /// Confidence Rating in Percentage. + /// + /// Percentile of Percentage of Cores Utilized noted during time period T. + /// + /// Here N and T are settings on Assessment. + /// + /// + /// Percentile of Percentage of Memory Utilized noted during time period T. + /// + /// Here N and T are settings on Assessment. + /// + /// + /// Gets a value indicating whether machine is suitable for the cloud platform + /// selected. + /// + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentAvsAssessedMachineData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IReadOnlyList errors, IReadOnlyDictionary disks, IReadOnlyDictionary networkAdapters, double? storageInUseGB, AvsVmSuitabilityExplanation? suitabilityExplanation, AvsVmSuitabilityDetail? suitabilityDetail, AssessedMachineType? typePropertiesType, MachineBootType? bootType, string operatingSystemType, string operatingSystemName, string operatingSystemVersion, GuestOperatingSystemArchitecture? operatingSystemArchitecture, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, string displayName, string description, ResourceIdentifier datacenterMachineArmId, ResourceIdentifier datacenterManagementServerArmId, string datacenterManagementServerName, double? megabytesOfMemory, int? numberOfCores, double? confidenceRatingInPercentage, double? percentageCoresUtilization, double? percentageMemoryUtilization, MigrationAssessmentCloudSuitability? suitability, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Errors = errors; + Disks = disks; + NetworkAdapters = networkAdapters; + StorageInUseGB = storageInUseGB; + SuitabilityExplanation = suitabilityExplanation; + SuitabilityDetail = suitabilityDetail; + TypePropertiesType = typePropertiesType; + BootType = bootType; + OperatingSystemType = operatingSystemType; + OperatingSystemName = operatingSystemName; + OperatingSystemVersion = operatingSystemVersion; + OperatingSystemArchitecture = operatingSystemArchitecture; + CreatedOn = createdOn; + UpdatedOn = updatedOn; + DisplayName = displayName; + Description = description; + DatacenterMachineArmId = datacenterMachineArmId; + DatacenterManagementServerArmId = datacenterManagementServerArmId; + DatacenterManagementServerName = datacenterManagementServerName; + MegabytesOfMemory = megabytesOfMemory; + NumberOfCores = numberOfCores; + ConfidenceRatingInPercentage = confidenceRatingInPercentage; + PercentageCoresUtilization = percentageCoresUtilization; + PercentageMemoryUtilization = percentageMemoryUtilization; + Suitability = suitability; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of errors for this machine. + public IReadOnlyList Errors { get; } + /// List of Disks that were assessed as part of this machine's assessment. + public IReadOnlyDictionary Disks { get; } + /// + /// List of Network Adapters that were assessed as part of this machine's + /// assessment. + /// + public IReadOnlyDictionary NetworkAdapters { get; } + /// Gets the storage in use. + public double? StorageInUseGB { get; } + /// Gets the explanation if machine is not suitable for cloud. + public AvsVmSuitabilityExplanation? SuitabilityExplanation { get; } + /// Gets the details if machine is not suitable for cloud. + public AvsVmSuitabilityDetail? SuitabilityDetail { get; } + /// Assessed machine type. + public AssessedMachineType? TypePropertiesType { get; } + /// Boot type of machine discovered in private data center. + public MachineBootType? BootType { get; } + /// Operating system as reported by datacenter management solution. + public string OperatingSystemType { get; } + /// Operating system as reported by datacenter management solution. + public string OperatingSystemName { get; } + /// Operating system version as reported by datacenter management solution. + public string OperatingSystemVersion { get; } + /// Operating system architecture as reported by datacenter management solution. + public GuestOperatingSystemArchitecture? OperatingSystemArchitecture { get; } + /// When was machine first created. + public DateTimeOffset? CreatedOn { get; } + /// When was machine last updated. + public DateTimeOffset? UpdatedOn { get; } + /// Display Name of the Machine. + public string DisplayName { get; } + /// Description for the machine. + public string Description { get; } + /// Data center machine ARM id. + public ResourceIdentifier DatacenterMachineArmId { get; } + /// Data center management server ARM id. + public ResourceIdentifier DatacenterManagementServerArmId { get; } + /// Data center management server name. + public string DatacenterManagementServerName { get; } + /// Megabytes of memory found allocated for the machine in private data center. + public double? MegabytesOfMemory { get; } + /// Number of CPU cores found on the machine. + public int? NumberOfCores { get; } + /// Confidence Rating in Percentage. + public double? ConfidenceRatingInPercentage { get; } + /// + /// Percentile of Percentage of Cores Utilized noted during time period T. + /// + /// Here N and T are settings on Assessment. + /// + public double? PercentageCoresUtilization { get; } + /// + /// Percentile of Percentage of Memory Utilized noted during time period T. + /// + /// Here N and T are settings on Assessment. + /// + public double? PercentageMemoryUtilization { get; } + /// + /// Gets a value indicating whether machine is suitable for the cloud platform + /// selected. + /// + public MigrationAssessmentCloudSuitability? Suitability { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessedMachineResource.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessedMachineResource.Serialization.cs new file mode 100644 index 000000000000..9026b2d25899 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessedMachineResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentAvsAssessedMachineResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MigrationAssessmentAvsAssessedMachineData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MigrationAssessmentAvsAssessedMachineData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessedMachineResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessedMachineResource.cs new file mode 100644 index 000000000000..509b59e21863 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessedMachineResource.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A Class representing a MigrationAssessmentAvsAssessedMachine along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMigrationAssessmentAvsAssessedMachineResource method. + /// Otherwise you can get one from its parent resource using the GetMigrationAssessmentAvsAssessedMachine method. + /// + public partial class MigrationAssessmentAvsAssessedMachineResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The groupName. + /// The assessmentName. + /// The avsAssessedMachineName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string avsAssessedMachineName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName}/avsAssessedMachines/{avsAssessedMachineName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsClientDiagnostics; + private readonly AvsAssessedMachinesRestOperations _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsRestClient; + private readonly MigrationAssessmentAvsAssessedMachineData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/groups/avsAssessments/avsAssessedMachines"; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentAvsAssessedMachineResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MigrationAssessmentAvsAssessedMachineResource(ArmClient client, MigrationAssessmentAvsAssessedMachineData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MigrationAssessmentAvsAssessedMachineResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsApiVersion); + _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsRestClient = new AvsAssessedMachinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MigrationAssessmentAvsAssessedMachineData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a AvsAssessedMachine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName}/avsAssessedMachines/{avsAssessedMachineName} + /// + /// + /// Operation Id + /// AvsAssessedMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessedMachineResource.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAvsAssessedMachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AvsAssessedMachine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName}/avsAssessedMachines/{avsAssessedMachineName} + /// + /// + /// Operation Id + /// AvsAssessedMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessedMachineResource.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentAvsAssessedMachineAvsAssessedMachinesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAvsAssessedMachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentCollection.cs new file mode 100644 index 000000000000..7654b69cdb66 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMigrationAssessmentAvsAssessments method from an instance of . + /// + public partial class MigrationAssessmentAvsAssessmentCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics; + private readonly AvsAssessmentsRestOperations _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentAvsAssessmentCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MigrationAssessmentAvsAssessmentCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", MigrationAssessmentAvsAssessmentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MigrationAssessmentAvsAssessmentResource.ResourceType, out string migrationAssessmentAvsAssessmentAvsAssessmentsOperationsApiVersion); + _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient = new AvsAssessmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentAvsAssessmentAvsAssessmentsOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MigrationAssessmentGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MigrationAssessmentGroupResource.ResourceType), nameof(id)); + } + + /// + /// Create a AvsAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName} + /// + /// + /// Operation Id + /// AvsAssessmentsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// AVS Assessment ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string assessmentName, MigrationAssessmentAvsAssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessmentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, data, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new MigrationAssessmentAvsAssessmentOperationSource(Client), _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics, Pipeline, _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a AvsAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName} + /// + /// + /// Operation Id + /// AvsAssessmentsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// AVS Assessment ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string assessmentName, MigrationAssessmentAvsAssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessmentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, data, cancellationToken); + var operation = new AssessmentArmOperation(new MigrationAssessmentAvsAssessmentOperationSource(Client), _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics, Pipeline, _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AvsAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName} + /// + /// + /// Operation Id + /// AvsAssessmentsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// AVS Assessment ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var scope = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessmentCollection.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAvsAssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AvsAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName} + /// + /// + /// Operation Id + /// AvsAssessmentsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// AVS Assessment ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var scope = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessmentCollection.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAvsAssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List AvsAssessment resources by Group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments + /// + /// + /// Operation Id + /// AvsAssessmentsOperations_ListByGroup + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.CreateListByGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.CreateListByGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentAvsAssessmentResource(Client, MigrationAssessmentAvsAssessmentData.DeserializeMigrationAssessmentAvsAssessmentData(e)), _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics, Pipeline, "MigrationAssessmentAvsAssessmentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List AvsAssessment resources by Group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments + /// + /// + /// Operation Id + /// AvsAssessmentsOperations_ListByGroup + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.CreateListByGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.CreateListByGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentAvsAssessmentResource(Client, MigrationAssessmentAvsAssessmentData.DeserializeMigrationAssessmentAvsAssessmentData(e)), _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics, Pipeline, "MigrationAssessmentAvsAssessmentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName} + /// + /// + /// Operation Id + /// AvsAssessmentsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// AVS Assessment ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var scope = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessmentCollection.Exists"); + scope.Start(); + try + { + var response = await _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName} + /// + /// + /// Operation Id + /// AvsAssessmentsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// AVS Assessment ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var scope = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessmentCollection.Exists"); + scope.Start(); + try + { + var response = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName} + /// + /// + /// Operation Id + /// AvsAssessmentsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// AVS Assessment ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var scope = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessmentCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAvsAssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName} + /// + /// + /// Operation Id + /// AvsAssessmentsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// AVS Assessment ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var scope = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessmentCollection.GetIfExists"); + scope.Start(); + try + { + var response = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAvsAssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentData.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentData.Serialization.cs new file mode 100644 index 000000000000..c11674018717 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentData.Serialization.cs @@ -0,0 +1,824 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentAvsAssessmentData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentAvsAssessmentData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(AssessmentErrorSummary)) + { + writer.WritePropertyName("assessmentErrorSummary"u8); + writer.WriteStartObject(); + foreach (var item in AssessmentErrorSummary) + { + writer.WritePropertyName(item.Key); + writer.WriteNumberValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(FailuresToTolerateAndRaidLevel)) + { + writer.WritePropertyName("failuresToTolerateAndRaidLevel"u8); + writer.WriteStringValue(FailuresToTolerateAndRaidLevel.Value.ToString()); + } + if (Optional.IsDefined(VcpuOversubscription)) + { + writer.WritePropertyName("vcpuOversubscription"u8); + writer.WriteNumberValue(VcpuOversubscription.Value); + } + if (Optional.IsDefined(NodeType)) + { + writer.WritePropertyName("nodeType"u8); + writer.WriteStringValue(NodeType.Value.ToString()); + } + if (Optional.IsDefined(ReservedInstance)) + { + writer.WritePropertyName("reservedInstance"u8); + writer.WriteStringValue(ReservedInstance.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(TotalMonthlyCost)) + { + writer.WritePropertyName("totalMonthlyCost"u8); + writer.WriteNumberValue(TotalMonthlyCost.Value); + } + if (options.Format != "W" && Optional.IsDefined(Suitability)) + { + writer.WritePropertyName("suitability"u8); + writer.WriteStringValue(Suitability.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(SuitabilityExplanation)) + { + writer.WritePropertyName("suitabilityExplanation"u8); + writer.WriteStringValue(SuitabilityExplanation.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfNodes)) + { + writer.WritePropertyName("numberOfNodes"u8); + writer.WriteNumberValue(NumberOfNodes.Value); + } + if (options.Format != "W" && Optional.IsDefined(CpuUtilization)) + { + writer.WritePropertyName("cpuUtilization"u8); + writer.WriteNumberValue(CpuUtilization.Value); + } + if (options.Format != "W" && Optional.IsDefined(RamUtilization)) + { + writer.WritePropertyName("ramUtilization"u8); + writer.WriteNumberValue(RamUtilization.Value); + } + if (options.Format != "W" && Optional.IsDefined(StorageUtilization)) + { + writer.WritePropertyName("storageUtilization"u8); + writer.WriteNumberValue(StorageUtilization.Value); + } + if (options.Format != "W" && Optional.IsDefined(TotalCpuCores)) + { + writer.WritePropertyName("totalCpuCores"u8); + writer.WriteNumberValue(TotalCpuCores.Value); + } + if (options.Format != "W" && Optional.IsDefined(TotalRamInGB)) + { + writer.WritePropertyName("totalRamInGB"u8); + writer.WriteNumberValue(TotalRamInGB.Value); + } + if (options.Format != "W" && Optional.IsDefined(TotalStorageInGB)) + { + writer.WritePropertyName("totalStorageInGB"u8); + writer.WriteNumberValue(TotalStorageInGB.Value); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfMachines)) + { + writer.WritePropertyName("numberOfMachines"u8); + writer.WriteNumberValue(NumberOfMachines.Value); + } + if (options.Format != "W" && Optional.IsCollectionDefined(SuitabilitySummary)) + { + writer.WritePropertyName("suitabilitySummary"u8); + writer.WriteStartObject(); + foreach (var item in SuitabilitySummary) + { + writer.WritePropertyName(item.Key); + writer.WriteNumberValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(MemOvercommit)) + { + writer.WritePropertyName("memOvercommit"u8); + writer.WriteNumberValue(MemOvercommit.Value); + } + if (Optional.IsDefined(DedupeCompression)) + { + writer.WritePropertyName("dedupeCompression"u8); + writer.WriteNumberValue(DedupeCompression.Value); + } + if (options.Format != "W" && Optional.IsDefined(LimitingFactor)) + { + writer.WritePropertyName("limitingFactor"u8); + writer.WriteStringValue(LimitingFactor); + } + if (Optional.IsDefined(IsStretchClusterEnabled)) + { + writer.WritePropertyName("isStretchClusterEnabled"u8); + writer.WriteBooleanValue(IsStretchClusterEnabled.Value); + } + if (options.Format != "W" && Optional.IsDefined(GroupType)) + { + writer.WritePropertyName("groupType"u8); + writer.WriteStringValue(GroupType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(AssessmentType)) + { + writer.WritePropertyName("assessmentType"u8); + writer.WriteStringValue(AssessmentType.Value.ToString()); + } + if (Optional.IsDefined(AzureLocation)) + { + writer.WritePropertyName("azureLocation"u8); + writer.WriteStringValue(AzureLocation.Value); + } + if (Optional.IsDefined(AzureOfferCode)) + { + writer.WritePropertyName("azureOfferCode"u8); + writer.WriteStringValue(AzureOfferCode.Value.ToString()); + } + if (Optional.IsDefined(Currency)) + { + writer.WritePropertyName("currency"u8); + writer.WriteStringValue(Currency.Value.ToString()); + } + if (Optional.IsDefined(ScalingFactor)) + { + writer.WritePropertyName("scalingFactor"u8); + writer.WriteNumberValue(ScalingFactor.Value); + } + if (Optional.IsDefined(Percentile)) + { + writer.WritePropertyName("percentile"u8); + writer.WriteStringValue(Percentile.Value.ToString()); + } + if (Optional.IsDefined(TimeRange)) + { + writer.WritePropertyName("timeRange"u8); + writer.WriteStringValue(TimeRange.Value.ToString()); + } + if (Optional.IsDefined(PerfDataStartOn)) + { + writer.WritePropertyName("perfDataStartTime"u8); + writer.WriteStringValue(PerfDataStartOn.Value, "O"); + } + if (Optional.IsDefined(PerfDataEndOn)) + { + writer.WritePropertyName("perfDataEndTime"u8); + writer.WriteStringValue(PerfDataEndOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Stage)) + { + writer.WritePropertyName("stage"u8); + writer.WriteStringValue(Stage.Value.ToString()); + } + if (Optional.IsDefined(DiscountPercentage)) + { + writer.WritePropertyName("discountPercentage"u8); + writer.WriteNumberValue(DiscountPercentage.Value); + } + if (Optional.IsDefined(SizingCriterion)) + { + writer.WritePropertyName("sizingCriterion"u8); + writer.WriteStringValue(SizingCriterion.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ConfidenceRatingInPercentage)) + { + writer.WritePropertyName("confidenceRatingInPercentage"u8); + writer.WriteNumberValue(ConfidenceRatingInPercentage.Value); + } + if (options.Format != "W" && Optional.IsDefined(PricesQueriedOn)) + { + writer.WritePropertyName("pricesTimestamp"u8); + writer.WriteStringValue(PricesQueriedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("createdTimestamp"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(UpdatedOn)) + { + writer.WritePropertyName("updatedTimestamp"u8); + writer.WriteStringValue(UpdatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(SchemaVersion)) + { + writer.WritePropertyName("schemaVersion"u8); + writer.WriteStringValue(SchemaVersion); + } + writer.WriteEndObject(); + } + + MigrationAssessmentAvsAssessmentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentAvsAssessmentData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentAvsAssessmentData(document.RootElement, options); + } + + internal static MigrationAssessmentAvsAssessmentData DeserializeMigrationAssessmentAvsAssessmentData(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; + MigrationAssessmentProvisioningState? provisioningState = default; + IReadOnlyDictionary assessmentErrorSummary = default; + FttAndRaidLevel? failuresToTolerateAndRaidLevel = default; + double? vcpuOversubscription = default; + AvsNodeType? nodeType = default; + AzureReservedInstance? reservedInstance = default; + double? totalMonthlyCost = default; + MigrationAssessmentCloudSuitability? suitability = default; + AvsSuitabilityExplanation? suitabilityExplanation = default; + int? numberOfNodes = default; + double? cpuUtilization = default; + double? ramUtilization = default; + double? storageUtilization = default; + double? totalCpuCores = default; + double? totalRamInGB = default; + double? totalStorageInGB = default; + int? numberOfMachines = default; + IReadOnlyDictionary suitabilitySummary = default; + double? memOvercommit = default; + double? dedupeCompression = default; + string limitingFactor = default; + bool? isStretchClusterEnabled = default; + MigrationAssessmentGroupType? groupType = default; + AssessmentType? assessmentType = default; + AzureLocation? azureLocation = default; + AzureOfferCode? azureOfferCode = default; + AzureCurrency? currency = default; + double? scalingFactor = default; + PercentileOfUtilization? percentile = default; + AssessmentTimeRange? timeRange = default; + DateTimeOffset? perfDataStartTime = default; + DateTimeOffset? perfDataEndTime = default; + AssessmentStage? stage = default; + double? discountPercentage = default; + AssessmentSizingCriterion? sizingCriterion = default; + double? confidenceRatingInPercentage = default; + DateTimeOffset? pricesTimestamp = default; + DateTimeOffset? createdTimestamp = default; + DateTimeOffset? updatedTimestamp = default; + AssessmentStatus? status = default; + string schemaVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(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("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new MigrationAssessmentProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("assessmentErrorSummary"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetInt32()); + } + assessmentErrorSummary = dictionary; + continue; + } + if (property0.NameEquals("failuresToTolerateAndRaidLevel"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failuresToTolerateAndRaidLevel = new FttAndRaidLevel(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("vcpuOversubscription"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vcpuOversubscription = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("nodeType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nodeType = new AvsNodeType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("reservedInstance"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + reservedInstance = new AzureReservedInstance(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("totalMonthlyCost"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalMonthlyCost = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("suitability"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitability = new MigrationAssessmentCloudSuitability(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("suitabilityExplanation"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitabilityExplanation = new AvsSuitabilityExplanation(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("numberOfNodes"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfNodes = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("cpuUtilization"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cpuUtilization = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("ramUtilization"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ramUtilization = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("storageUtilization"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageUtilization = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("totalCpuCores"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalCpuCores = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("totalRamInGB"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalRamInGB = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("totalStorageInGB"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalStorageInGB = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("numberOfMachines"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfMachines = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("suitabilitySummary"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetInt32()); + } + suitabilitySummary = dictionary; + continue; + } + if (property0.NameEquals("memOvercommit"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + memOvercommit = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("dedupeCompression"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dedupeCompression = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("limitingFactor"u8)) + { + limitingFactor = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("isStretchClusterEnabled"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isStretchClusterEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("groupType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + groupType = new MigrationAssessmentGroupType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("assessmentType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assessmentType = new AssessmentType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("azureLocation"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureLocation = new AzureLocation(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("azureOfferCode"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureOfferCode = new AzureOfferCode(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("currency"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + currency = new AzureCurrency(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("scalingFactor"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scalingFactor = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("percentile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + percentile = new PercentileOfUtilization(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("timeRange"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeRange = new AssessmentTimeRange(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("perfDataStartTime"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + perfDataStartTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("perfDataEndTime"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + perfDataEndTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("stage"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stage = new AssessmentStage(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("discountPercentage"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + discountPercentage = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("sizingCriterion"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sizingCriterion = new AssessmentSizingCriterion(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("confidenceRatingInPercentage"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + confidenceRatingInPercentage = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("pricesTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + pricesTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("createdTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("updatedTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("status"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new AssessmentStatus(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("schemaVersion"u8)) + { + schemaVersion = property0.Value.GetString(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentAvsAssessmentData( + id, + name, + type, + systemData, + provisioningState, + assessmentErrorSummary ?? new ChangeTrackingDictionary(), + failuresToTolerateAndRaidLevel, + vcpuOversubscription, + nodeType, + reservedInstance, + totalMonthlyCost, + suitability, + suitabilityExplanation, + numberOfNodes, + cpuUtilization, + ramUtilization, + storageUtilization, + totalCpuCores, + totalRamInGB, + totalStorageInGB, + numberOfMachines, + suitabilitySummary ?? new ChangeTrackingDictionary(), + memOvercommit, + dedupeCompression, + limitingFactor, + isStretchClusterEnabled, + groupType, + assessmentType, + azureLocation, + azureOfferCode, + currency, + scalingFactor, + percentile, + timeRange, + perfDataStartTime, + perfDataEndTime, + stage, + discountPercentage, + sizingCriterion, + confidenceRatingInPercentage, + pricesTimestamp, + createdTimestamp, + updatedTimestamp, + status, + schemaVersion, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentAvsAssessmentData)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentAvsAssessmentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentAvsAssessmentData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentAvsAssessmentData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentData.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentData.cs new file mode 100644 index 000000000000..9dd72c275862 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentData.cs @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing the MigrationAssessmentAvsAssessment data model. + /// AVS assessment resource. + /// + public partial class MigrationAssessmentAvsAssessmentData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MigrationAssessmentAvsAssessmentData() + { + AssessmentErrorSummary = new ChangeTrackingDictionary(); + SuitabilitySummary = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The status of the last operation. + /// + /// Gets the assessment error summary. + /// This is the number of machines + /// affected by each type of error in this assessment. + /// + /// Failures to tolerate and RAID level in a common property. + /// VCPU over subscription. + /// AVS node type. + /// Reserved instance. + /// Total monthly cost. + /// Gets or sets the Assessment cloud suitability. + /// Gets or sets the Assessment suitability explanation. + /// Recommended number of nodes. + /// Predicted CPU utilization. + /// Predicted RAM utilization. + /// Predicted storage utilization. + /// Predicted total CPU cores used. + /// Predicted total RAM used in GB. + /// Predicted total Storage used in GB. + /// Number of machines part of the assessment. + /// Cloud suitability summary for all the machines in the assessment. + /// Memory overcommit. + /// De-duplication compression. + /// Limiting factor. + /// Is Stretch Cluster Enabled. + /// Gets the group type for the assessment. + /// Assessment type of the assessment. + /// Azure Location or Azure region where to which the machines will be migrated. + /// Azure Offer code according to which cost estimation is done. + /// Currency in which prices should be reported. + /// + /// Percentage of buffer that user wants on performance metrics when recommending + /// Azure sizes. + /// + /// + /// Percentile of the utilization data values to be considered while assessing + /// machines. + /// + /// + /// Time Range for which the historic utilization data should be considered for + /// assessment. + /// + /// Gets or sets the start time to consider performance data for assessment. + /// Gets or sets the end time to consider performance data for assessment. + /// User configurable setting to display the Stage of Assessment. + /// Custom discount percentage. + /// Assessment sizing criterion. + /// Confidence Rating in Percentage. + /// + /// Time when the Azure Prices were queried. Date-Time represented in ISO-8601 + /// format. + /// + /// Date and Time when assessment was created. + /// Date and Time when assessment was last updated. + /// Whether assessment is in valid state and all machines have been assessed. + /// Schema version. + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentAvsAssessmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MigrationAssessmentProvisioningState? provisioningState, IReadOnlyDictionary assessmentErrorSummary, FttAndRaidLevel? failuresToTolerateAndRaidLevel, double? vcpuOversubscription, AvsNodeType? nodeType, AzureReservedInstance? reservedInstance, double? totalMonthlyCost, MigrationAssessmentCloudSuitability? suitability, AvsSuitabilityExplanation? suitabilityExplanation, int? numberOfNodes, double? cpuUtilization, double? ramUtilization, double? storageUtilization, double? totalCpuCores, double? totalRamInGB, double? totalStorageInGB, int? numberOfMachines, IReadOnlyDictionary suitabilitySummary, double? memOvercommit, double? dedupeCompression, string limitingFactor, bool? isStretchClusterEnabled, MigrationAssessmentGroupType? groupType, AssessmentType? assessmentType, AzureLocation? azureLocation, AzureOfferCode? azureOfferCode, AzureCurrency? currency, double? scalingFactor, PercentileOfUtilization? percentile, AssessmentTimeRange? timeRange, DateTimeOffset? perfDataStartOn, DateTimeOffset? perfDataEndOn, AssessmentStage? stage, double? discountPercentage, AssessmentSizingCriterion? sizingCriterion, double? confidenceRatingInPercentage, DateTimeOffset? pricesQueriedOn, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, AssessmentStatus? status, string schemaVersion, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + AssessmentErrorSummary = assessmentErrorSummary; + FailuresToTolerateAndRaidLevel = failuresToTolerateAndRaidLevel; + VcpuOversubscription = vcpuOversubscription; + NodeType = nodeType; + ReservedInstance = reservedInstance; + TotalMonthlyCost = totalMonthlyCost; + Suitability = suitability; + SuitabilityExplanation = suitabilityExplanation; + NumberOfNodes = numberOfNodes; + CpuUtilization = cpuUtilization; + RamUtilization = ramUtilization; + StorageUtilization = storageUtilization; + TotalCpuCores = totalCpuCores; + TotalRamInGB = totalRamInGB; + TotalStorageInGB = totalStorageInGB; + NumberOfMachines = numberOfMachines; + SuitabilitySummary = suitabilitySummary; + MemOvercommit = memOvercommit; + DedupeCompression = dedupeCompression; + LimitingFactor = limitingFactor; + IsStretchClusterEnabled = isStretchClusterEnabled; + GroupType = groupType; + AssessmentType = assessmentType; + AzureLocation = azureLocation; + AzureOfferCode = azureOfferCode; + Currency = currency; + ScalingFactor = scalingFactor; + Percentile = percentile; + TimeRange = timeRange; + PerfDataStartOn = perfDataStartOn; + PerfDataEndOn = perfDataEndOn; + Stage = stage; + DiscountPercentage = discountPercentage; + SizingCriterion = sizingCriterion; + ConfidenceRatingInPercentage = confidenceRatingInPercentage; + PricesQueriedOn = pricesQueriedOn; + CreatedOn = createdOn; + UpdatedOn = updatedOn; + Status = status; + SchemaVersion = schemaVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The status of the last operation. + public MigrationAssessmentProvisioningState? ProvisioningState { get; set; } + /// + /// Gets the assessment error summary. + /// This is the number of machines + /// affected by each type of error in this assessment. + /// + public IReadOnlyDictionary AssessmentErrorSummary { get; } + /// Failures to tolerate and RAID level in a common property. + public FttAndRaidLevel? FailuresToTolerateAndRaidLevel { get; set; } + /// VCPU over subscription. + public double? VcpuOversubscription { get; set; } + /// AVS node type. + public AvsNodeType? NodeType { get; set; } + /// Reserved instance. + public AzureReservedInstance? ReservedInstance { get; set; } + /// Total monthly cost. + public double? TotalMonthlyCost { get; } + /// Gets or sets the Assessment cloud suitability. + public MigrationAssessmentCloudSuitability? Suitability { get; } + /// Gets or sets the Assessment suitability explanation. + public AvsSuitabilityExplanation? SuitabilityExplanation { get; } + /// Recommended number of nodes. + public int? NumberOfNodes { get; } + /// Predicted CPU utilization. + public double? CpuUtilization { get; } + /// Predicted RAM utilization. + public double? RamUtilization { get; } + /// Predicted storage utilization. + public double? StorageUtilization { get; } + /// Predicted total CPU cores used. + public double? TotalCpuCores { get; } + /// Predicted total RAM used in GB. + public double? TotalRamInGB { get; } + /// Predicted total Storage used in GB. + public double? TotalStorageInGB { get; } + /// Number of machines part of the assessment. + public int? NumberOfMachines { get; } + /// Cloud suitability summary for all the machines in the assessment. + public IReadOnlyDictionary SuitabilitySummary { get; } + /// Memory overcommit. + public double? MemOvercommit { get; set; } + /// De-duplication compression. + public double? DedupeCompression { get; set; } + /// Limiting factor. + public string LimitingFactor { get; } + /// Is Stretch Cluster Enabled. + public bool? IsStretchClusterEnabled { get; set; } + /// Gets the group type for the assessment. + public MigrationAssessmentGroupType? GroupType { get; } + /// Assessment type of the assessment. + public AssessmentType? AssessmentType { get; } + /// Azure Location or Azure region where to which the machines will be migrated. + public AzureLocation? AzureLocation { get; set; } + /// Azure Offer code according to which cost estimation is done. + public AzureOfferCode? AzureOfferCode { get; set; } + /// Currency in which prices should be reported. + public AzureCurrency? Currency { get; set; } + /// + /// Percentage of buffer that user wants on performance metrics when recommending + /// Azure sizes. + /// + public double? ScalingFactor { get; set; } + /// + /// Percentile of the utilization data values to be considered while assessing + /// machines. + /// + public PercentileOfUtilization? Percentile { get; set; } + /// + /// Time Range for which the historic utilization data should be considered for + /// assessment. + /// + public AssessmentTimeRange? TimeRange { get; set; } + /// Gets or sets the start time to consider performance data for assessment. + public DateTimeOffset? PerfDataStartOn { get; set; } + /// Gets or sets the end time to consider performance data for assessment. + public DateTimeOffset? PerfDataEndOn { get; set; } + /// User configurable setting to display the Stage of Assessment. + public AssessmentStage? Stage { get; } + /// Custom discount percentage. + public double? DiscountPercentage { get; set; } + /// Assessment sizing criterion. + public AssessmentSizingCriterion? SizingCriterion { get; set; } + /// Confidence Rating in Percentage. + public double? ConfidenceRatingInPercentage { get; } + /// + /// Time when the Azure Prices were queried. Date-Time represented in ISO-8601 + /// format. + /// + public DateTimeOffset? PricesQueriedOn { get; } + /// Date and Time when assessment was created. + public DateTimeOffset? CreatedOn { get; } + /// Date and Time when assessment was last updated. + public DateTimeOffset? UpdatedOn { get; } + /// Whether assessment is in valid state and all machines have been assessed. + public AssessmentStatus? Status { get; } + /// Schema version. + public string SchemaVersion { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentOptionCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentOptionCollection.cs new file mode 100644 index 000000000000..336ab30350d4 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentOptionCollection.cs @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMigrationAssessmentAvsAssessmentOptions method from an instance of . + /// + public partial class MigrationAssessmentAvsAssessmentOptionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsClientDiagnostics; + private readonly AvsAssessmentOptionsRestOperations _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentAvsAssessmentOptionCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MigrationAssessmentAvsAssessmentOptionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", MigrationAssessmentAvsAssessmentOptionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MigrationAssessmentAvsAssessmentOptionResource.ResourceType, out string migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsApiVersion); + _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsRestClient = new AvsAssessmentOptionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MigrationAssessmentAssessmentProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MigrationAssessmentAssessmentProjectResource.ResourceType), nameof(id)); + } + + /// + /// Get a AvsAssessmentOptions + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/avsAssessmentOptions/{avsAssessmentOptionsName} + /// + /// + /// Operation Id + /// AvsAssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// AVS Assessment options ARM name. Accepted value is 'default'. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string avsAssessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(avsAssessmentOptionsName, nameof(avsAssessmentOptionsName)); + + using var scope = _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessmentOptionCollection.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, avsAssessmentOptionsName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAvsAssessmentOptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AvsAssessmentOptions + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/avsAssessmentOptions/{avsAssessmentOptionsName} + /// + /// + /// Operation Id + /// AvsAssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// AVS Assessment options ARM name. Accepted value is 'default'. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string avsAssessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(avsAssessmentOptionsName, nameof(avsAssessmentOptionsName)); + + using var scope = _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessmentOptionCollection.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, avsAssessmentOptionsName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAvsAssessmentOptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List AvsAssessmentOptions resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/avsAssessmentOptions + /// + /// + /// Operation Id + /// AvsAssessmentOptionsOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentAvsAssessmentOptionResource(Client, MigrationAssessmentAvsAssessmentOptionData.DeserializeMigrationAssessmentAvsAssessmentOptionData(e)), _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsClientDiagnostics, Pipeline, "MigrationAssessmentAvsAssessmentOptionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List AvsAssessmentOptions resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/avsAssessmentOptions + /// + /// + /// Operation Id + /// AvsAssessmentOptionsOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentAvsAssessmentOptionResource(Client, MigrationAssessmentAvsAssessmentOptionData.DeserializeMigrationAssessmentAvsAssessmentOptionData(e)), _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsClientDiagnostics, Pipeline, "MigrationAssessmentAvsAssessmentOptionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/avsAssessmentOptions/{avsAssessmentOptionsName} + /// + /// + /// Operation Id + /// AvsAssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// AVS Assessment options ARM name. Accepted value is 'default'. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string avsAssessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(avsAssessmentOptionsName, nameof(avsAssessmentOptionsName)); + + using var scope = _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessmentOptionCollection.Exists"); + scope.Start(); + try + { + var response = await _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, avsAssessmentOptionsName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/avsAssessmentOptions/{avsAssessmentOptionsName} + /// + /// + /// Operation Id + /// AvsAssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// AVS Assessment options ARM name. Accepted value is 'default'. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string avsAssessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(avsAssessmentOptionsName, nameof(avsAssessmentOptionsName)); + + using var scope = _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessmentOptionCollection.Exists"); + scope.Start(); + try + { + var response = _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, avsAssessmentOptionsName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/avsAssessmentOptions/{avsAssessmentOptionsName} + /// + /// + /// Operation Id + /// AvsAssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// AVS Assessment options ARM name. Accepted value is 'default'. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string avsAssessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(avsAssessmentOptionsName, nameof(avsAssessmentOptionsName)); + + using var scope = _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessmentOptionCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, avsAssessmentOptionsName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAvsAssessmentOptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/avsAssessmentOptions/{avsAssessmentOptionsName} + /// + /// + /// Operation Id + /// AvsAssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// AVS Assessment options ARM name. Accepted value is 'default'. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string avsAssessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(avsAssessmentOptionsName, nameof(avsAssessmentOptionsName)); + + using var scope = _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessmentOptionCollection.GetIfExists"); + scope.Start(); + try + { + var response = _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, avsAssessmentOptionsName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAvsAssessmentOptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentOptionData.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentOptionData.Serialization.cs new file mode 100644 index 000000000000..3decf42aa242 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentOptionData.Serialization.cs @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentAvsAssessmentOptionData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentAvsAssessmentOptionData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(AvsNodes)) + { + writer.WritePropertyName("avsNodes"u8); + writer.WriteStartArray(); + foreach (var item in AvsNodes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(FailuresToTolerateAndRaidLevelValues)) + { + writer.WritePropertyName("failuresToTolerateAndRaidLevelValues"u8); + writer.WriteStartArray(); + foreach (var item in FailuresToTolerateAndRaidLevelValues) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ReservedInstanceAvsNodes)) + { + writer.WritePropertyName("reservedInstanceAvsNodes"u8); + writer.WriteStartArray(); + foreach (var item in ReservedInstanceAvsNodes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ReservedInstanceSupportedLocations)) + { + writer.WritePropertyName("reservedInstanceSupportedLocations"u8); + writer.WriteStartArray(); + foreach (var item in ReservedInstanceSupportedLocations) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ReservedInstanceSupportedCurrencies)) + { + writer.WritePropertyName("reservedInstanceSupportedCurrencies"u8); + writer.WriteStartArray(); + foreach (var item in ReservedInstanceSupportedCurrencies) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ReservedInstanceSupportedOffers)) + { + writer.WritePropertyName("reservedInstanceSupportedOffers"u8); + writer.WriteStartArray(); + foreach (var item in ReservedInstanceSupportedOffers) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + MigrationAssessmentAvsAssessmentOptionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentAvsAssessmentOptionData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentAvsAssessmentOptionData(document.RootElement, options); + } + + internal static MigrationAssessmentAvsAssessmentOptionData DeserializeMigrationAssessmentAvsAssessmentOptionData(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; + IList avsNodes = default; + IList failuresToTolerateAndRaidLevelValues = default; + IList reservedInstanceAvsNodes = default; + IList reservedInstanceSupportedLocations = default; + IList reservedInstanceSupportedCurrencies = default; + IList reservedInstanceSupportedOffers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(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("avsNodes"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(AvsSkuConfig.DeserializeAvsSkuConfig(item, options)); + } + avsNodes = array; + continue; + } + if (property0.NameEquals("failuresToTolerateAndRaidLevelValues"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new FttAndRaidLevel(item.GetString())); + } + failuresToTolerateAndRaidLevelValues = array; + continue; + } + if (property0.NameEquals("reservedInstanceAvsNodes"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new AvsNodeType(item.GetString())); + } + reservedInstanceAvsNodes = array; + continue; + } + if (property0.NameEquals("reservedInstanceSupportedLocations"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new AzureLocation(item.GetString())); + } + reservedInstanceSupportedLocations = array; + continue; + } + if (property0.NameEquals("reservedInstanceSupportedCurrencies"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new AzureCurrency(item.GetString())); + } + reservedInstanceSupportedCurrencies = array; + continue; + } + if (property0.NameEquals("reservedInstanceSupportedOffers"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new AzureOfferCode(item.GetString())); + } + reservedInstanceSupportedOffers = array; + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentAvsAssessmentOptionData( + id, + name, + type, + systemData, + avsNodes ?? new ChangeTrackingList(), + failuresToTolerateAndRaidLevelValues ?? new ChangeTrackingList(), + reservedInstanceAvsNodes ?? new ChangeTrackingList(), + reservedInstanceSupportedLocations ?? new ChangeTrackingList(), + reservedInstanceSupportedCurrencies ?? new ChangeTrackingList(), + reservedInstanceSupportedOffers ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentAvsAssessmentOptionData)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentAvsAssessmentOptionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentAvsAssessmentOptionData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentAvsAssessmentOptionData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentOptionData.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentOptionData.cs new file mode 100644 index 000000000000..94125c0b41d2 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentOptionData.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing the MigrationAssessmentAvsAssessmentOption data model. + /// AVS Assessment options resource. + /// + public partial class MigrationAssessmentAvsAssessmentOptionData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MigrationAssessmentAvsAssessmentOptionData() + { + AvsNodes = new ChangeTrackingList(); + FailuresToTolerateAndRaidLevelValues = new ChangeTrackingList(); + ReservedInstanceAvsNodes = new ChangeTrackingList(); + ReservedInstanceSupportedLocations = new ChangeTrackingList(); + ReservedInstanceSupportedCurrencies = new ChangeTrackingList(); + ReservedInstanceSupportedOffers = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// AVS SKU Nodes. + /// FTT and Raid level values. + /// List of AVS nodes for RI. + /// List of supported Azure regions for reserved instances. + /// List of supported currencies for reserved instances. + /// List of supported Azure offer codes for reserved instances. + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentAvsAssessmentOptionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IList avsNodes, IList failuresToTolerateAndRaidLevelValues, IList reservedInstanceAvsNodes, IList reservedInstanceSupportedLocations, IList reservedInstanceSupportedCurrencies, IList reservedInstanceSupportedOffers, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + AvsNodes = avsNodes; + FailuresToTolerateAndRaidLevelValues = failuresToTolerateAndRaidLevelValues; + ReservedInstanceAvsNodes = reservedInstanceAvsNodes; + ReservedInstanceSupportedLocations = reservedInstanceSupportedLocations; + ReservedInstanceSupportedCurrencies = reservedInstanceSupportedCurrencies; + ReservedInstanceSupportedOffers = reservedInstanceSupportedOffers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// AVS SKU Nodes. + public IList AvsNodes { get; } + /// FTT and Raid level values. + public IList FailuresToTolerateAndRaidLevelValues { get; } + /// List of AVS nodes for RI. + public IList ReservedInstanceAvsNodes { get; } + /// List of supported Azure regions for reserved instances. + public IList ReservedInstanceSupportedLocations { get; } + /// List of supported currencies for reserved instances. + public IList ReservedInstanceSupportedCurrencies { get; } + /// List of supported Azure offer codes for reserved instances. + public IList ReservedInstanceSupportedOffers { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentOptionResource.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentOptionResource.Serialization.cs new file mode 100644 index 000000000000..7c628d96ab88 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentOptionResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentAvsAssessmentOptionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MigrationAssessmentAvsAssessmentOptionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MigrationAssessmentAvsAssessmentOptionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentOptionResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentOptionResource.cs new file mode 100644 index 000000000000..4ac4e5e7a433 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentOptionResource.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A Class representing a MigrationAssessmentAvsAssessmentOption along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMigrationAssessmentAvsAssessmentOptionResource method. + /// Otherwise you can get one from its parent resource using the GetMigrationAssessmentAvsAssessmentOption method. + /// + public partial class MigrationAssessmentAvsAssessmentOptionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The avsAssessmentOptionsName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string avsAssessmentOptionsName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/avsAssessmentOptions/{avsAssessmentOptionsName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsClientDiagnostics; + private readonly AvsAssessmentOptionsRestOperations _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsRestClient; + private readonly MigrationAssessmentAvsAssessmentOptionData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/avsAssessmentOptions"; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentAvsAssessmentOptionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MigrationAssessmentAvsAssessmentOptionResource(ArmClient client, MigrationAssessmentAvsAssessmentOptionData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MigrationAssessmentAvsAssessmentOptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsApiVersion); + _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsRestClient = new AvsAssessmentOptionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MigrationAssessmentAvsAssessmentOptionData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a AvsAssessmentOptions + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/avsAssessmentOptions/{avsAssessmentOptionsName} + /// + /// + /// Operation Id + /// AvsAssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessmentOptionResource.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAvsAssessmentOptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AvsAssessmentOptions + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/avsAssessmentOptions/{avsAssessmentOptionsName} + /// + /// + /// Operation Id + /// AvsAssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessmentOptionResource.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentAvsAssessmentOptionAvsAssessmentOptionsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAvsAssessmentOptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentResource.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentResource.Serialization.cs new file mode 100644 index 000000000000..d7a3bde6e7bb --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentAvsAssessmentResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MigrationAssessmentAvsAssessmentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MigrationAssessmentAvsAssessmentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentResource.cs new file mode 100644 index 000000000000..d80c5b6b3344 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentAvsAssessmentResource.cs @@ -0,0 +1,514 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A Class representing a MigrationAssessmentAvsAssessment along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMigrationAssessmentAvsAssessmentResource method. + /// Otherwise you can get one from its parent resource using the GetMigrationAssessmentAvsAssessment method. + /// + public partial class MigrationAssessmentAvsAssessmentResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The groupName. + /// The assessmentName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics; + private readonly AvsAssessmentsRestOperations _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient; + private readonly MigrationAssessmentAvsAssessmentData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/groups/avsAssessments"; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentAvsAssessmentResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MigrationAssessmentAvsAssessmentResource(ArmClient client, MigrationAssessmentAvsAssessmentData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MigrationAssessmentAvsAssessmentResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string migrationAssessmentAvsAssessmentAvsAssessmentsOperationsApiVersion); + _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient = new AvsAssessmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentAvsAssessmentAvsAssessmentsOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MigrationAssessmentAvsAssessmentData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of MigrationAssessmentAvsAssessedMachineResources in the MigrationAssessmentAvsAssessment. + /// An object representing collection of MigrationAssessmentAvsAssessedMachineResources and their operations over a MigrationAssessmentAvsAssessedMachineResource. + public virtual MigrationAssessmentAvsAssessedMachineCollection GetMigrationAssessmentAvsAssessedMachines() + { + return GetCachedClient(client => new MigrationAssessmentAvsAssessedMachineCollection(client, Id)); + } + + /// + /// Get a AvsAssessedMachine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName}/avsAssessedMachines/{avsAssessedMachineName} + /// + /// + /// Operation Id + /// AvsAssessedMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// AVS assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMigrationAssessmentAvsAssessedMachineAsync(string avsAssessedMachineName, CancellationToken cancellationToken = default) + { + return await GetMigrationAssessmentAvsAssessedMachines().GetAsync(avsAssessedMachineName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AvsAssessedMachine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName}/avsAssessedMachines/{avsAssessedMachineName} + /// + /// + /// Operation Id + /// AvsAssessedMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// AVS assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMigrationAssessmentAvsAssessedMachine(string avsAssessedMachineName, CancellationToken cancellationToken = default) + { + return GetMigrationAssessmentAvsAssessedMachines().Get(avsAssessedMachineName, cancellationToken); + } + + /// + /// Get a AvsAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName} + /// + /// + /// Operation Id + /// AvsAssessmentsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessmentResource.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAvsAssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AvsAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName} + /// + /// + /// Operation Id + /// AvsAssessmentsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessmentResource.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentAvsAssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a AvsAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName} + /// + /// + /// Operation Id + /// AvsAssessmentsOperations_Delete + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessmentResource.Delete"); + scope.Start(); + try + { + var response = await _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AssessmentArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a AvsAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName} + /// + /// + /// Operation Id + /// AvsAssessmentsOperations_Delete + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessmentResource.Delete"); + scope.Start(); + try + { + var response = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AssessmentArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a AvsAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName} + /// + /// + /// Operation Id + /// AvsAssessmentsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, MigrationAssessmentAvsAssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessmentResource.Update"); + scope.Start(); + try + { + var response = await _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new MigrationAssessmentAvsAssessmentOperationSource(Client), _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics, Pipeline, _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a AvsAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName} + /// + /// + /// Operation Id + /// AvsAssessmentsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, MigrationAssessmentAvsAssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessmentResource.Update"); + scope.Start(); + try + { + var response = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new AssessmentArmOperation(new MigrationAssessmentAvsAssessmentOperationSource(Client), _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics, Pipeline, _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the URL for downloading the assessment in a report format. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName}/downloadUrl + /// + /// + /// Operation Id + /// AvsAssessmentsOperations_DownloadUrl + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> DownloadUrlAsync(WaitUntil waitUntil, BinaryData body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessmentResource.DownloadUrl"); + scope.Start(); + try + { + var response = await _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.DownloadUrlAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new AssessmentReportDownloadUriOperationSource(), _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics, Pipeline, _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.CreateDownloadUrlRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the URL for downloading the assessment in a report format. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName}/downloadUrl + /// + /// + /// Operation Id + /// AvsAssessmentsOperations_DownloadUrl + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation DownloadUrl(WaitUntil waitUntil, BinaryData body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics.CreateScope("MigrationAssessmentAvsAssessmentResource.DownloadUrl"); + scope.Start(); + try + { + var response = _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.DownloadUrl(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new AssessmentArmOperation(new AssessmentReportDownloadUriOperationSource(), _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsClientDiagnostics, Pipeline, _migrationAssessmentAvsAssessmentAvsAssessmentsOperationsRestClient.CreateDownloadUrlRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentGroupCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentGroupCollection.cs new file mode 100644 index 000000000000..0873877a5c33 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentGroupCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMigrationAssessmentGroups method from an instance of . + /// + public partial class MigrationAssessmentGroupCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _migrationAssessmentGroupGroupsOperationsClientDiagnostics; + private readonly GroupsRestOperations _migrationAssessmentGroupGroupsOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentGroupCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MigrationAssessmentGroupCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentGroupGroupsOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", MigrationAssessmentGroupResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MigrationAssessmentGroupResource.ResourceType, out string migrationAssessmentGroupGroupsOperationsApiVersion); + _migrationAssessmentGroupGroupsOperationsRestClient = new GroupsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentGroupGroupsOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MigrationAssessmentAssessmentProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MigrationAssessmentAssessmentProjectResource.ResourceType), nameof(id)); + } + + /// + /// Create a Group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// + /// + /// Operation Id + /// GroupsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Group ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string groupName, MigrationAssessmentGroupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentGroupGroupsOperationsClientDiagnostics.CreateScope("MigrationAssessmentGroupCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _migrationAssessmentGroupGroupsOperationsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, groupName, data, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new MigrationAssessmentGroupOperationSource(Client), _migrationAssessmentGroupGroupsOperationsClientDiagnostics, Pipeline, _migrationAssessmentGroupGroupsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, groupName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a Group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// + /// + /// Operation Id + /// GroupsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Group ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string groupName, MigrationAssessmentGroupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentGroupGroupsOperationsClientDiagnostics.CreateScope("MigrationAssessmentGroupCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _migrationAssessmentGroupGroupsOperationsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, groupName, data, cancellationToken); + var operation = new AssessmentArmOperation(new MigrationAssessmentGroupOperationSource(Client), _migrationAssessmentGroupGroupsOperationsClientDiagnostics, Pipeline, _migrationAssessmentGroupGroupsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, groupName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// + /// + /// Operation Id + /// GroupsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Group ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var scope = _migrationAssessmentGroupGroupsOperationsClientDiagnostics.CreateScope("MigrationAssessmentGroupCollection.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentGroupGroupsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, groupName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentGroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// + /// + /// Operation Id + /// GroupsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Group ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var scope = _migrationAssessmentGroupGroupsOperationsClientDiagnostics.CreateScope("MigrationAssessmentGroupCollection.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentGroupGroupsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, groupName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentGroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Group resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups + /// + /// + /// Operation Id + /// GroupsOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentGroupGroupsOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentGroupGroupsOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentGroupResource(Client, MigrationAssessmentGroupData.DeserializeMigrationAssessmentGroupData(e)), _migrationAssessmentGroupGroupsOperationsClientDiagnostics, Pipeline, "MigrationAssessmentGroupCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List Group resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups + /// + /// + /// Operation Id + /// GroupsOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentGroupGroupsOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentGroupGroupsOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentGroupResource(Client, MigrationAssessmentGroupData.DeserializeMigrationAssessmentGroupData(e)), _migrationAssessmentGroupGroupsOperationsClientDiagnostics, Pipeline, "MigrationAssessmentGroupCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// + /// + /// Operation Id + /// GroupsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Group ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var scope = _migrationAssessmentGroupGroupsOperationsClientDiagnostics.CreateScope("MigrationAssessmentGroupCollection.Exists"); + scope.Start(); + try + { + var response = await _migrationAssessmentGroupGroupsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, groupName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// + /// + /// Operation Id + /// GroupsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Group ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var scope = _migrationAssessmentGroupGroupsOperationsClientDiagnostics.CreateScope("MigrationAssessmentGroupCollection.Exists"); + scope.Start(); + try + { + var response = _migrationAssessmentGroupGroupsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, groupName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// + /// + /// Operation Id + /// GroupsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Group ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var scope = _migrationAssessmentGroupGroupsOperationsClientDiagnostics.CreateScope("MigrationAssessmentGroupCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _migrationAssessmentGroupGroupsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, groupName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentGroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// + /// + /// Operation Id + /// GroupsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Group ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var scope = _migrationAssessmentGroupGroupsOperationsClientDiagnostics.CreateScope("MigrationAssessmentGroupCollection.GetIfExists"); + scope.Start(); + try + { + var response = _migrationAssessmentGroupGroupsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, groupName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentGroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentGroupData.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentGroupData.Serialization.cs new file mode 100644 index 000000000000..e7a62870bf83 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentGroupData.Serialization.cs @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentGroupData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentGroupData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(GroupStatus)) + { + writer.WritePropertyName("groupStatus"u8); + writer.WriteStringValue(GroupStatus.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(MachineCount)) + { + writer.WritePropertyName("machineCount"u8); + writer.WriteNumberValue(MachineCount.Value); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Assessments)) + { + writer.WritePropertyName("assessments"u8); + writer.WriteStartArray(); + foreach (var item in Assessments) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(SupportedAssessmentTypes)) + { + writer.WritePropertyName("supportedAssessmentTypes"u8); + writer.WriteStartArray(); + foreach (var item in SupportedAssessmentTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(AreAssessmentsRunning)) + { + writer.WritePropertyName("areAssessmentsRunning"u8); + writer.WriteBooleanValue(AreAssessmentsRunning.Value); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("createdTimestamp"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(UpdatedOn)) + { + writer.WritePropertyName("updatedTimestamp"u8); + writer.WriteStringValue(UpdatedOn.Value, "O"); + } + if (Optional.IsDefined(GroupType)) + { + writer.WritePropertyName("groupType"u8); + writer.WriteStringValue(GroupType.Value.ToString()); + } + writer.WriteEndObject(); + } + + MigrationAssessmentGroupData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentGroupData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentGroupData(document.RootElement, options); + } + + internal static MigrationAssessmentGroupData DeserializeMigrationAssessmentGroupData(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; + MigrationAssessmentProvisioningState? provisioningState = default; + MigrationAssessmentGroupStatus? groupStatus = default; + int? machineCount = default; + IReadOnlyList assessments = default; + IList supportedAssessmentTypes = default; + bool? areAssessmentsRunning = default; + DateTimeOffset? createdTimestamp = default; + DateTimeOffset? updatedTimestamp = default; + MigrationAssessmentGroupType? groupType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(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("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new MigrationAssessmentProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("groupStatus"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + groupStatus = new MigrationAssessmentGroupStatus(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("machineCount"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + machineCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("assessments"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + assessments = array; + continue; + } + if (property0.NameEquals("supportedAssessmentTypes"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new AssessmentType(item.GetString())); + } + supportedAssessmentTypes = array; + continue; + } + if (property0.NameEquals("areAssessmentsRunning"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + areAssessmentsRunning = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("createdTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("updatedTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("groupType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + groupType = new MigrationAssessmentGroupType(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentGroupData( + id, + name, + type, + systemData, + provisioningState, + groupStatus, + machineCount, + assessments ?? new ChangeTrackingList(), + supportedAssessmentTypes ?? new ChangeTrackingList(), + areAssessmentsRunning, + createdTimestamp, + updatedTimestamp, + groupType, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentGroupData)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentGroupData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentGroupData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentGroupData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentGroupData.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentGroupData.cs new file mode 100644 index 000000000000..195b51244e74 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentGroupData.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing the MigrationAssessmentGroup data model. + /// Group resource. + /// + public partial class MigrationAssessmentGroupData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MigrationAssessmentGroupData() + { + Assessments = new ChangeTrackingList(); + SupportedAssessmentTypes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The status of the last operation. + /// Whether the group has been created and is valid. + /// Number of machines part of this group. + /// List of References to Assessments created on this group. + /// List of assessment types supported on this group. + /// If the assessments are in running state. + /// Time when this group was created. Date-Time represented in ISO-8601 format. + /// Time when this group was last updated. Date-Time represented in ISO-8601 format. + /// The type of group. + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MigrationAssessmentProvisioningState? provisioningState, MigrationAssessmentGroupStatus? groupStatus, int? machineCount, IReadOnlyList assessments, IList supportedAssessmentTypes, bool? areAssessmentsRunning, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, MigrationAssessmentGroupType? groupType, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + GroupStatus = groupStatus; + MachineCount = machineCount; + Assessments = assessments; + SupportedAssessmentTypes = supportedAssessmentTypes; + AreAssessmentsRunning = areAssessmentsRunning; + CreatedOn = createdOn; + UpdatedOn = updatedOn; + GroupType = groupType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The status of the last operation. + public MigrationAssessmentProvisioningState? ProvisioningState { get; set; } + /// Whether the group has been created and is valid. + public MigrationAssessmentGroupStatus? GroupStatus { get; } + /// Number of machines part of this group. + public int? MachineCount { get; } + /// List of References to Assessments created on this group. + public IReadOnlyList Assessments { get; } + /// List of assessment types supported on this group. + public IList SupportedAssessmentTypes { get; } + /// If the assessments are in running state. + public bool? AreAssessmentsRunning { get; } + /// Time when this group was created. Date-Time represented in ISO-8601 format. + public DateTimeOffset? CreatedOn { get; } + /// Time when this group was last updated. Date-Time represented in ISO-8601 format. + public DateTimeOffset? UpdatedOn { get; } + /// The type of group. + public MigrationAssessmentGroupType? GroupType { get; set; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentGroupResource.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentGroupResource.Serialization.cs new file mode 100644 index 000000000000..a1d9e2c96dc8 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentGroupResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentGroupResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MigrationAssessmentGroupData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MigrationAssessmentGroupData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentGroupResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentGroupResource.cs new file mode 100644 index 000000000000..ec25a11e4549 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentGroupResource.cs @@ -0,0 +1,651 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A Class representing a MigrationAssessmentGroup along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMigrationAssessmentGroupResource method. + /// Otherwise you can get one from its parent resource using the GetMigrationAssessmentGroup method. + /// + public partial class MigrationAssessmentGroupResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The groupName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _migrationAssessmentGroupGroupsOperationsClientDiagnostics; + private readonly GroupsRestOperations _migrationAssessmentGroupGroupsOperationsRestClient; + private readonly MigrationAssessmentGroupData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/groups"; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentGroupResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MigrationAssessmentGroupResource(ArmClient client, MigrationAssessmentGroupData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MigrationAssessmentGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentGroupGroupsOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string migrationAssessmentGroupGroupsOperationsApiVersion); + _migrationAssessmentGroupGroupsOperationsRestClient = new GroupsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentGroupGroupsOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MigrationAssessmentGroupData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of MigrationAssessmentAssessmentResources in the MigrationAssessmentGroup. + /// An object representing collection of MigrationAssessmentAssessmentResources and their operations over a MigrationAssessmentAssessmentResource. + public virtual MigrationAssessmentAssessmentCollection GetMigrationAssessmentAssessments() + { + return GetCachedClient(client => new MigrationAssessmentAssessmentCollection(client, Id)); + } + + /// + /// Get a Assessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// + /// + /// Operation Id + /// AssessmentsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Machine Assessment ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMigrationAssessmentAssessmentAsync(string assessmentName, CancellationToken cancellationToken = default) + { + return await GetMigrationAssessmentAssessments().GetAsync(assessmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Assessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// + /// + /// Operation Id + /// AssessmentsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Machine Assessment ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMigrationAssessmentAssessment(string assessmentName, CancellationToken cancellationToken = default) + { + return GetMigrationAssessmentAssessments().Get(assessmentName, cancellationToken); + } + + /// Gets a collection of MigrationAssessmentAvsAssessmentResources in the MigrationAssessmentGroup. + /// An object representing collection of MigrationAssessmentAvsAssessmentResources and their operations over a MigrationAssessmentAvsAssessmentResource. + public virtual MigrationAssessmentAvsAssessmentCollection GetMigrationAssessmentAvsAssessments() + { + return GetCachedClient(client => new MigrationAssessmentAvsAssessmentCollection(client, Id)); + } + + /// + /// Get a AvsAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName} + /// + /// + /// Operation Id + /// AvsAssessmentsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// AVS Assessment ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMigrationAssessmentAvsAssessmentAsync(string assessmentName, CancellationToken cancellationToken = default) + { + return await GetMigrationAssessmentAvsAssessments().GetAsync(assessmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AvsAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/avsAssessments/{assessmentName} + /// + /// + /// Operation Id + /// AvsAssessmentsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// AVS Assessment ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMigrationAssessmentAvsAssessment(string assessmentName, CancellationToken cancellationToken = default) + { + return GetMigrationAssessmentAvsAssessments().Get(assessmentName, cancellationToken); + } + + /// Gets a collection of MigrationAssessmentSqlAssessmentV2Resources in the MigrationAssessmentGroup. + /// An object representing collection of MigrationAssessmentSqlAssessmentV2Resources and their operations over a MigrationAssessmentSqlAssessmentV2Resource. + public virtual MigrationAssessmentSqlAssessmentV2Collection GetMigrationAssessmentSqlAssessmentV2s() + { + return GetCachedClient(client => new MigrationAssessmentSqlAssessmentV2Collection(client, Id)); + } + + /// + /// Get a SqlAssessmentV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName} + /// + /// + /// Operation Id + /// SqlAssessmentV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// SQL Assessment arm name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMigrationAssessmentSqlAssessmentV2Async(string assessmentName, CancellationToken cancellationToken = default) + { + return await GetMigrationAssessmentSqlAssessmentV2s().GetAsync(assessmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a SqlAssessmentV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName} + /// + /// + /// Operation Id + /// SqlAssessmentV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// SQL Assessment arm name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMigrationAssessmentSqlAssessmentV2(string assessmentName, CancellationToken cancellationToken = default) + { + return GetMigrationAssessmentSqlAssessmentV2s().Get(assessmentName, cancellationToken); + } + + /// + /// Get a Group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// + /// + /// Operation Id + /// GroupsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentGroupGroupsOperationsClientDiagnostics.CreateScope("MigrationAssessmentGroupResource.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentGroupGroupsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentGroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// + /// + /// Operation Id + /// GroupsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentGroupGroupsOperationsClientDiagnostics.CreateScope("MigrationAssessmentGroupResource.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentGroupGroupsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentGroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// + /// + /// Operation Id + /// GroupsOperations_Delete + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentGroupGroupsOperationsClientDiagnostics.CreateScope("MigrationAssessmentGroupResource.Delete"); + scope.Start(); + try + { + var response = await _migrationAssessmentGroupGroupsOperationsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _migrationAssessmentGroupGroupsOperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AssessmentArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// + /// + /// Operation Id + /// GroupsOperations_Delete + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentGroupGroupsOperationsClientDiagnostics.CreateScope("MigrationAssessmentGroupResource.Delete"); + scope.Start(); + try + { + var response = _migrationAssessmentGroupGroupsOperationsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _migrationAssessmentGroupGroupsOperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AssessmentArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a Group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// + /// + /// Operation Id + /// GroupsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, MigrationAssessmentGroupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentGroupGroupsOperationsClientDiagnostics.CreateScope("MigrationAssessmentGroupResource.Update"); + scope.Start(); + try + { + var response = await _migrationAssessmentGroupGroupsOperationsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new MigrationAssessmentGroupOperationSource(Client), _migrationAssessmentGroupGroupsOperationsClientDiagnostics, Pipeline, _migrationAssessmentGroupGroupsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a Group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// + /// + /// Operation Id + /// GroupsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, MigrationAssessmentGroupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentGroupGroupsOperationsClientDiagnostics.CreateScope("MigrationAssessmentGroupResource.Update"); + scope.Start(); + try + { + var response = _migrationAssessmentGroupGroupsOperationsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new AssessmentArmOperation(new MigrationAssessmentGroupOperationSource(Client), _migrationAssessmentGroupGroupsOperationsClientDiagnostics, Pipeline, _migrationAssessmentGroupGroupsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update machines in group by adding or removing machines. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/updateMachines + /// + /// + /// Operation Id + /// GroupsOperations_UpdateMachines + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateMachinesAsync(WaitUntil waitUntil, MigrateGroupUpdateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _migrationAssessmentGroupGroupsOperationsClientDiagnostics.CreateScope("MigrationAssessmentGroupResource.UpdateMachines"); + scope.Start(); + try + { + var response = await _migrationAssessmentGroupGroupsOperationsRestClient.UpdateMachinesAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new MigrationAssessmentGroupOperationSource(Client), _migrationAssessmentGroupGroupsOperationsClientDiagnostics, Pipeline, _migrationAssessmentGroupGroupsOperationsRestClient.CreateUpdateMachinesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update machines in group by adding or removing machines. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/updateMachines + /// + /// + /// Operation Id + /// GroupsOperations_UpdateMachines + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation UpdateMachines(WaitUntil waitUntil, MigrateGroupUpdateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _migrationAssessmentGroupGroupsOperationsClientDiagnostics.CreateScope("MigrationAssessmentGroupResource.UpdateMachines"); + scope.Start(); + try + { + var response = _migrationAssessmentGroupGroupsOperationsRestClient.UpdateMachines(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new AssessmentArmOperation(new MigrationAssessmentGroupOperationSource(Client), _migrationAssessmentGroupGroupsOperationsClientDiagnostics, Pipeline, _migrationAssessmentGroupGroupsOperationsRestClient.CreateUpdateMachinesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentHyperVCollectorCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentHyperVCollectorCollection.cs new file mode 100644 index 000000000000..156d6636652e --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentHyperVCollectorCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMigrationAssessmentHyperVCollectors method from an instance of . + /// + public partial class MigrationAssessmentHyperVCollectorCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsClientDiagnostics; + private readonly HypervCollectorsRestOperations _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentHyperVCollectorCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MigrationAssessmentHyperVCollectorCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", MigrationAssessmentHyperVCollectorResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MigrationAssessmentHyperVCollectorResource.ResourceType, out string migrationAssessmentHyperVCollectorHyperVCollectorsOperationsApiVersion); + _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient = new HypervCollectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentHyperVCollectorHyperVCollectorsOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MigrationAssessmentAssessmentProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MigrationAssessmentAssessmentProjectResource.ResourceType), nameof(id)); + } + + /// + /// Create a HypervCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hypervCollectorName} + /// + /// + /// Operation Id + /// HypervCollectorsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Hyper-V collector ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string hyperVCollectorName, MigrationAssessmentHyperVCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(hyperVCollectorName, nameof(hyperVCollectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentHyperVCollectorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, hyperVCollectorName, data, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new MigrationAssessmentHyperVCollectorOperationSource(Client), _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsClientDiagnostics, Pipeline, _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, hyperVCollectorName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a HypervCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hypervCollectorName} + /// + /// + /// Operation Id + /// HypervCollectorsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Hyper-V collector ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string hyperVCollectorName, MigrationAssessmentHyperVCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(hyperVCollectorName, nameof(hyperVCollectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentHyperVCollectorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, hyperVCollectorName, data, cancellationToken); + var operation = new AssessmentArmOperation(new MigrationAssessmentHyperVCollectorOperationSource(Client), _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsClientDiagnostics, Pipeline, _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, hyperVCollectorName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a HypervCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hypervCollectorName} + /// + /// + /// Operation Id + /// HypervCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Hyper-V collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string hyperVCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(hyperVCollectorName, nameof(hyperVCollectorName)); + + using var scope = _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentHyperVCollectorCollection.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, hyperVCollectorName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentHyperVCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a HypervCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hypervCollectorName} + /// + /// + /// Operation Id + /// HypervCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Hyper-V collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string hyperVCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(hyperVCollectorName, nameof(hyperVCollectorName)); + + using var scope = _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentHyperVCollectorCollection.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, hyperVCollectorName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentHyperVCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List HypervCollector resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors + /// + /// + /// Operation Id + /// HypervCollectorsOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentHyperVCollectorResource(Client, MigrationAssessmentHyperVCollectorData.DeserializeMigrationAssessmentHyperVCollectorData(e)), _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsClientDiagnostics, Pipeline, "MigrationAssessmentHyperVCollectorCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List HypervCollector resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors + /// + /// + /// Operation Id + /// HypervCollectorsOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentHyperVCollectorResource(Client, MigrationAssessmentHyperVCollectorData.DeserializeMigrationAssessmentHyperVCollectorData(e)), _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsClientDiagnostics, Pipeline, "MigrationAssessmentHyperVCollectorCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hypervCollectorName} + /// + /// + /// Operation Id + /// HypervCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Hyper-V collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string hyperVCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(hyperVCollectorName, nameof(hyperVCollectorName)); + + using var scope = _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentHyperVCollectorCollection.Exists"); + scope.Start(); + try + { + var response = await _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, hyperVCollectorName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hypervCollectorName} + /// + /// + /// Operation Id + /// HypervCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Hyper-V collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string hyperVCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(hyperVCollectorName, nameof(hyperVCollectorName)); + + using var scope = _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentHyperVCollectorCollection.Exists"); + scope.Start(); + try + { + var response = _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, hyperVCollectorName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hypervCollectorName} + /// + /// + /// Operation Id + /// HypervCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Hyper-V collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string hyperVCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(hyperVCollectorName, nameof(hyperVCollectorName)); + + using var scope = _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentHyperVCollectorCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, hyperVCollectorName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentHyperVCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hypervCollectorName} + /// + /// + /// Operation Id + /// HypervCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Hyper-V collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string hyperVCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(hyperVCollectorName, nameof(hyperVCollectorName)); + + using var scope = _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentHyperVCollectorCollection.GetIfExists"); + scope.Start(); + try + { + var response = _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, hyperVCollectorName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentHyperVCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentHyperVCollectorData.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentHyperVCollectorData.Serialization.cs new file mode 100644 index 000000000000..be872922f192 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentHyperVCollectorData.Serialization.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentHyperVCollectorData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentHyperVCollectorData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(AgentProperties)) + { + writer.WritePropertyName("agentProperties"u8); + writer.WriteObjectValue(AgentProperties, options); + } + if (Optional.IsDefined(DiscoverySiteId)) + { + writer.WritePropertyName("discoverySiteId"u8); + writer.WriteStringValue(DiscoverySiteId); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("createdTimestamp"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(UpdatedOn)) + { + writer.WritePropertyName("updatedTimestamp"u8); + writer.WriteStringValue(UpdatedOn.Value, "O"); + } + writer.WriteEndObject(); + } + + MigrationAssessmentHyperVCollectorData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentHyperVCollectorData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentHyperVCollectorData(document.RootElement, options); + } + + internal static MigrationAssessmentHyperVCollectorData DeserializeMigrationAssessmentHyperVCollectorData(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; + MigrationAssessmentProvisioningState? provisioningState = default; + CollectorAgentPropertiesBase agentProperties = default; + string discoverySiteId = default; + DateTimeOffset? createdTimestamp = default; + DateTimeOffset? updatedTimestamp = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(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("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new MigrationAssessmentProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("agentProperties"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + agentProperties = CollectorAgentPropertiesBase.DeserializeCollectorAgentPropertiesBase(property0.Value, options); + continue; + } + if (property0.NameEquals("discoverySiteId"u8)) + { + discoverySiteId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("createdTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("updatedTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentHyperVCollectorData( + id, + name, + type, + systemData, + provisioningState, + agentProperties, + discoverySiteId, + createdTimestamp, + updatedTimestamp, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentHyperVCollectorData)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentHyperVCollectorData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentHyperVCollectorData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentHyperVCollectorData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentHyperVCollectorData.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentHyperVCollectorData.cs new file mode 100644 index 000000000000..9ee4e78b9295 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentHyperVCollectorData.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing the MigrationAssessmentHyperVCollector data model. + /// Hyper-V collector resource. + /// + public partial class MigrationAssessmentHyperVCollectorData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MigrationAssessmentHyperVCollectorData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The status of the last operation. + /// Gets or sets the collector agent properties. + /// Gets the discovery site id. + /// Gets the Timestamp when collector was created. + /// Timestamp when collector was last updated. + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentHyperVCollectorData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MigrationAssessmentProvisioningState? provisioningState, CollectorAgentPropertiesBase agentProperties, string discoverySiteId, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + AgentProperties = agentProperties; + DiscoverySiteId = discoverySiteId; + CreatedOn = createdOn; + UpdatedOn = updatedOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The status of the last operation. + public MigrationAssessmentProvisioningState? ProvisioningState { get; set; } + /// Gets or sets the collector agent properties. + public CollectorAgentPropertiesBase AgentProperties { get; set; } + /// Gets the discovery site id. + public string DiscoverySiteId { get; set; } + /// Gets the Timestamp when collector was created. + public DateTimeOffset? CreatedOn { get; } + /// Timestamp when collector was last updated. + public DateTimeOffset? UpdatedOn { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentHyperVCollectorResource.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentHyperVCollectorResource.Serialization.cs new file mode 100644 index 000000000000..21aae3d4e253 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentHyperVCollectorResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentHyperVCollectorResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MigrationAssessmentHyperVCollectorData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MigrationAssessmentHyperVCollectorData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentHyperVCollectorResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentHyperVCollectorResource.cs new file mode 100644 index 000000000000..7dc5f48f03e4 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentHyperVCollectorResource.cs @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A Class representing a MigrationAssessmentHyperVCollector along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMigrationAssessmentHyperVCollectorResource method. + /// Otherwise you can get one from its parent resource using the GetMigrationAssessmentHyperVCollector method. + /// + public partial class MigrationAssessmentHyperVCollectorResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The hyperVCollectorName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string hyperVCollectorName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hyperVCollectorName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsClientDiagnostics; + private readonly HypervCollectorsRestOperations _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient; + private readonly MigrationAssessmentHyperVCollectorData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/hypervcollectors"; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentHyperVCollectorResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MigrationAssessmentHyperVCollectorResource(ArmClient client, MigrationAssessmentHyperVCollectorData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MigrationAssessmentHyperVCollectorResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string migrationAssessmentHyperVCollectorHyperVCollectorsOperationsApiVersion); + _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient = new HypervCollectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentHyperVCollectorHyperVCollectorsOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MigrationAssessmentHyperVCollectorData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a HypervCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hypervCollectorName} + /// + /// + /// Operation Id + /// HypervCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentHyperVCollectorResource.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentHyperVCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a HypervCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hypervCollectorName} + /// + /// + /// Operation Id + /// HypervCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentHyperVCollectorResource.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentHyperVCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a HypervCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hypervCollectorName} + /// + /// + /// Operation Id + /// HypervCollectorsOperations_Delete + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentHyperVCollectorResource.Delete"); + scope.Start(); + try + { + var response = await _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AssessmentArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a HypervCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hypervCollectorName} + /// + /// + /// Operation Id + /// HypervCollectorsOperations_Delete + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentHyperVCollectorResource.Delete"); + scope.Start(); + try + { + var response = _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AssessmentArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a HypervCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hypervCollectorName} + /// + /// + /// Operation Id + /// HypervCollectorsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, MigrationAssessmentHyperVCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentHyperVCollectorResource.Update"); + scope.Start(); + try + { + var response = await _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new MigrationAssessmentHyperVCollectorOperationSource(Client), _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsClientDiagnostics, Pipeline, _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a HypervCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hypervCollectorName} + /// + /// + /// Operation Id + /// HypervCollectorsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, MigrationAssessmentHyperVCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentHyperVCollectorResource.Update"); + scope.Start(); + try + { + var response = _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new AssessmentArmOperation(new MigrationAssessmentHyperVCollectorOperationSource(Client), _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsClientDiagnostics, Pipeline, _migrationAssessmentHyperVCollectorHyperVCollectorsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentImportCollectorCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentImportCollectorCollection.cs new file mode 100644 index 000000000000..5651a0a80198 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentImportCollectorCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMigrationAssessmentImportCollectors method from an instance of . + /// + public partial class MigrationAssessmentImportCollectorCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _migrationAssessmentImportCollectorImportCollectorsOperationsClientDiagnostics; + private readonly ImportCollectorsRestOperations _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentImportCollectorCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MigrationAssessmentImportCollectorCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentImportCollectorImportCollectorsOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", MigrationAssessmentImportCollectorResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MigrationAssessmentImportCollectorResource.ResourceType, out string migrationAssessmentImportCollectorImportCollectorsOperationsApiVersion); + _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient = new ImportCollectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentImportCollectorImportCollectorsOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MigrationAssessmentAssessmentProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MigrationAssessmentAssessmentProjectResource.ResourceType), nameof(id)); + } + + /// + /// Create a ImportCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// + /// + /// Operation Id + /// ImportCollectorsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Import collector ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string importCollectorName, MigrationAssessmentImportCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importCollectorName, nameof(importCollectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentImportCollectorImportCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentImportCollectorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importCollectorName, data, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new MigrationAssessmentImportCollectorOperationSource(Client), _migrationAssessmentImportCollectorImportCollectorsOperationsClientDiagnostics, Pipeline, _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importCollectorName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a ImportCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// + /// + /// Operation Id + /// ImportCollectorsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Import collector ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string importCollectorName, MigrationAssessmentImportCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importCollectorName, nameof(importCollectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentImportCollectorImportCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentImportCollectorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importCollectorName, data, cancellationToken); + var operation = new AssessmentArmOperation(new MigrationAssessmentImportCollectorOperationSource(Client), _migrationAssessmentImportCollectorImportCollectorsOperationsClientDiagnostics, Pipeline, _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importCollectorName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ImportCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// + /// + /// Operation Id + /// ImportCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Import collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string importCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importCollectorName, nameof(importCollectorName)); + + using var scope = _migrationAssessmentImportCollectorImportCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentImportCollectorCollection.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importCollectorName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentImportCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ImportCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// + /// + /// Operation Id + /// ImportCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Import collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string importCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importCollectorName, nameof(importCollectorName)); + + using var scope = _migrationAssessmentImportCollectorImportCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentImportCollectorCollection.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importCollectorName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentImportCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List ImportCollector resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors + /// + /// + /// Operation Id + /// ImportCollectorsOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentImportCollectorResource(Client, MigrationAssessmentImportCollectorData.DeserializeMigrationAssessmentImportCollectorData(e)), _migrationAssessmentImportCollectorImportCollectorsOperationsClientDiagnostics, Pipeline, "MigrationAssessmentImportCollectorCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List ImportCollector resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors + /// + /// + /// Operation Id + /// ImportCollectorsOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentImportCollectorResource(Client, MigrationAssessmentImportCollectorData.DeserializeMigrationAssessmentImportCollectorData(e)), _migrationAssessmentImportCollectorImportCollectorsOperationsClientDiagnostics, Pipeline, "MigrationAssessmentImportCollectorCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// + /// + /// Operation Id + /// ImportCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Import collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string importCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importCollectorName, nameof(importCollectorName)); + + using var scope = _migrationAssessmentImportCollectorImportCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentImportCollectorCollection.Exists"); + scope.Start(); + try + { + var response = await _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importCollectorName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// + /// + /// Operation Id + /// ImportCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Import collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string importCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importCollectorName, nameof(importCollectorName)); + + using var scope = _migrationAssessmentImportCollectorImportCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentImportCollectorCollection.Exists"); + scope.Start(); + try + { + var response = _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importCollectorName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// + /// + /// Operation Id + /// ImportCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Import collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string importCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importCollectorName, nameof(importCollectorName)); + + using var scope = _migrationAssessmentImportCollectorImportCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentImportCollectorCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importCollectorName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentImportCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// + /// + /// Operation Id + /// ImportCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Import collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string importCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importCollectorName, nameof(importCollectorName)); + + using var scope = _migrationAssessmentImportCollectorImportCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentImportCollectorCollection.GetIfExists"); + scope.Start(); + try + { + var response = _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importCollectorName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentImportCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentImportCollectorData.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentImportCollectorData.Serialization.cs new file mode 100644 index 000000000000..b78f7fc23b24 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentImportCollectorData.Serialization.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentImportCollectorData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentImportCollectorData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(DiscoverySiteId)) + { + writer.WritePropertyName("discoverySiteId"u8); + writer.WriteStringValue(DiscoverySiteId); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("createdTimestamp"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(UpdatedOn)) + { + writer.WritePropertyName("updatedTimestamp"u8); + writer.WriteStringValue(UpdatedOn.Value, "O"); + } + writer.WriteEndObject(); + } + + MigrationAssessmentImportCollectorData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentImportCollectorData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentImportCollectorData(document.RootElement, options); + } + + internal static MigrationAssessmentImportCollectorData DeserializeMigrationAssessmentImportCollectorData(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; + MigrationAssessmentProvisioningState? provisioningState = default; + string discoverySiteId = default; + DateTimeOffset? createdTimestamp = default; + DateTimeOffset? updatedTimestamp = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(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("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new MigrationAssessmentProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("discoverySiteId"u8)) + { + discoverySiteId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("createdTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("updatedTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentImportCollectorData( + id, + name, + type, + systemData, + provisioningState, + discoverySiteId, + createdTimestamp, + updatedTimestamp, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentImportCollectorData)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentImportCollectorData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentImportCollectorData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentImportCollectorData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentImportCollectorData.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentImportCollectorData.cs new file mode 100644 index 000000000000..a353a8f4d3fe --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentImportCollectorData.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing the MigrationAssessmentImportCollector data model. + /// Import collector resource. + /// + public partial class MigrationAssessmentImportCollectorData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MigrationAssessmentImportCollectorData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The status of the last operation. + /// Gets the discovery site id. + /// Gets the Timestamp when collector was created. + /// Timestamp when collector was last updated. + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentImportCollectorData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MigrationAssessmentProvisioningState? provisioningState, string discoverySiteId, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + DiscoverySiteId = discoverySiteId; + CreatedOn = createdOn; + UpdatedOn = updatedOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The status of the last operation. + public MigrationAssessmentProvisioningState? ProvisioningState { get; set; } + /// Gets the discovery site id. + public string DiscoverySiteId { get; set; } + /// Gets the Timestamp when collector was created. + public DateTimeOffset? CreatedOn { get; } + /// Timestamp when collector was last updated. + public DateTimeOffset? UpdatedOn { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentImportCollectorResource.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentImportCollectorResource.Serialization.cs new file mode 100644 index 000000000000..09240e79d2a3 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentImportCollectorResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentImportCollectorResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MigrationAssessmentImportCollectorData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MigrationAssessmentImportCollectorData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentImportCollectorResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentImportCollectorResource.cs new file mode 100644 index 000000000000..6e1b3a5f9d23 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentImportCollectorResource.cs @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A Class representing a MigrationAssessmentImportCollector along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMigrationAssessmentImportCollectorResource method. + /// Otherwise you can get one from its parent resource using the GetMigrationAssessmentImportCollector method. + /// + public partial class MigrationAssessmentImportCollectorResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The importCollectorName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string importCollectorName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _migrationAssessmentImportCollectorImportCollectorsOperationsClientDiagnostics; + private readonly ImportCollectorsRestOperations _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient; + private readonly MigrationAssessmentImportCollectorData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/importcollectors"; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentImportCollectorResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MigrationAssessmentImportCollectorResource(ArmClient client, MigrationAssessmentImportCollectorData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MigrationAssessmentImportCollectorResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentImportCollectorImportCollectorsOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string migrationAssessmentImportCollectorImportCollectorsOperationsApiVersion); + _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient = new ImportCollectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentImportCollectorImportCollectorsOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MigrationAssessmentImportCollectorData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a ImportCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// + /// + /// Operation Id + /// ImportCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentImportCollectorImportCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentImportCollectorResource.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentImportCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ImportCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// + /// + /// Operation Id + /// ImportCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentImportCollectorImportCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentImportCollectorResource.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentImportCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a ImportCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// + /// + /// Operation Id + /// ImportCollectorsOperations_Delete + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentImportCollectorImportCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentImportCollectorResource.Delete"); + scope.Start(); + try + { + var response = await _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AssessmentArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a ImportCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// + /// + /// Operation Id + /// ImportCollectorsOperations_Delete + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentImportCollectorImportCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentImportCollectorResource.Delete"); + scope.Start(); + try + { + var response = _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AssessmentArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a ImportCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// + /// + /// Operation Id + /// ImportCollectorsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, MigrationAssessmentImportCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentImportCollectorImportCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentImportCollectorResource.Update"); + scope.Start(); + try + { + var response = await _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new MigrationAssessmentImportCollectorOperationSource(Client), _migrationAssessmentImportCollectorImportCollectorsOperationsClientDiagnostics, Pipeline, _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a ImportCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// + /// + /// Operation Id + /// ImportCollectorsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, MigrationAssessmentImportCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentImportCollectorImportCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentImportCollectorResource.Update"); + scope.Start(); + try + { + var response = _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new AssessmentArmOperation(new MigrationAssessmentImportCollectorOperationSource(Client), _migrationAssessmentImportCollectorImportCollectorsOperationsClientDiagnostics, Pipeline, _migrationAssessmentImportCollectorImportCollectorsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentMachineCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentMachineCollection.cs new file mode 100644 index 000000000000..238a0a8347b2 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentMachineCollection.cs @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMigrationAssessmentMachines method from an instance of . + /// + public partial class MigrationAssessmentMachineCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _migrationAssessmentMachineMachinesOperationsClientDiagnostics; + private readonly MachinesRestOperations _migrationAssessmentMachineMachinesOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentMachineCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MigrationAssessmentMachineCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentMachineMachinesOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", MigrationAssessmentMachineResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MigrationAssessmentMachineResource.ResourceType, out string migrationAssessmentMachineMachinesOperationsApiVersion); + _migrationAssessmentMachineMachinesOperationsRestClient = new MachinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentMachineMachinesOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MigrationAssessmentAssessmentProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MigrationAssessmentAssessmentProjectResource.ResourceType), nameof(id)); + } + + /// + /// Get a Machine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/machines/{machineName} + /// + /// + /// Operation Id + /// MachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Assessible Machine ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var scope = _migrationAssessmentMachineMachinesOperationsClientDiagnostics.CreateScope("MigrationAssessmentMachineCollection.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentMachineMachinesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, machineName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentMachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Machine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/machines/{machineName} + /// + /// + /// Operation Id + /// MachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Assessible Machine ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var scope = _migrationAssessmentMachineMachinesOperationsClientDiagnostics.CreateScope("MigrationAssessmentMachineCollection.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentMachineMachinesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, machineName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentMachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Machine resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/machines + /// + /// + /// Operation Id + /// MachinesOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentMachineMachinesOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentMachineMachinesOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentMachineResource(Client, MigrationAssessmentMachineData.DeserializeMigrationAssessmentMachineData(e)), _migrationAssessmentMachineMachinesOperationsClientDiagnostics, Pipeline, "MigrationAssessmentMachineCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List Machine resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/machines + /// + /// + /// Operation Id + /// MachinesOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentMachineMachinesOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentMachineMachinesOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, pageSizeHint, continuationToken, totalRecordCount); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentMachineResource(Client, MigrationAssessmentMachineData.DeserializeMigrationAssessmentMachineData(e)), _migrationAssessmentMachineMachinesOperationsClientDiagnostics, Pipeline, "MigrationAssessmentMachineCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/machines/{machineName} + /// + /// + /// Operation Id + /// MachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Assessible Machine ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var scope = _migrationAssessmentMachineMachinesOperationsClientDiagnostics.CreateScope("MigrationAssessmentMachineCollection.Exists"); + scope.Start(); + try + { + var response = await _migrationAssessmentMachineMachinesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, machineName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/machines/{machineName} + /// + /// + /// Operation Id + /// MachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Assessible Machine ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var scope = _migrationAssessmentMachineMachinesOperationsClientDiagnostics.CreateScope("MigrationAssessmentMachineCollection.Exists"); + scope.Start(); + try + { + var response = _migrationAssessmentMachineMachinesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, machineName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/machines/{machineName} + /// + /// + /// Operation Id + /// MachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Assessible Machine ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var scope = _migrationAssessmentMachineMachinesOperationsClientDiagnostics.CreateScope("MigrationAssessmentMachineCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _migrationAssessmentMachineMachinesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, machineName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentMachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/machines/{machineName} + /// + /// + /// Operation Id + /// MachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Assessible Machine ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var scope = _migrationAssessmentMachineMachinesOperationsClientDiagnostics.CreateScope("MigrationAssessmentMachineCollection.GetIfExists"); + scope.Start(); + try + { + var response = _migrationAssessmentMachineMachinesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, machineName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentMachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentMachineData.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentMachineData.Serialization.cs new file mode 100644 index 000000000000..f818782856d4 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentMachineData.Serialization.cs @@ -0,0 +1,544 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentMachineData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentMachineData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(WorkloadSummary)) + { + writer.WritePropertyName("workloadSummary"u8); + writer.WriteObjectValue(WorkloadSummary, options); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(HostProcessor)) + { + writer.WritePropertyName("hostProcessor"u8); + writer.WriteObjectValue(HostProcessor, options); + } + if (options.Format != "W" && Optional.IsDefined(ProductSupportStatus)) + { + writer.WritePropertyName("productSupportStatus"u8); + writer.WriteObjectValue(ProductSupportStatus, options); + } + if (options.Format != "W" && Optional.IsDefined(DiscoveryMachineArmId)) + { + writer.WritePropertyName("discoveryMachineArmId"u8); + writer.WriteStringValue(DiscoveryMachineArmId); + } + if (options.Format != "W" && Optional.IsDefined(DatacenterManagementServerArmId)) + { + writer.WritePropertyName("datacenterManagementServerArmId"u8); + writer.WriteStringValue(DatacenterManagementServerArmId); + } + if (options.Format != "W" && Optional.IsDefined(DatacenterManagementServerName)) + { + writer.WritePropertyName("datacenterManagementServerName"u8); + writer.WriteStringValue(DatacenterManagementServerName); + } + if (options.Format != "W" && Optional.IsDefined(BootType)) + { + writer.WritePropertyName("bootType"u8); + writer.WriteStringValue(BootType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (options.Format != "W" && Optional.IsDefined(MegabytesOfMemory)) + { + writer.WritePropertyName("megabytesOfMemory"u8); + writer.WriteNumberValue(MegabytesOfMemory.Value); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfCores)) + { + writer.WritePropertyName("numberOfCores"u8); + writer.WriteNumberValue(NumberOfCores.Value); + } + if (options.Format != "W" && Optional.IsDefined(OperatingSystemType)) + { + writer.WritePropertyName("operatingSystemType"u8); + writer.WriteStringValue(OperatingSystemType); + } + if (options.Format != "W" && Optional.IsDefined(OperatingSystemName)) + { + writer.WritePropertyName("operatingSystemName"u8); + writer.WriteStringValue(OperatingSystemName); + } + if (options.Format != "W" && Optional.IsDefined(OperatingSystemVersion)) + { + writer.WritePropertyName("operatingSystemVersion"u8); + writer.WriteStringValue(OperatingSystemVersion); + } + if (options.Format != "W" && Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("createdTimestamp"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Disks)) + { + writer.WritePropertyName("disks"u8); + writer.WriteStartObject(); + foreach (var item in Disks) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Groups)) + { + writer.WritePropertyName("groups"u8); + writer.WriteStartArray(); + foreach (var item in Groups) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(NetworkAdapters)) + { + writer.WritePropertyName("networkAdapters"u8); + writer.WriteStartObject(); + foreach (var item in NetworkAdapters) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(SqlInstances)) + { + writer.WritePropertyName("sqlInstances"u8); + writer.WriteStartArray(); + foreach (var item in SqlInstances) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(WebApplications)) + { + writer.WritePropertyName("webApplications"u8); + writer.WriteStartArray(); + foreach (var item in WebApplications) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(UpdatedOn)) + { + writer.WritePropertyName("updatedTimestamp"u8); + writer.WriteStringValue(UpdatedOn.Value, "O"); + } + writer.WriteEndObject(); + } + + MigrationAssessmentMachineData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentMachineData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentMachineData(document.RootElement, options); + } + + internal static MigrationAssessmentMachineData DeserializeMigrationAssessmentMachineData(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; + WorkloadSummary workloadSummary = default; + IReadOnlyList errors = default; + ProcessorInfo hostProcessor = default; + ProductSupportStatus productSupportStatus = default; + ResourceIdentifier discoveryMachineArmId = default; + ResourceIdentifier datacenterManagementServerArmId = default; + string datacenterManagementServerName = default; + MachineBootType? bootType = default; + string displayName = default; + double? megabytesOfMemory = default; + int? numberOfCores = default; + string operatingSystemType = default; + string operatingSystemName = default; + string operatingSystemVersion = default; + string description = default; + DateTimeOffset? createdTimestamp = default; + IReadOnlyDictionary disks = default; + IReadOnlyList groups = default; + IReadOnlyDictionary networkAdapters = default; + IReadOnlyList sqlInstances = default; + IReadOnlyList webApplications = default; + DateTimeOffset? updatedTimestamp = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(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("workloadSummary"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + workloadSummary = WorkloadSummary.DeserializeWorkloadSummary(property0.Value, options); + continue; + } + if (property0.NameEquals("errors"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(MigrationAssessmentError.DeserializeMigrationAssessmentError(item, options)); + } + errors = array; + continue; + } + if (property0.NameEquals("hostProcessor"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hostProcessor = ProcessorInfo.DeserializeProcessorInfo(property0.Value, options); + continue; + } + if (property0.NameEquals("productSupportStatus"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + productSupportStatus = ProductSupportStatus.DeserializeProductSupportStatus(property0.Value, options); + continue; + } + if (property0.NameEquals("discoveryMachineArmId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + discoveryMachineArmId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("datacenterManagementServerArmId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + datacenterManagementServerArmId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("datacenterManagementServerName"u8)) + { + datacenterManagementServerName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("bootType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bootType = new MachineBootType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("displayName"u8)) + { + displayName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("megabytesOfMemory"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + megabytesOfMemory = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("numberOfCores"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfCores = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("operatingSystemType"u8)) + { + operatingSystemType = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("operatingSystemName"u8)) + { + operatingSystemName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("operatingSystemVersion"u8)) + { + operatingSystemVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("description"u8)) + { + description = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("createdTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("disks"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, MigrationAssessmentDisk.DeserializeMigrationAssessmentDisk(property1.Value, options)); + } + disks = dictionary; + continue; + } + if (property0.NameEquals("groups"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + groups = array; + continue; + } + if (property0.NameEquals("networkAdapters"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, MigrationAssessmentNetworkAdapter.DeserializeMigrationAssessmentNetworkAdapter(property1.Value, options)); + } + networkAdapters = dictionary; + continue; + } + if (property0.NameEquals("sqlInstances"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sqlInstances = array; + continue; + } + if (property0.NameEquals("webApplications"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + webApplications = array; + continue; + } + if (property0.NameEquals("updatedTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentMachineData( + id, + name, + type, + systemData, + workloadSummary, + errors ?? new ChangeTrackingList(), + hostProcessor, + productSupportStatus, + discoveryMachineArmId, + datacenterManagementServerArmId, + datacenterManagementServerName, + bootType, + displayName, + megabytesOfMemory, + numberOfCores, + operatingSystemType, + operatingSystemName, + operatingSystemVersion, + description, + createdTimestamp, + disks ?? new ChangeTrackingDictionary(), + groups ?? new ChangeTrackingList(), + networkAdapters ?? new ChangeTrackingDictionary(), + sqlInstances ?? new ChangeTrackingList(), + webApplications ?? new ChangeTrackingList(), + updatedTimestamp, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentMachineData)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentMachineData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentMachineData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentMachineData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentMachineData.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentMachineData.cs new file mode 100644 index 000000000000..79cd703a63a1 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentMachineData.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing the MigrationAssessmentMachine data model. + /// Machine resource. + /// + public partial class MigrationAssessmentMachineData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MigrationAssessmentMachineData() + { + Errors = new ChangeTrackingList(); + Disks = new ChangeTrackingDictionary(); + Groups = new ChangeTrackingList(); + NetworkAdapters = new ChangeTrackingDictionary(); + SqlInstances = new ChangeTrackingList(); + WebApplications = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets or sets workload summary. + /// List of errors for this machine. + /// Gets Processor details of the host. + /// Gets the product support status related details. + /// Site id of machine discovered in private data center. + /// The data center management server ARM Id for the machine. + /// The data center management server name for the machine. + /// Boot type of machine discovered in private data center. + /// Display Name of the Machine. + /// Megabytes of memory found allocated for the machine in private data center. + /// Number of CPU cores found on the machine. + /// Operating system as reported by datacenter management solution. + /// Operating system as reported by datacenter management solution. + /// Operating system version as reported by datacenter management solution. + /// Description for the machine. + /// When was machine first created. + /// Disks attached to the machine discovered in private data center. + /// Gets the References to the groups that this machine is member of. + /// Network adapters attached to the machine discovered in private data center. + /// SQL instances discovered on the machine. + /// Web applications discovered on the machine. + /// When was machine last updated. + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentMachineData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, WorkloadSummary workloadSummary, IReadOnlyList errors, ProcessorInfo hostProcessor, ProductSupportStatus productSupportStatus, ResourceIdentifier discoveryMachineArmId, ResourceIdentifier datacenterManagementServerArmId, string datacenterManagementServerName, MachineBootType? bootType, string displayName, double? megabytesOfMemory, int? numberOfCores, string operatingSystemType, string operatingSystemName, string operatingSystemVersion, string description, DateTimeOffset? createdOn, IReadOnlyDictionary disks, IReadOnlyList groups, IReadOnlyDictionary networkAdapters, IReadOnlyList sqlInstances, IReadOnlyList webApplications, DateTimeOffset? updatedOn, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + WorkloadSummary = workloadSummary; + Errors = errors; + HostProcessor = hostProcessor; + ProductSupportStatus = productSupportStatus; + DiscoveryMachineArmId = discoveryMachineArmId; + DatacenterManagementServerArmId = datacenterManagementServerArmId; + DatacenterManagementServerName = datacenterManagementServerName; + BootType = bootType; + DisplayName = displayName; + MegabytesOfMemory = megabytesOfMemory; + NumberOfCores = numberOfCores; + OperatingSystemType = operatingSystemType; + OperatingSystemName = operatingSystemName; + OperatingSystemVersion = operatingSystemVersion; + Description = description; + CreatedOn = createdOn; + Disks = disks; + Groups = groups; + NetworkAdapters = networkAdapters; + SqlInstances = sqlInstances; + WebApplications = webApplications; + UpdatedOn = updatedOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets workload summary. + public WorkloadSummary WorkloadSummary { get; } + /// List of errors for this machine. + public IReadOnlyList Errors { get; } + /// Gets Processor details of the host. + public ProcessorInfo HostProcessor { get; } + /// Gets the product support status related details. + public ProductSupportStatus ProductSupportStatus { get; } + /// Site id of machine discovered in private data center. + public ResourceIdentifier DiscoveryMachineArmId { get; } + /// The data center management server ARM Id for the machine. + public ResourceIdentifier DatacenterManagementServerArmId { get; } + /// The data center management server name for the machine. + public string DatacenterManagementServerName { get; } + /// Boot type of machine discovered in private data center. + public MachineBootType? BootType { get; } + /// Display Name of the Machine. + public string DisplayName { get; } + /// Megabytes of memory found allocated for the machine in private data center. + public double? MegabytesOfMemory { get; } + /// Number of CPU cores found on the machine. + public int? NumberOfCores { get; } + /// Operating system as reported by datacenter management solution. + public string OperatingSystemType { get; } + /// Operating system as reported by datacenter management solution. + public string OperatingSystemName { get; } + /// Operating system version as reported by datacenter management solution. + public string OperatingSystemVersion { get; } + /// Description for the machine. + public string Description { get; } + /// When was machine first created. + public DateTimeOffset? CreatedOn { get; } + /// Disks attached to the machine discovered in private data center. + public IReadOnlyDictionary Disks { get; } + /// Gets the References to the groups that this machine is member of. + public IReadOnlyList Groups { get; } + /// Network adapters attached to the machine discovered in private data center. + public IReadOnlyDictionary NetworkAdapters { get; } + /// SQL instances discovered on the machine. + public IReadOnlyList SqlInstances { get; } + /// Web applications discovered on the machine. + public IReadOnlyList WebApplications { get; } + /// When was machine last updated. + public DateTimeOffset? UpdatedOn { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentMachineResource.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentMachineResource.Serialization.cs new file mode 100644 index 000000000000..b3f9eb2aa586 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentMachineResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentMachineResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MigrationAssessmentMachineData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MigrationAssessmentMachineData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentMachineResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentMachineResource.cs new file mode 100644 index 000000000000..94176dc6ab52 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentMachineResource.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A Class representing a MigrationAssessmentMachine along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMigrationAssessmentMachineResource method. + /// Otherwise you can get one from its parent resource using the GetMigrationAssessmentMachine method. + /// + public partial class MigrationAssessmentMachineResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The machineName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string machineName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/machines/{machineName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _migrationAssessmentMachineMachinesOperationsClientDiagnostics; + private readonly MachinesRestOperations _migrationAssessmentMachineMachinesOperationsRestClient; + private readonly MigrationAssessmentMachineData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/machines"; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentMachineResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MigrationAssessmentMachineResource(ArmClient client, MigrationAssessmentMachineData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MigrationAssessmentMachineResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentMachineMachinesOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string migrationAssessmentMachineMachinesOperationsApiVersion); + _migrationAssessmentMachineMachinesOperationsRestClient = new MachinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentMachineMachinesOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MigrationAssessmentMachineData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a Machine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/machines/{machineName} + /// + /// + /// Operation Id + /// MachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentMachineMachinesOperationsClientDiagnostics.CreateScope("MigrationAssessmentMachineResource.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentMachineMachinesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentMachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Machine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/machines/{machineName} + /// + /// + /// Operation Id + /// MachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentMachineMachinesOperationsClientDiagnostics.CreateScope("MigrationAssessmentMachineResource.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentMachineMachinesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentMachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateEndpointConnectionCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateEndpointConnectionCollection.cs new file mode 100644 index 000000000000..a947e825dad8 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateEndpointConnectionCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMigrationAssessmentPrivateEndpointConnections method from an instance of . + /// + public partial class MigrationAssessmentPrivateEndpointConnectionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsClientDiagnostics; + private readonly PrivateEndpointConnectionRestOperations _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentPrivateEndpointConnectionCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MigrationAssessmentPrivateEndpointConnectionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", MigrationAssessmentPrivateEndpointConnectionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MigrationAssessmentPrivateEndpointConnectionResource.ResourceType, out string migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsApiVersion); + _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient = new PrivateEndpointConnectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MigrationAssessmentAssessmentProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MigrationAssessmentAssessmentProjectResource.ResourceType), nameof(id)); + } + + /// + /// Create a PrivateEndpointConnection + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionOperations_Update + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Private endpoint connection ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string privateEndpointConnectionName, MigrationAssessmentPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsClientDiagnostics.CreateScope("MigrationAssessmentPrivateEndpointConnectionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new MigrationAssessmentPrivateEndpointConnectionOperationSource(Client), _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsClientDiagnostics, Pipeline, _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a PrivateEndpointConnection + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionOperations_Update + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Private endpoint connection ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string privateEndpointConnectionName, MigrationAssessmentPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsClientDiagnostics.CreateScope("MigrationAssessmentPrivateEndpointConnectionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data, cancellationToken); + var operation = new AssessmentArmOperation(new MigrationAssessmentPrivateEndpointConnectionOperationSource(Client), _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsClientDiagnostics, Pipeline, _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a PrivateEndpointConnection + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Private endpoint connection ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsClientDiagnostics.CreateScope("MigrationAssessmentPrivateEndpointConnectionCollection.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a PrivateEndpointConnection + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Private endpoint connection ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsClientDiagnostics.CreateScope("MigrationAssessmentPrivateEndpointConnectionCollection.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List PrivateEndpointConnection resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateEndpointConnections + /// + /// + /// Operation Id + /// PrivateEndpointConnectionOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentPrivateEndpointConnectionResource(Client, MigrationAssessmentPrivateEndpointConnectionData.DeserializeMigrationAssessmentPrivateEndpointConnectionData(e)), _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsClientDiagnostics, Pipeline, "MigrationAssessmentPrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List PrivateEndpointConnection resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateEndpointConnections + /// + /// + /// Operation Id + /// PrivateEndpointConnectionOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentPrivateEndpointConnectionResource(Client, MigrationAssessmentPrivateEndpointConnectionData.DeserializeMigrationAssessmentPrivateEndpointConnectionData(e)), _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsClientDiagnostics, Pipeline, "MigrationAssessmentPrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Private endpoint connection ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsClientDiagnostics.CreateScope("MigrationAssessmentPrivateEndpointConnectionCollection.Exists"); + scope.Start(); + try + { + var response = await _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Private endpoint connection ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsClientDiagnostics.CreateScope("MigrationAssessmentPrivateEndpointConnectionCollection.Exists"); + scope.Start(); + try + { + var response = _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Private endpoint connection ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsClientDiagnostics.CreateScope("MigrationAssessmentPrivateEndpointConnectionCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Private endpoint connection ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsClientDiagnostics.CreateScope("MigrationAssessmentPrivateEndpointConnectionCollection.GetIfExists"); + scope.Start(); + try + { + var response = _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateEndpointConnectionData.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateEndpointConnectionData.Serialization.cs new file mode 100644 index 000000000000..b647dd78c7e9 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateEndpointConnectionData.Serialization.cs @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentPrivateEndpointConnectionData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentPrivateEndpointConnectionData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsCollectionDefined(GroupIds)) + { + writer.WritePropertyName("groupIds"u8); + writer.WriteStartArray(); + foreach (var item in GroupIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(PrivateEndpoint)) + { + writer.WritePropertyName("privateEndpoint"u8); + JsonSerializer.Serialize(writer, PrivateEndpoint); + } + if (Optional.IsDefined(ConnectionState)) + { + writer.WritePropertyName("privateLinkServiceConnectionState"u8); + writer.WriteObjectValue(ConnectionState, options); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WriteEndObject(); + } + + MigrationAssessmentPrivateEndpointConnectionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentPrivateEndpointConnectionData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentPrivateEndpointConnectionData(document.RootElement, options); + } + + internal static MigrationAssessmentPrivateEndpointConnectionData DeserializeMigrationAssessmentPrivateEndpointConnectionData(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; + IReadOnlyList groupIds = default; + SubResource privateEndpoint = default; + MigrationAssessmentPrivateLinkServiceConnectionState privateLinkServiceConnectionState = default; + MigrationAssessmentPrivateEndpointConnectionProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(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("groupIds"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + groupIds = array; + continue; + } + if (property0.NameEquals("privateEndpoint"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateEndpoint = JsonSerializer.Deserialize(property0.Value.GetRawText()); + continue; + } + if (property0.NameEquals("privateLinkServiceConnectionState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateLinkServiceConnectionState = MigrationAssessmentPrivateLinkServiceConnectionState.DeserializeMigrationAssessmentPrivateLinkServiceConnectionState(property0.Value, options); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new MigrationAssessmentPrivateEndpointConnectionProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentPrivateEndpointConnectionData( + id, + name, + type, + systemData, + groupIds ?? new ChangeTrackingList(), + privateEndpoint, + privateLinkServiceConnectionState, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentPrivateEndpointConnectionData)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentPrivateEndpointConnectionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentPrivateEndpointConnectionData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentPrivateEndpointConnectionData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateEndpointConnectionData.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateEndpointConnectionData.cs new file mode 100644 index 000000000000..b6d5c243d581 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateEndpointConnectionData.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing the MigrationAssessmentPrivateEndpointConnection data model. + /// Private endpoint connection resource. + /// + public partial class MigrationAssessmentPrivateEndpointConnectionData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MigrationAssessmentPrivateEndpointConnectionData() + { + GroupIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The group ids for the private endpoint resource. + /// The private endpoint resource. + /// A collection of information about the state of the connection between service consumer and provider. + /// The provisioning state of the private endpoint connection resource. + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentPrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IReadOnlyList groupIds, SubResource privateEndpoint, MigrationAssessmentPrivateLinkServiceConnectionState connectionState, MigrationAssessmentPrivateEndpointConnectionProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + GroupIds = groupIds; + PrivateEndpoint = privateEndpoint; + ConnectionState = connectionState; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The group ids for the private endpoint resource. + public IReadOnlyList GroupIds { get; } + /// The private endpoint resource. + internal SubResource PrivateEndpoint { get; set; } + /// Gets Id. + public ResourceIdentifier PrivateEndpointId + { + get => PrivateEndpoint is null ? default : PrivateEndpoint.Id; + } + + /// A collection of information about the state of the connection between service consumer and provider. + public MigrationAssessmentPrivateLinkServiceConnectionState ConnectionState { get; set; } + /// The provisioning state of the private endpoint connection resource. + public MigrationAssessmentPrivateEndpointConnectionProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateEndpointConnectionResource.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateEndpointConnectionResource.Serialization.cs new file mode 100644 index 000000000000..ef92f453dbef --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateEndpointConnectionResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentPrivateEndpointConnectionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MigrationAssessmentPrivateEndpointConnectionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MigrationAssessmentPrivateEndpointConnectionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateEndpointConnectionResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateEndpointConnectionResource.cs new file mode 100644 index 000000000000..e915c82620df --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateEndpointConnectionResource.cs @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A Class representing a MigrationAssessmentPrivateEndpointConnection along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMigrationAssessmentPrivateEndpointConnectionResource method. + /// Otherwise you can get one from its parent resource using the GetMigrationAssessmentPrivateEndpointConnection method. + /// + public partial class MigrationAssessmentPrivateEndpointConnectionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The privateEndpointConnectionName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string privateEndpointConnectionName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsClientDiagnostics; + private readonly PrivateEndpointConnectionRestOperations _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient; + private readonly MigrationAssessmentPrivateEndpointConnectionData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/privateEndpointConnections"; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentPrivateEndpointConnectionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MigrationAssessmentPrivateEndpointConnectionResource(ArmClient client, MigrationAssessmentPrivateEndpointConnectionData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MigrationAssessmentPrivateEndpointConnectionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsApiVersion); + _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient = new PrivateEndpointConnectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MigrationAssessmentPrivateEndpointConnectionData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a PrivateEndpointConnection + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsClientDiagnostics.CreateScope("MigrationAssessmentPrivateEndpointConnectionResource.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a PrivateEndpointConnection + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsClientDiagnostics.CreateScope("MigrationAssessmentPrivateEndpointConnectionResource.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a PrivateEndpointConnection + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionOperations_Delete + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsClientDiagnostics.CreateScope("MigrationAssessmentPrivateEndpointConnectionResource.Delete"); + scope.Start(); + try + { + var response = await _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AssessmentArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a PrivateEndpointConnection + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionOperations_Delete + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsClientDiagnostics.CreateScope("MigrationAssessmentPrivateEndpointConnectionResource.Delete"); + scope.Start(); + try + { + var response = _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AssessmentArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a PrivateEndpointConnection + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionOperations_Update + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, MigrationAssessmentPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsClientDiagnostics.CreateScope("MigrationAssessmentPrivateEndpointConnectionResource.Update"); + scope.Start(); + try + { + var response = await _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new MigrationAssessmentPrivateEndpointConnectionOperationSource(Client), _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsClientDiagnostics, Pipeline, _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a PrivateEndpointConnection + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionOperations_Update + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, MigrationAssessmentPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsClientDiagnostics.CreateScope("MigrationAssessmentPrivateEndpointConnectionResource.Update"); + scope.Start(); + try + { + var response = _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new AssessmentArmOperation(new MigrationAssessmentPrivateEndpointConnectionOperationSource(Client), _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsClientDiagnostics, Pipeline, _migrationAssessmentPrivateEndpointConnectionPrivateEndpointConnectionOperationsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateLinkResource.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateLinkResource.Serialization.cs new file mode 100644 index 000000000000..2eada50c6954 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateLinkResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentPrivateLinkResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MigrationAssessmentPrivateLinkResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MigrationAssessmentPrivateLinkResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateLinkResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateLinkResource.cs new file mode 100644 index 000000000000..c739d103f3d4 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateLinkResource.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A Class representing a MigrationAssessmentPrivateLinkResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMigrationAssessmentPrivateLinkResource method. + /// Otherwise you can get one from its parent resource using the GetMigrationAssessmentPrivateLinkResource method. + /// + public partial class MigrationAssessmentPrivateLinkResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The privateLinkResourceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string privateLinkResourceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateLinkResources/{privateLinkResourceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsClientDiagnostics; + private readonly PrivateLinkResourceRestOperations _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsRestClient; + private readonly MigrationAssessmentPrivateLinkResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/privateLinkResources"; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentPrivateLinkResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MigrationAssessmentPrivateLinkResource(ArmClient client, MigrationAssessmentPrivateLinkResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MigrationAssessmentPrivateLinkResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsApiVersion); + _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsRestClient = new PrivateLinkResourceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MigrationAssessmentPrivateLinkResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a PrivateLinkResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResourceOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsClientDiagnostics.CreateScope("MigrationAssessmentPrivateLinkResource.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a PrivateLinkResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResourceOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsClientDiagnostics.CreateScope("MigrationAssessmentPrivateLinkResource.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateLinkResourceCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateLinkResourceCollection.cs new file mode 100644 index 000000000000..17bb19a1e408 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateLinkResourceCollection.cs @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMigrationAssessmentPrivateLinkResources method from an instance of . + /// + public partial class MigrationAssessmentPrivateLinkResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsClientDiagnostics; + private readonly PrivateLinkResourceRestOperations _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentPrivateLinkResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MigrationAssessmentPrivateLinkResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", MigrationAssessmentPrivateLinkResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MigrationAssessmentPrivateLinkResource.ResourceType, out string migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsApiVersion); + _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsRestClient = new PrivateLinkResourceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MigrationAssessmentAssessmentProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MigrationAssessmentAssessmentProjectResource.ResourceType), nameof(id)); + } + + /// + /// Get a PrivateLinkResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResourceOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Private link resource ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var scope = _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsClientDiagnostics.CreateScope("MigrationAssessmentPrivateLinkResourceCollection.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a PrivateLinkResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResourceOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Private link resource ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var scope = _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsClientDiagnostics.CreateScope("MigrationAssessmentPrivateLinkResourceCollection.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List PrivateLinkResource resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateLinkResources + /// + /// + /// Operation Id + /// PrivateLinkResourceOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentPrivateLinkResource(Client, MigrationAssessmentPrivateLinkResourceData.DeserializeMigrationAssessmentPrivateLinkResourceData(e)), _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsClientDiagnostics, Pipeline, "MigrationAssessmentPrivateLinkResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List PrivateLinkResource resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateLinkResources + /// + /// + /// Operation Id + /// PrivateLinkResourceOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentPrivateLinkResource(Client, MigrationAssessmentPrivateLinkResourceData.DeserializeMigrationAssessmentPrivateLinkResourceData(e)), _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsClientDiagnostics, Pipeline, "MigrationAssessmentPrivateLinkResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResourceOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Private link resource ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var scope = _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsClientDiagnostics.CreateScope("MigrationAssessmentPrivateLinkResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResourceOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Private link resource ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var scope = _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsClientDiagnostics.CreateScope("MigrationAssessmentPrivateLinkResourceCollection.Exists"); + scope.Start(); + try + { + var response = _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResourceOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Private link resource ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var scope = _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsClientDiagnostics.CreateScope("MigrationAssessmentPrivateLinkResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResourceOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Private link resource ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var scope = _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsClientDiagnostics.CreateScope("MigrationAssessmentPrivateLinkResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _migrationAssessmentPrivateLinkResourcePrivateLinkResourceOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateLinkResourceData.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateLinkResourceData.Serialization.cs new file mode 100644 index 000000000000..59963bf7d440 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateLinkResourceData.Serialization.cs @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentPrivateLinkResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentPrivateLinkResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(GroupId)) + { + writer.WritePropertyName("groupId"u8); + writer.WriteStringValue(GroupId); + } + if (options.Format != "W" && Optional.IsCollectionDefined(RequiredMembers)) + { + writer.WritePropertyName("requiredMembers"u8); + writer.WriteStartArray(); + foreach (var item in RequiredMembers) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(RequiredZoneNames)) + { + writer.WritePropertyName("requiredZoneNames"u8); + writer.WriteStartArray(); + foreach (var item in RequiredZoneNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + MigrationAssessmentPrivateLinkResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentPrivateLinkResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentPrivateLinkResourceData(document.RootElement, options); + } + + internal static MigrationAssessmentPrivateLinkResourceData DeserializeMigrationAssessmentPrivateLinkResourceData(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; + string groupId = default; + IReadOnlyList requiredMembers = default; + IList requiredZoneNames = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(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("groupId"u8)) + { + groupId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("requiredMembers"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + requiredMembers = array; + continue; + } + if (property0.NameEquals("requiredZoneNames"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + requiredZoneNames = array; + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentPrivateLinkResourceData( + id, + name, + type, + systemData, + groupId, + requiredMembers ?? new ChangeTrackingList(), + requiredZoneNames ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentPrivateLinkResourceData)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentPrivateLinkResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentPrivateLinkResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentPrivateLinkResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateLinkResourceData.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateLinkResourceData.cs new file mode 100644 index 000000000000..b87b1e817ed7 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentPrivateLinkResourceData.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing the MigrationAssessmentPrivateLinkResource data model. + /// Private link resource. + /// + public partial class MigrationAssessmentPrivateLinkResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MigrationAssessmentPrivateLinkResourceData() + { + RequiredMembers = new ChangeTrackingList(); + RequiredZoneNames = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The private link resource group id. + /// The private link resource required member names. + /// The private link resource private link DNS zone name. + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentPrivateLinkResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string groupId, IReadOnlyList requiredMembers, IList requiredZoneNames, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + GroupId = groupId; + RequiredMembers = requiredMembers; + RequiredZoneNames = requiredZoneNames; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The private link resource group id. + public string GroupId { get; } + /// The private link resource required member names. + public IReadOnlyList RequiredMembers { get; } + /// The private link resource private link DNS zone name. + public IList RequiredZoneNames { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentServerCollectorCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentServerCollectorCollection.cs new file mode 100644 index 000000000000..d3647752dcac --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentServerCollectorCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMigrationAssessmentServerCollectors method from an instance of . + /// + public partial class MigrationAssessmentServerCollectorCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _migrationAssessmentServerCollectorServerCollectorsOperationsClientDiagnostics; + private readonly ServerCollectorsRestOperations _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentServerCollectorCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MigrationAssessmentServerCollectorCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentServerCollectorServerCollectorsOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", MigrationAssessmentServerCollectorResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MigrationAssessmentServerCollectorResource.ResourceType, out string migrationAssessmentServerCollectorServerCollectorsOperationsApiVersion); + _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient = new ServerCollectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentServerCollectorServerCollectorsOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MigrationAssessmentAssessmentProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MigrationAssessmentAssessmentProjectResource.ResourceType), nameof(id)); + } + + /// + /// Create a ServerCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// + /// + /// Operation Id + /// ServerCollectorsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Physical server collector ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string serverCollectorName, MigrationAssessmentServerCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(serverCollectorName, nameof(serverCollectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentServerCollectorServerCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentServerCollectorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverCollectorName, data, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new MigrationAssessmentServerCollectorOperationSource(Client), _migrationAssessmentServerCollectorServerCollectorsOperationsClientDiagnostics, Pipeline, _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverCollectorName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a ServerCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// + /// + /// Operation Id + /// ServerCollectorsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Physical server collector ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string serverCollectorName, MigrationAssessmentServerCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(serverCollectorName, nameof(serverCollectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentServerCollectorServerCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentServerCollectorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverCollectorName, data, cancellationToken); + var operation = new AssessmentArmOperation(new MigrationAssessmentServerCollectorOperationSource(Client), _migrationAssessmentServerCollectorServerCollectorsOperationsClientDiagnostics, Pipeline, _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverCollectorName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ServerCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// + /// + /// Operation Id + /// ServerCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Physical server collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string serverCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(serverCollectorName, nameof(serverCollectorName)); + + using var scope = _migrationAssessmentServerCollectorServerCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentServerCollectorCollection.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverCollectorName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentServerCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ServerCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// + /// + /// Operation Id + /// ServerCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Physical server collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string serverCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(serverCollectorName, nameof(serverCollectorName)); + + using var scope = _migrationAssessmentServerCollectorServerCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentServerCollectorCollection.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverCollectorName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentServerCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List ServerCollector resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors + /// + /// + /// Operation Id + /// ServerCollectorsOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentServerCollectorResource(Client, MigrationAssessmentServerCollectorData.DeserializeMigrationAssessmentServerCollectorData(e)), _migrationAssessmentServerCollectorServerCollectorsOperationsClientDiagnostics, Pipeline, "MigrationAssessmentServerCollectorCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List ServerCollector resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors + /// + /// + /// Operation Id + /// ServerCollectorsOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentServerCollectorResource(Client, MigrationAssessmentServerCollectorData.DeserializeMigrationAssessmentServerCollectorData(e)), _migrationAssessmentServerCollectorServerCollectorsOperationsClientDiagnostics, Pipeline, "MigrationAssessmentServerCollectorCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// + /// + /// Operation Id + /// ServerCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Physical server collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string serverCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(serverCollectorName, nameof(serverCollectorName)); + + using var scope = _migrationAssessmentServerCollectorServerCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentServerCollectorCollection.Exists"); + scope.Start(); + try + { + var response = await _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverCollectorName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// + /// + /// Operation Id + /// ServerCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Physical server collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string serverCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(serverCollectorName, nameof(serverCollectorName)); + + using var scope = _migrationAssessmentServerCollectorServerCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentServerCollectorCollection.Exists"); + scope.Start(); + try + { + var response = _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverCollectorName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// + /// + /// Operation Id + /// ServerCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Physical server collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string serverCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(serverCollectorName, nameof(serverCollectorName)); + + using var scope = _migrationAssessmentServerCollectorServerCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentServerCollectorCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverCollectorName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentServerCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// + /// + /// Operation Id + /// ServerCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Physical server collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string serverCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(serverCollectorName, nameof(serverCollectorName)); + + using var scope = _migrationAssessmentServerCollectorServerCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentServerCollectorCollection.GetIfExists"); + scope.Start(); + try + { + var response = _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverCollectorName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentServerCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentServerCollectorData.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentServerCollectorData.Serialization.cs new file mode 100644 index 000000000000..e2dd11e25a1d --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentServerCollectorData.Serialization.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentServerCollectorData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentServerCollectorData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(AgentProperties)) + { + writer.WritePropertyName("agentProperties"u8); + writer.WriteObjectValue(AgentProperties, options); + } + if (Optional.IsDefined(DiscoverySiteId)) + { + writer.WritePropertyName("discoverySiteId"u8); + writer.WriteStringValue(DiscoverySiteId); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("createdTimestamp"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(UpdatedOn)) + { + writer.WritePropertyName("updatedTimestamp"u8); + writer.WriteStringValue(UpdatedOn.Value, "O"); + } + writer.WriteEndObject(); + } + + MigrationAssessmentServerCollectorData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentServerCollectorData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentServerCollectorData(document.RootElement, options); + } + + internal static MigrationAssessmentServerCollectorData DeserializeMigrationAssessmentServerCollectorData(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; + MigrationAssessmentProvisioningState? provisioningState = default; + CollectorAgentPropertiesBase agentProperties = default; + string discoverySiteId = default; + DateTimeOffset? createdTimestamp = default; + DateTimeOffset? updatedTimestamp = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(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("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new MigrationAssessmentProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("agentProperties"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + agentProperties = CollectorAgentPropertiesBase.DeserializeCollectorAgentPropertiesBase(property0.Value, options); + continue; + } + if (property0.NameEquals("discoverySiteId"u8)) + { + discoverySiteId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("createdTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("updatedTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentServerCollectorData( + id, + name, + type, + systemData, + provisioningState, + agentProperties, + discoverySiteId, + createdTimestamp, + updatedTimestamp, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentServerCollectorData)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentServerCollectorData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentServerCollectorData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentServerCollectorData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentServerCollectorData.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentServerCollectorData.cs new file mode 100644 index 000000000000..f1d0ce6da497 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentServerCollectorData.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing the MigrationAssessmentServerCollector data model. + /// Physical server collector resource. + /// + public partial class MigrationAssessmentServerCollectorData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MigrationAssessmentServerCollectorData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The status of the last operation. + /// Gets or sets the collector agent properties. + /// Gets the discovery site id. + /// Gets the Timestamp when collector was created. + /// Timestamp when collector was last updated. + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentServerCollectorData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MigrationAssessmentProvisioningState? provisioningState, CollectorAgentPropertiesBase agentProperties, string discoverySiteId, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + AgentProperties = agentProperties; + DiscoverySiteId = discoverySiteId; + CreatedOn = createdOn; + UpdatedOn = updatedOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The status of the last operation. + public MigrationAssessmentProvisioningState? ProvisioningState { get; set; } + /// Gets or sets the collector agent properties. + public CollectorAgentPropertiesBase AgentProperties { get; set; } + /// Gets the discovery site id. + public string DiscoverySiteId { get; set; } + /// Gets the Timestamp when collector was created. + public DateTimeOffset? CreatedOn { get; } + /// Timestamp when collector was last updated. + public DateTimeOffset? UpdatedOn { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentServerCollectorResource.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentServerCollectorResource.Serialization.cs new file mode 100644 index 000000000000..a0dbf3856ba3 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentServerCollectorResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentServerCollectorResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MigrationAssessmentServerCollectorData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MigrationAssessmentServerCollectorData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentServerCollectorResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentServerCollectorResource.cs new file mode 100644 index 000000000000..efd32b42c34d --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentServerCollectorResource.cs @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A Class representing a MigrationAssessmentServerCollector along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMigrationAssessmentServerCollectorResource method. + /// Otherwise you can get one from its parent resource using the GetMigrationAssessmentServerCollector method. + /// + public partial class MigrationAssessmentServerCollectorResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The serverCollectorName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string serverCollectorName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _migrationAssessmentServerCollectorServerCollectorsOperationsClientDiagnostics; + private readonly ServerCollectorsRestOperations _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient; + private readonly MigrationAssessmentServerCollectorData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/servercollectors"; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentServerCollectorResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MigrationAssessmentServerCollectorResource(ArmClient client, MigrationAssessmentServerCollectorData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MigrationAssessmentServerCollectorResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentServerCollectorServerCollectorsOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string migrationAssessmentServerCollectorServerCollectorsOperationsApiVersion); + _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient = new ServerCollectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentServerCollectorServerCollectorsOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MigrationAssessmentServerCollectorData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a ServerCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// + /// + /// Operation Id + /// ServerCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentServerCollectorServerCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentServerCollectorResource.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentServerCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ServerCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// + /// + /// Operation Id + /// ServerCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentServerCollectorServerCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentServerCollectorResource.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentServerCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a ServerCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// + /// + /// Operation Id + /// ServerCollectorsOperations_Delete + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentServerCollectorServerCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentServerCollectorResource.Delete"); + scope.Start(); + try + { + var response = await _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AssessmentArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a ServerCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// + /// + /// Operation Id + /// ServerCollectorsOperations_Delete + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentServerCollectorServerCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentServerCollectorResource.Delete"); + scope.Start(); + try + { + var response = _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AssessmentArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a ServerCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// + /// + /// Operation Id + /// ServerCollectorsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, MigrationAssessmentServerCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentServerCollectorServerCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentServerCollectorResource.Update"); + scope.Start(); + try + { + var response = await _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new MigrationAssessmentServerCollectorOperationSource(Client), _migrationAssessmentServerCollectorServerCollectorsOperationsClientDiagnostics, Pipeline, _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a ServerCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// + /// + /// Operation Id + /// ServerCollectorsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, MigrationAssessmentServerCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentServerCollectorServerCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentServerCollectorResource.Update"); + scope.Start(); + try + { + var response = _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new AssessmentArmOperation(new MigrationAssessmentServerCollectorOperationSource(Client), _migrationAssessmentServerCollectorServerCollectorsOperationsClientDiagnostics, Pipeline, _migrationAssessmentServerCollectorServerCollectorsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentOptionCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentOptionCollection.cs new file mode 100644 index 000000000000..f9897fcb395a --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentOptionCollection.cs @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMigrationAssessmentSqlAssessmentOptions method from an instance of . + /// + public partial class MigrationAssessmentSqlAssessmentOptionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsClientDiagnostics; + private readonly SqlAssessmentOptionsRestOperations _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentSqlAssessmentOptionCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MigrationAssessmentSqlAssessmentOptionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", MigrationAssessmentSqlAssessmentOptionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MigrationAssessmentSqlAssessmentOptionResource.ResourceType, out string migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsApiVersion); + _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsRestClient = new SqlAssessmentOptionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MigrationAssessmentAssessmentProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MigrationAssessmentAssessmentProjectResource.ResourceType), nameof(id)); + } + + /// + /// Get a SqlAssessmentOptions + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessmentOptions/{assessmentOptionsName} + /// + /// + /// Operation Id + /// SqlAssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment options ARM name. Accepted values is 'default'. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string assessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentOptionsName, nameof(assessmentOptionsName)); + + using var scope = _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentOptionCollection.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assessmentOptionsName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentSqlAssessmentOptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SqlAssessmentOptions + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessmentOptions/{assessmentOptionsName} + /// + /// + /// Operation Id + /// SqlAssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment options ARM name. Accepted values is 'default'. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string assessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentOptionsName, nameof(assessmentOptionsName)); + + using var scope = _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentOptionCollection.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assessmentOptionsName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentSqlAssessmentOptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List SqlAssessmentOptions resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessmentOptions + /// + /// + /// Operation Id + /// SqlAssessmentOptionsOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentSqlAssessmentOptionResource(Client, MigrationAssessmentSqlAssessmentOptionData.DeserializeMigrationAssessmentSqlAssessmentOptionData(e)), _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsClientDiagnostics, Pipeline, "MigrationAssessmentSqlAssessmentOptionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List SqlAssessmentOptions resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessmentOptions + /// + /// + /// Operation Id + /// SqlAssessmentOptionsOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentSqlAssessmentOptionResource(Client, MigrationAssessmentSqlAssessmentOptionData.DeserializeMigrationAssessmentSqlAssessmentOptionData(e)), _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsClientDiagnostics, Pipeline, "MigrationAssessmentSqlAssessmentOptionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessmentOptions/{assessmentOptionsName} + /// + /// + /// Operation Id + /// SqlAssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment options ARM name. Accepted values is 'default'. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string assessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentOptionsName, nameof(assessmentOptionsName)); + + using var scope = _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentOptionCollection.Exists"); + scope.Start(); + try + { + var response = await _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assessmentOptionsName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessmentOptions/{assessmentOptionsName} + /// + /// + /// Operation Id + /// SqlAssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment options ARM name. Accepted values is 'default'. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string assessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentOptionsName, nameof(assessmentOptionsName)); + + using var scope = _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentOptionCollection.Exists"); + scope.Start(); + try + { + var response = _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assessmentOptionsName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessmentOptions/{assessmentOptionsName} + /// + /// + /// Operation Id + /// SqlAssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment options ARM name. Accepted values is 'default'. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string assessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentOptionsName, nameof(assessmentOptionsName)); + + using var scope = _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentOptionCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assessmentOptionsName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentSqlAssessmentOptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessmentOptions/{assessmentOptionsName} + /// + /// + /// Operation Id + /// SqlAssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment options ARM name. Accepted values is 'default'. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string assessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentOptionsName, nameof(assessmentOptionsName)); + + using var scope = _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentOptionCollection.GetIfExists"); + scope.Start(); + try + { + var response = _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assessmentOptionsName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentSqlAssessmentOptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentOptionData.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentOptionData.Serialization.cs new file mode 100644 index 000000000000..4107a4839f39 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentOptionData.Serialization.cs @@ -0,0 +1,518 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentSqlAssessmentOptionData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentSqlAssessmentOptionData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsCollectionDefined(VmFamilies)) + { + writer.WritePropertyName("vmFamilies"u8); + writer.WriteStartArray(); + foreach (var item in VmFamilies) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ReservedInstanceVmFamilies)) + { + writer.WritePropertyName("reservedInstanceVmFamilies"u8); + writer.WriteStartArray(); + foreach (var item in ReservedInstanceVmFamilies) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(PremiumDiskVmFamilies)) + { + writer.WritePropertyName("premiumDiskVmFamilies"u8); + writer.WriteStartArray(); + foreach (var item in PremiumDiskVmFamilies) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(SavingsPlanVmFamilies)) + { + writer.WritePropertyName("savingsPlanVmFamilies"u8); + writer.WriteStartArray(); + foreach (var item in SavingsPlanVmFamilies) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(SavingsPlanSupportedLocations)) + { + writer.WritePropertyName("savingsPlanSupportedLocations"u8); + writer.WriteStartArray(); + foreach (var item in SavingsPlanSupportedLocations) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(SavingsPlanSupportedLocationsForPaas)) + { + writer.WritePropertyName("savingsPlanSupportedLocationsForPaas"u8); + writer.WriteStartArray(); + foreach (var item in SavingsPlanSupportedLocationsForPaas) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ReservedInstanceSupportedLocationsForIaas)) + { + writer.WritePropertyName("reservedInstanceSupportedLocationsForIaas"u8); + writer.WriteStartArray(); + foreach (var item in ReservedInstanceSupportedLocationsForIaas) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(SavingsPlanSupportedOffers)) + { + writer.WritePropertyName("savingsPlanSupportedOffers"u8); + writer.WriteStartArray(); + foreach (var item in SavingsPlanSupportedOffers) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(SqlSkus)) + { + writer.WritePropertyName("sqlSkus"u8); + writer.WriteStartArray(); + foreach (var item in SqlSkus) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ReservedInstanceSqlTargets)) + { + writer.WritePropertyName("reservedInstanceSqlTargets"u8); + writer.WriteStartArray(); + foreach (var item in ReservedInstanceSqlTargets) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ReservedInstanceSupportedLocations)) + { + writer.WritePropertyName("reservedInstanceSupportedLocations"u8); + writer.WriteStartArray(); + foreach (var item in ReservedInstanceSupportedLocations) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ReservedInstanceSupportedCurrencies)) + { + writer.WritePropertyName("reservedInstanceSupportedCurrencies"u8); + writer.WriteStartArray(); + foreach (var item in ReservedInstanceSupportedCurrencies) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ReservedInstanceSupportedOffers)) + { + writer.WritePropertyName("reservedInstanceSupportedOffers"u8); + writer.WriteStartArray(); + foreach (var item in ReservedInstanceSupportedOffers) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(SupportedOffers)) + { + writer.WritePropertyName("supportedOffers"u8); + writer.WriteStartArray(); + foreach (var item in SupportedOffers) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + MigrationAssessmentSqlAssessmentOptionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentSqlAssessmentOptionData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentSqlAssessmentOptionData(document.RootElement, options); + } + + internal static MigrationAssessmentSqlAssessmentOptionData DeserializeMigrationAssessmentSqlAssessmentOptionData(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; + IReadOnlyList vmFamilies = default; + IReadOnlyList reservedInstanceVmFamilies = default; + IReadOnlyList premiumDiskVmFamilies = default; + IList savingsPlanVmFamilies = default; + IList savingsPlanSupportedLocations = default; + IList savingsPlanSupportedLocationsForPaas = default; + IList reservedInstanceSupportedLocationsForIaas = default; + IList savingsPlanSupportedOffers = default; + IList sqlSkus = default; + IList reservedInstanceSqlTargets = default; + IList reservedInstanceSupportedLocations = default; + IList reservedInstanceSupportedCurrencies = default; + IList reservedInstanceSupportedOffers = default; + IList supportedOffers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(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("vmFamilies"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(VmFamilyConfig.DeserializeVmFamilyConfig(item, options)); + } + vmFamilies = array; + continue; + } + if (property0.NameEquals("reservedInstanceVmFamilies"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new AzureVmFamily(item.GetString())); + } + reservedInstanceVmFamilies = array; + continue; + } + if (property0.NameEquals("premiumDiskVmFamilies"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new AzureVmFamily(item.GetString())); + } + premiumDiskVmFamilies = array; + continue; + } + if (property0.NameEquals("savingsPlanVmFamilies"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new AzureVmFamily(item.GetString())); + } + savingsPlanVmFamilies = array; + continue; + } + if (property0.NameEquals("savingsPlanSupportedLocations"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new AzureLocation(item.GetString())); + } + savingsPlanSupportedLocations = array; + continue; + } + if (property0.NameEquals("savingsPlanSupportedLocationsForPaas"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new AzureLocation(item.GetString())); + } + savingsPlanSupportedLocationsForPaas = array; + continue; + } + if (property0.NameEquals("reservedInstanceSupportedLocationsForIaas"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new AzureLocation(item.GetString())); + } + reservedInstanceSupportedLocationsForIaas = array; + continue; + } + if (property0.NameEquals("savingsPlanSupportedOffers"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new AzureOfferCode(item.GetString())); + } + savingsPlanSupportedOffers = array; + continue; + } + if (property0.NameEquals("sqlSkus"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(SqlPaaSTargetConfig.DeserializeSqlPaaSTargetConfig(item, options)); + } + sqlSkus = array; + continue; + } + if (property0.NameEquals("reservedInstanceSqlTargets"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new MigrationAssessmentTargetType(item.GetString())); + } + reservedInstanceSqlTargets = array; + continue; + } + if (property0.NameEquals("reservedInstanceSupportedLocations"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new AzureLocation(item.GetString())); + } + reservedInstanceSupportedLocations = array; + continue; + } + if (property0.NameEquals("reservedInstanceSupportedCurrencies"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new AzureCurrency(item.GetString())); + } + reservedInstanceSupportedCurrencies = array; + continue; + } + if (property0.NameEquals("reservedInstanceSupportedOffers"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new AzureOfferCode(item.GetString())); + } + reservedInstanceSupportedOffers = array; + continue; + } + if (property0.NameEquals("supportedOffers"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new AzureOfferCode(item.GetString())); + } + supportedOffers = array; + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentSqlAssessmentOptionData( + id, + name, + type, + systemData, + vmFamilies ?? new ChangeTrackingList(), + reservedInstanceVmFamilies ?? new ChangeTrackingList(), + premiumDiskVmFamilies ?? new ChangeTrackingList(), + savingsPlanVmFamilies ?? new ChangeTrackingList(), + savingsPlanSupportedLocations ?? new ChangeTrackingList(), + savingsPlanSupportedLocationsForPaas ?? new ChangeTrackingList(), + reservedInstanceSupportedLocationsForIaas ?? new ChangeTrackingList(), + savingsPlanSupportedOffers ?? new ChangeTrackingList(), + sqlSkus ?? new ChangeTrackingList(), + reservedInstanceSqlTargets ?? new ChangeTrackingList(), + reservedInstanceSupportedLocations ?? new ChangeTrackingList(), + reservedInstanceSupportedCurrencies ?? new ChangeTrackingList(), + reservedInstanceSupportedOffers ?? new ChangeTrackingList(), + supportedOffers ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentSqlAssessmentOptionData)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentSqlAssessmentOptionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentSqlAssessmentOptionData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentSqlAssessmentOptionData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentOptionData.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentOptionData.cs new file mode 100644 index 000000000000..ae88ddffd647 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentOptionData.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing the MigrationAssessmentSqlAssessmentOption data model. + /// SQL Assessment options web model object. + /// + public partial class MigrationAssessmentSqlAssessmentOptionData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MigrationAssessmentSqlAssessmentOptionData() + { + VmFamilies = new ChangeTrackingList(); + ReservedInstanceVmFamilies = new ChangeTrackingList(); + PremiumDiskVmFamilies = new ChangeTrackingList(); + SavingsPlanVmFamilies = new ChangeTrackingList(); + SavingsPlanSupportedLocations = new ChangeTrackingList(); + SavingsPlanSupportedLocationsForPaas = new ChangeTrackingList(); + ReservedInstanceSupportedLocationsForIaas = new ChangeTrackingList(); + SavingsPlanSupportedOffers = new ChangeTrackingList(); + SqlSkus = new ChangeTrackingList(); + ReservedInstanceSqlTargets = new ChangeTrackingList(); + ReservedInstanceSupportedLocations = new ChangeTrackingList(); + ReservedInstanceSupportedCurrencies = new ChangeTrackingList(); + ReservedInstanceSupportedOffers = new ChangeTrackingList(); + SupportedOffers = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets the list of VM families. + /// Gets the Reserved Instance VM Families list. + /// Gets the Premium disk VM Families list. + /// Gets or sets the Premium disk VM Families list. + /// Gets or sets the list of Azure locations supporting Saving Plans for IAAS. + /// Gets or sets the list of Azure locations supporting Saving Plans for PAAS. + /// Gets or sets the list of Azure locations supporting Reserved Instances for IAAS. + /// Gets or sets the list of Azure Offers supporting Saving Plans. + /// Gets or sets the list of SQL target SKU properties for dropdowns. + /// Gets or sets the Reserved Instance SQL target types. + /// Gets or sets the list of Azure locations supporting Reserved Instances. + /// Gets or sets the list of currencies supported for Reserved Instances. + /// Gets or sets the list of offers supported for Reserved Instances. + /// Gets or sets the list of offers supported for SQL assessments. + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentSqlAssessmentOptionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IReadOnlyList vmFamilies, IReadOnlyList reservedInstanceVmFamilies, IReadOnlyList premiumDiskVmFamilies, IList savingsPlanVmFamilies, IList savingsPlanSupportedLocations, IList savingsPlanSupportedLocationsForPaas, IList reservedInstanceSupportedLocationsForIaas, IList savingsPlanSupportedOffers, IList sqlSkus, IList reservedInstanceSqlTargets, IList reservedInstanceSupportedLocations, IList reservedInstanceSupportedCurrencies, IList reservedInstanceSupportedOffers, IList supportedOffers, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + VmFamilies = vmFamilies; + ReservedInstanceVmFamilies = reservedInstanceVmFamilies; + PremiumDiskVmFamilies = premiumDiskVmFamilies; + SavingsPlanVmFamilies = savingsPlanVmFamilies; + SavingsPlanSupportedLocations = savingsPlanSupportedLocations; + SavingsPlanSupportedLocationsForPaas = savingsPlanSupportedLocationsForPaas; + ReservedInstanceSupportedLocationsForIaas = reservedInstanceSupportedLocationsForIaas; + SavingsPlanSupportedOffers = savingsPlanSupportedOffers; + SqlSkus = sqlSkus; + ReservedInstanceSqlTargets = reservedInstanceSqlTargets; + ReservedInstanceSupportedLocations = reservedInstanceSupportedLocations; + ReservedInstanceSupportedCurrencies = reservedInstanceSupportedCurrencies; + ReservedInstanceSupportedOffers = reservedInstanceSupportedOffers; + SupportedOffers = supportedOffers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the list of VM families. + public IReadOnlyList VmFamilies { get; } + /// Gets the Reserved Instance VM Families list. + public IReadOnlyList ReservedInstanceVmFamilies { get; } + /// Gets the Premium disk VM Families list. + public IReadOnlyList PremiumDiskVmFamilies { get; } + /// Gets or sets the Premium disk VM Families list. + public IList SavingsPlanVmFamilies { get; } + /// Gets or sets the list of Azure locations supporting Saving Plans for IAAS. + public IList SavingsPlanSupportedLocations { get; } + /// Gets or sets the list of Azure locations supporting Saving Plans for PAAS. + public IList SavingsPlanSupportedLocationsForPaas { get; } + /// Gets or sets the list of Azure locations supporting Reserved Instances for IAAS. + public IList ReservedInstanceSupportedLocationsForIaas { get; } + /// Gets or sets the list of Azure Offers supporting Saving Plans. + public IList SavingsPlanSupportedOffers { get; } + /// Gets or sets the list of SQL target SKU properties for dropdowns. + public IList SqlSkus { get; } + /// Gets or sets the Reserved Instance SQL target types. + public IList ReservedInstanceSqlTargets { get; } + /// Gets or sets the list of Azure locations supporting Reserved Instances. + public IList ReservedInstanceSupportedLocations { get; } + /// Gets or sets the list of currencies supported for Reserved Instances. + public IList ReservedInstanceSupportedCurrencies { get; } + /// Gets or sets the list of offers supported for Reserved Instances. + public IList ReservedInstanceSupportedOffers { get; } + /// Gets or sets the list of offers supported for SQL assessments. + public IList SupportedOffers { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentOptionResource.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentOptionResource.Serialization.cs new file mode 100644 index 000000000000..a5a02f5edbe4 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentOptionResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentSqlAssessmentOptionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MigrationAssessmentSqlAssessmentOptionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MigrationAssessmentSqlAssessmentOptionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentOptionResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentOptionResource.cs new file mode 100644 index 000000000000..fc080597ff22 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentOptionResource.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A Class representing a MigrationAssessmentSqlAssessmentOption along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMigrationAssessmentSqlAssessmentOptionResource method. + /// Otherwise you can get one from its parent resource using the GetMigrationAssessmentSqlAssessmentOption method. + /// + public partial class MigrationAssessmentSqlAssessmentOptionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The assessmentOptionsName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string assessmentOptionsName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessmentOptions/{assessmentOptionsName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsClientDiagnostics; + private readonly SqlAssessmentOptionsRestOperations _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsRestClient; + private readonly MigrationAssessmentSqlAssessmentOptionData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/sqlAssessmentOptions"; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentSqlAssessmentOptionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MigrationAssessmentSqlAssessmentOptionResource(ArmClient client, MigrationAssessmentSqlAssessmentOptionData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MigrationAssessmentSqlAssessmentOptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsApiVersion); + _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsRestClient = new SqlAssessmentOptionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MigrationAssessmentSqlAssessmentOptionData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a SqlAssessmentOptions + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessmentOptions/{assessmentOptionsName} + /// + /// + /// Operation Id + /// SqlAssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentOptionResource.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentSqlAssessmentOptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SqlAssessmentOptions + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlAssessmentOptions/{assessmentOptionsName} + /// + /// + /// Operation Id + /// SqlAssessmentOptionsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentOptionResource.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentSqlAssessmentOptionSqlAssessmentOptionsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentSqlAssessmentOptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2Collection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2Collection.cs new file mode 100644 index 000000000000..36fee8ca75c8 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2Collection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMigrationAssessmentSqlAssessmentV2s method from an instance of . + /// + public partial class MigrationAssessmentSqlAssessmentV2Collection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics; + private readonly SqlAssessmentV2RestOperations _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentSqlAssessmentV2Collection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MigrationAssessmentSqlAssessmentV2Collection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", MigrationAssessmentSqlAssessmentV2Resource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MigrationAssessmentSqlAssessmentV2Resource.ResourceType, out string migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsApiVersion); + _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient = new SqlAssessmentV2RestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MigrationAssessmentGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MigrationAssessmentGroupResource.ResourceType), nameof(id)); + } + + /// + /// Create a SqlAssessmentV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName} + /// + /// + /// Operation Id + /// SqlAssessmentV2Operations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// SQL Assessment arm name. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string assessmentName, MigrationAssessmentSqlAssessmentV2Data data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentV2Collection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, data, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new MigrationAssessmentSqlAssessmentV2OperationSource(Client), _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics, Pipeline, _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a SqlAssessmentV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName} + /// + /// + /// Operation Id + /// SqlAssessmentV2Operations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// SQL Assessment arm name. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string assessmentName, MigrationAssessmentSqlAssessmentV2Data data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentV2Collection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, data, cancellationToken); + var operation = new AssessmentArmOperation(new MigrationAssessmentSqlAssessmentV2OperationSource(Client), _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics, Pipeline, _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SqlAssessmentV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName} + /// + /// + /// Operation Id + /// SqlAssessmentV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// SQL Assessment arm name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var scope = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentV2Collection.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentSqlAssessmentV2Resource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SqlAssessmentV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName} + /// + /// + /// Operation Id + /// SqlAssessmentV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// SQL Assessment arm name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var scope = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentV2Collection.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentSqlAssessmentV2Resource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List SqlAssessmentV2 resources by Group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments + /// + /// + /// Operation Id + /// SqlAssessmentV2Operations_ListByGroup + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.CreateListByGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.CreateListByGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentSqlAssessmentV2Resource(Client, MigrationAssessmentSqlAssessmentV2Data.DeserializeMigrationAssessmentSqlAssessmentV2Data(e)), _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics, Pipeline, "MigrationAssessmentSqlAssessmentV2Collection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List SqlAssessmentV2 resources by Group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments + /// + /// + /// Operation Id + /// SqlAssessmentV2Operations_ListByGroup + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.CreateListByGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.CreateListByGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentSqlAssessmentV2Resource(Client, MigrationAssessmentSqlAssessmentV2Data.DeserializeMigrationAssessmentSqlAssessmentV2Data(e)), _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics, Pipeline, "MigrationAssessmentSqlAssessmentV2Collection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName} + /// + /// + /// Operation Id + /// SqlAssessmentV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// SQL Assessment arm name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var scope = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentV2Collection.Exists"); + scope.Start(); + try + { + var response = await _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName} + /// + /// + /// Operation Id + /// SqlAssessmentV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// SQL Assessment arm name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var scope = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentV2Collection.Exists"); + scope.Start(); + try + { + var response = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName} + /// + /// + /// Operation Id + /// SqlAssessmentV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// SQL Assessment arm name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var scope = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentV2Collection.GetIfExists"); + scope.Start(); + try + { + var response = await _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentSqlAssessmentV2Resource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName} + /// + /// + /// Operation Id + /// SqlAssessmentV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// SQL Assessment arm name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var scope = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentV2Collection.GetIfExists"); + scope.Start(); + try + { + var response = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentSqlAssessmentV2Resource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2Data.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2Data.Serialization.cs new file mode 100644 index 000000000000..934e778a869a --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2Data.Serialization.cs @@ -0,0 +1,754 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentSqlAssessmentV2Data : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentSqlAssessmentV2Data)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(OSLicense)) + { + writer.WritePropertyName("osLicense"u8); + writer.WriteStringValue(OSLicense.Value.ToString()); + } + if (Optional.IsDefined(EnvironmentType)) + { + writer.WritePropertyName("environmentType"u8); + writer.WriteStringValue(EnvironmentType.Value.ToString()); + } + if (Optional.IsDefined(EntityUptime)) + { + writer.WritePropertyName("entityUptime"u8); + writer.WriteObjectValue(EntityUptime, options); + } + if (Optional.IsDefined(OptimizationLogic)) + { + writer.WritePropertyName("optimizationLogic"u8); + writer.WriteStringValue(OptimizationLogic.Value.ToString()); + } + if (Optional.IsDefined(ReservedInstanceForVm)) + { + writer.WritePropertyName("reservedInstanceForVm"u8); + writer.WriteStringValue(ReservedInstanceForVm.Value.ToString()); + } + if (Optional.IsDefined(AzureOfferCodeForVm)) + { + writer.WritePropertyName("azureOfferCodeForVm"u8); + writer.WriteStringValue(AzureOfferCodeForVm.Value.ToString()); + } + if (Optional.IsDefined(EASubscriptionId)) + { + writer.WritePropertyName("eaSubscriptionId"u8); + writer.WriteStringValue(EASubscriptionId); + } + if (Optional.IsDefined(AzureSqlManagedInstanceSettings)) + { + writer.WritePropertyName("azureSqlManagedInstanceSettings"u8); + writer.WriteObjectValue(AzureSqlManagedInstanceSettings, options); + } + if (Optional.IsDefined(AzureSqlDatabaseSettings)) + { + writer.WritePropertyName("azureSqlDatabaseSettings"u8); + writer.WriteObjectValue(AzureSqlDatabaseSettings, options); + } + if (Optional.IsDefined(AzureSqlVmSettings)) + { + writer.WritePropertyName("azureSqlVmSettings"u8); + writer.WriteObjectValue(AzureSqlVmSettings, options); + } + if (Optional.IsDefined(MultiSubnetIntent)) + { + writer.WritePropertyName("multiSubnetIntent"u8); + writer.WriteStringValue(MultiSubnetIntent.Value.ToString()); + } + if (Optional.IsDefined(AsyncCommitModeIntent)) + { + writer.WritePropertyName("asyncCommitModeIntent"u8); + writer.WriteStringValue(AsyncCommitModeIntent.Value.ToString()); + } + if (Optional.IsDefined(IsInternetAccessAvailable)) + { + writer.WritePropertyName("isInternetAccessAvailable"u8); + writer.WriteBooleanValue(IsInternetAccessAvailable.Value); + } + if (Optional.IsDefined(DisasterRecoveryLocation)) + { + writer.WritePropertyName("disasterRecoveryLocation"u8); + writer.WriteStringValue(DisasterRecoveryLocation.Value); + } + if (Optional.IsDefined(EnableHadrAssessment)) + { + writer.WritePropertyName("enableHadrAssessment"u8); + writer.WriteBooleanValue(EnableHadrAssessment.Value); + } + if (Optional.IsDefined(AzureSecurityOfferingType)) + { + writer.WritePropertyName("azureSecurityOfferingType"u8); + writer.WriteStringValue(AzureSecurityOfferingType.Value.ToString()); + } + if (Optional.IsDefined(ReservedInstance)) + { + writer.WritePropertyName("reservedInstance"u8); + writer.WriteStringValue(ReservedInstance.Value.ToString()); + } + if (Optional.IsDefined(SqlServerLicense)) + { + writer.WritePropertyName("sqlServerLicense"u8); + writer.WriteStringValue(SqlServerLicense.Value.ToString()); + } + if (Optional.IsDefined(GroupType)) + { + writer.WritePropertyName("groupType"u8); + writer.WriteStringValue(GroupType.Value.ToString()); + } + if (Optional.IsDefined(AssessmentType)) + { + writer.WritePropertyName("assessmentType"u8); + writer.WriteStringValue(AssessmentType.Value.ToString()); + } + if (Optional.IsDefined(AzureLocation)) + { + writer.WritePropertyName("azureLocation"u8); + writer.WriteStringValue(AzureLocation.Value); + } + if (Optional.IsDefined(AzureOfferCode)) + { + writer.WritePropertyName("azureOfferCode"u8); + writer.WriteStringValue(AzureOfferCode.Value.ToString()); + } + if (Optional.IsDefined(Currency)) + { + writer.WritePropertyName("currency"u8); + writer.WriteStringValue(Currency.Value.ToString()); + } + if (Optional.IsDefined(ScalingFactor)) + { + writer.WritePropertyName("scalingFactor"u8); + writer.WriteNumberValue(ScalingFactor.Value); + } + if (Optional.IsDefined(Percentile)) + { + writer.WritePropertyName("percentile"u8); + writer.WriteStringValue(Percentile.Value.ToString()); + } + if (Optional.IsDefined(TimeRange)) + { + writer.WritePropertyName("timeRange"u8); + writer.WriteStringValue(TimeRange.Value.ToString()); + } + if (Optional.IsDefined(PerfDataStartOn)) + { + writer.WritePropertyName("perfDataStartTime"u8); + writer.WriteStringValue(PerfDataStartOn.Value, "O"); + } + if (Optional.IsDefined(PerfDataEndOn)) + { + writer.WritePropertyName("perfDataEndTime"u8); + writer.WriteStringValue(PerfDataEndOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Stage)) + { + writer.WritePropertyName("stage"u8); + writer.WriteStringValue(Stage.Value.ToString()); + } + if (Optional.IsDefined(DiscountPercentage)) + { + writer.WritePropertyName("discountPercentage"u8); + writer.WriteNumberValue(DiscountPercentage.Value); + } + if (Optional.IsDefined(SizingCriterion)) + { + writer.WritePropertyName("sizingCriterion"u8); + writer.WriteStringValue(SizingCriterion.Value.ToString()); + } + if (Optional.IsDefined(ConfidenceRatingInPercentage)) + { + writer.WritePropertyName("confidenceRatingInPercentage"u8); + writer.WriteNumberValue(ConfidenceRatingInPercentage.Value); + } + if (options.Format != "W" && Optional.IsDefined(PricesQueriedOn)) + { + writer.WritePropertyName("pricesTimestamp"u8); + writer.WriteStringValue(PricesQueriedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("createdTimestamp"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(UpdatedOn)) + { + writer.WritePropertyName("updatedTimestamp"u8); + writer.WriteStringValue(UpdatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(SchemaVersion)) + { + writer.WritePropertyName("schemaVersion"u8); + writer.WriteStringValue(SchemaVersion); + } + writer.WriteEndObject(); + } + + MigrationAssessmentSqlAssessmentV2Data IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentSqlAssessmentV2Data)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentSqlAssessmentV2Data(document.RootElement, options); + } + + internal static MigrationAssessmentSqlAssessmentV2Data DeserializeMigrationAssessmentSqlAssessmentV2Data(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; + MigrationAssessmentProvisioningState? provisioningState = default; + MigrationAssessmentOSLicense? osLicense = default; + AssessmentEnvironmentType? environmentType = default; + EntityUptime entityUptime = default; + SqlOptimizationLogic? optimizationLogic = default; + AzureReservedInstance? reservedInstanceForVm = default; + AzureOfferCode? azureOfferCodeForVm = default; + string eaSubscriptionId = default; + SqlMISettings azureSqlManagedInstanceSettings = default; + SqlDBSettings azureSqlDatabaseSettings = default; + SqlVmSettings azureSqlVmSettings = default; + MultiSubnetIntent? multiSubnetIntent = default; + AsyncCommitModeIntent? asyncCommitModeIntent = default; + bool? isInternetAccessAvailable = default; + AzureLocation? disasterRecoveryLocation = default; + bool? enableHadrAssessment = default; + AzureSecurityOfferingType? azureSecurityOfferingType = default; + AzureReservedInstance? reservedInstance = default; + SqlServerLicense? sqlServerLicense = default; + MigrationAssessmentGroupType? groupType = default; + AssessmentType? assessmentType = default; + AzureLocation? azureLocation = default; + AzureOfferCode? azureOfferCode = default; + AzureCurrency? currency = default; + double? scalingFactor = default; + PercentileOfUtilization? percentile = default; + AssessmentTimeRange? timeRange = default; + DateTimeOffset? perfDataStartTime = default; + DateTimeOffset? perfDataEndTime = default; + AssessmentStage? stage = default; + double? discountPercentage = default; + AssessmentSizingCriterion? sizingCriterion = default; + double? confidenceRatingInPercentage = default; + DateTimeOffset? pricesTimestamp = default; + DateTimeOffset? createdTimestamp = default; + DateTimeOffset? updatedTimestamp = default; + AssessmentStatus? status = default; + string schemaVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(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("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new MigrationAssessmentProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("osLicense"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + osLicense = new MigrationAssessmentOSLicense(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("environmentType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + environmentType = new AssessmentEnvironmentType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("entityUptime"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + entityUptime = EntityUptime.DeserializeEntityUptime(property0.Value, options); + continue; + } + if (property0.NameEquals("optimizationLogic"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + optimizationLogic = new SqlOptimizationLogic(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("reservedInstanceForVm"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + reservedInstanceForVm = new AzureReservedInstance(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("azureOfferCodeForVm"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureOfferCodeForVm = new AzureOfferCode(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("eaSubscriptionId"u8)) + { + eaSubscriptionId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("azureSqlManagedInstanceSettings"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSqlManagedInstanceSettings = SqlMISettings.DeserializeSqlMISettings(property0.Value, options); + continue; + } + if (property0.NameEquals("azureSqlDatabaseSettings"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSqlDatabaseSettings = SqlDBSettings.DeserializeSqlDBSettings(property0.Value, options); + continue; + } + if (property0.NameEquals("azureSqlVmSettings"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSqlVmSettings = SqlVmSettings.DeserializeSqlVmSettings(property0.Value, options); + continue; + } + if (property0.NameEquals("multiSubnetIntent"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + multiSubnetIntent = new MultiSubnetIntent(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("asyncCommitModeIntent"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + asyncCommitModeIntent = new AsyncCommitModeIntent(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("isInternetAccessAvailable"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isInternetAccessAvailable = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("disasterRecoveryLocation"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + disasterRecoveryLocation = new AzureLocation(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("enableHadrAssessment"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableHadrAssessment = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("azureSecurityOfferingType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSecurityOfferingType = new AzureSecurityOfferingType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("reservedInstance"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + reservedInstance = new AzureReservedInstance(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("sqlServerLicense"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sqlServerLicense = new SqlServerLicense(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("groupType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + groupType = new MigrationAssessmentGroupType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("assessmentType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assessmentType = new AssessmentType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("azureLocation"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureLocation = new AzureLocation(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("azureOfferCode"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureOfferCode = new AzureOfferCode(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("currency"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + currency = new AzureCurrency(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("scalingFactor"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scalingFactor = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("percentile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + percentile = new PercentileOfUtilization(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("timeRange"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeRange = new AssessmentTimeRange(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("perfDataStartTime"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + perfDataStartTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("perfDataEndTime"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + perfDataEndTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("stage"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stage = new AssessmentStage(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("discountPercentage"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + discountPercentage = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("sizingCriterion"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sizingCriterion = new AssessmentSizingCriterion(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("confidenceRatingInPercentage"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + confidenceRatingInPercentage = property0.Value.GetDouble(); + continue; + } + if (property0.NameEquals("pricesTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + pricesTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("createdTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("updatedTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("status"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new AssessmentStatus(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("schemaVersion"u8)) + { + schemaVersion = property0.Value.GetString(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentSqlAssessmentV2Data( + id, + name, + type, + systemData, + provisioningState, + osLicense, + environmentType, + entityUptime, + optimizationLogic, + reservedInstanceForVm, + azureOfferCodeForVm, + eaSubscriptionId, + azureSqlManagedInstanceSettings, + azureSqlDatabaseSettings, + azureSqlVmSettings, + multiSubnetIntent, + asyncCommitModeIntent, + isInternetAccessAvailable, + disasterRecoveryLocation, + enableHadrAssessment, + azureSecurityOfferingType, + reservedInstance, + sqlServerLicense, + groupType, + assessmentType, + azureLocation, + azureOfferCode, + currency, + scalingFactor, + percentile, + timeRange, + perfDataStartTime, + perfDataEndTime, + stage, + discountPercentage, + sizingCriterion, + confidenceRatingInPercentage, + pricesTimestamp, + createdTimestamp, + updatedTimestamp, + status, + schemaVersion, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentSqlAssessmentV2Data)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentSqlAssessmentV2Data IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentSqlAssessmentV2Data(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentSqlAssessmentV2Data)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2Data.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2Data.cs new file mode 100644 index 000000000000..d03d363cb19b --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2Data.cs @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing the MigrationAssessmentSqlAssessmentV2 data model. + /// SQL Assessment REST resource. + /// + public partial class MigrationAssessmentSqlAssessmentV2Data : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MigrationAssessmentSqlAssessmentV2Data() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The status of the last operation. + /// Gets or sets user configurable setting to display the azure hybrid use benefit. + /// Gets or sets user configurable setting to display the environment type. + /// + /// Gets or sets the duration for which the entity (SQL, VMs) are up in the + /// on-premises environment. + /// + /// Gets or sets SQL optimization logic. + /// Gets or sets azure reserved instance for VM. + /// Gets or sets Azure Offer Code for VM. + /// Gets or sets the Enterprise agreement subscription id. + /// Gets or sets user configurable SQL managed instance settings. + /// Gets or sets user configurable SQL database settings. + /// Gets or sets user configurable SQL VM settings. + /// Gets or sets user preference indicating intent of multi-subnet configuration. + /// Gets or sets user preference indicating intent of async commit mode. + /// Gets or sets a value indicating whether internet access is available. + /// + /// Gets or sets the Azure Location or Azure region where to which the machines + /// will be migrated. + /// + /// Gets or sets a value indicating whether HADR assessments needs to be created. + /// Gets or sets a value indicating azure security offering type. + /// Reserved instance. + /// SQL server license. + /// Gets the group type for the assessment. + /// Assessment type of the assessment. + /// Azure Location or Azure region where to which the machines will be migrated. + /// Azure Offer Code. + /// Currency in which prices should be reported. + /// + /// Percentage of buffer that user wants on performance metrics when recommending + /// Azure sizes. + /// + /// + /// Percentile of the utilization data values to be considered while assessing + /// machines. + /// + /// + /// Time Range for which the historic utilization data should be considered for + /// assessment. + /// + /// Gets or sets the start time to consider performance data for assessment. + /// Gets or sets the end time to consider performance data for assessment. + /// User configurable setting to display the Stage of Assessment. + /// Custom discount percentage. + /// Assessment sizing criterion. + /// Confidence Rating in Percentage. + /// Last time when rates were queried. + /// Date and Time when assessment was created. + /// Date and Time when assessment was last updated. + /// Whether assessment is in valid state and all machines have been assessed. + /// Schema version. + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentSqlAssessmentV2Data(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MigrationAssessmentProvisioningState? provisioningState, MigrationAssessmentOSLicense? osLicense, AssessmentEnvironmentType? environmentType, EntityUptime entityUptime, SqlOptimizationLogic? optimizationLogic, AzureReservedInstance? reservedInstanceForVm, AzureOfferCode? azureOfferCodeForVm, string eaSubscriptionId, SqlMISettings azureSqlManagedInstanceSettings, SqlDBSettings azureSqlDatabaseSettings, SqlVmSettings azureSqlVmSettings, MultiSubnetIntent? multiSubnetIntent, AsyncCommitModeIntent? asyncCommitModeIntent, bool? isInternetAccessAvailable, AzureLocation? disasterRecoveryLocation, bool? enableHadrAssessment, AzureSecurityOfferingType? azureSecurityOfferingType, AzureReservedInstance? reservedInstance, SqlServerLicense? sqlServerLicense, MigrationAssessmentGroupType? groupType, AssessmentType? assessmentType, AzureLocation? azureLocation, AzureOfferCode? azureOfferCode, AzureCurrency? currency, double? scalingFactor, PercentileOfUtilization? percentile, AssessmentTimeRange? timeRange, DateTimeOffset? perfDataStartOn, DateTimeOffset? perfDataEndOn, AssessmentStage? stage, double? discountPercentage, AssessmentSizingCriterion? sizingCriterion, double? confidenceRatingInPercentage, DateTimeOffset? pricesQueriedOn, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, AssessmentStatus? status, string schemaVersion, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + OSLicense = osLicense; + EnvironmentType = environmentType; + EntityUptime = entityUptime; + OptimizationLogic = optimizationLogic; + ReservedInstanceForVm = reservedInstanceForVm; + AzureOfferCodeForVm = azureOfferCodeForVm; + EASubscriptionId = eaSubscriptionId; + AzureSqlManagedInstanceSettings = azureSqlManagedInstanceSettings; + AzureSqlDatabaseSettings = azureSqlDatabaseSettings; + AzureSqlVmSettings = azureSqlVmSettings; + MultiSubnetIntent = multiSubnetIntent; + AsyncCommitModeIntent = asyncCommitModeIntent; + IsInternetAccessAvailable = isInternetAccessAvailable; + DisasterRecoveryLocation = disasterRecoveryLocation; + EnableHadrAssessment = enableHadrAssessment; + AzureSecurityOfferingType = azureSecurityOfferingType; + ReservedInstance = reservedInstance; + SqlServerLicense = sqlServerLicense; + GroupType = groupType; + AssessmentType = assessmentType; + AzureLocation = azureLocation; + AzureOfferCode = azureOfferCode; + Currency = currency; + ScalingFactor = scalingFactor; + Percentile = percentile; + TimeRange = timeRange; + PerfDataStartOn = perfDataStartOn; + PerfDataEndOn = perfDataEndOn; + Stage = stage; + DiscountPercentage = discountPercentage; + SizingCriterion = sizingCriterion; + ConfidenceRatingInPercentage = confidenceRatingInPercentage; + PricesQueriedOn = pricesQueriedOn; + CreatedOn = createdOn; + UpdatedOn = updatedOn; + Status = status; + SchemaVersion = schemaVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The status of the last operation. + public MigrationAssessmentProvisioningState? ProvisioningState { get; set; } + /// Gets or sets user configurable setting to display the azure hybrid use benefit. + public MigrationAssessmentOSLicense? OSLicense { get; set; } + /// Gets or sets user configurable setting to display the environment type. + public AssessmentEnvironmentType? EnvironmentType { get; set; } + /// + /// Gets or sets the duration for which the entity (SQL, VMs) are up in the + /// on-premises environment. + /// + public EntityUptime EntityUptime { get; set; } + /// Gets or sets SQL optimization logic. + public SqlOptimizationLogic? OptimizationLogic { get; set; } + /// Gets or sets azure reserved instance for VM. + public AzureReservedInstance? ReservedInstanceForVm { get; set; } + /// Gets or sets Azure Offer Code for VM. + public AzureOfferCode? AzureOfferCodeForVm { get; set; } + /// Gets or sets the Enterprise agreement subscription id. + public string EASubscriptionId { get; set; } + /// Gets or sets user configurable SQL managed instance settings. + public SqlMISettings AzureSqlManagedInstanceSettings { get; set; } + /// Gets or sets user configurable SQL database settings. + public SqlDBSettings AzureSqlDatabaseSettings { get; set; } + /// Gets or sets user configurable SQL VM settings. + internal SqlVmSettings AzureSqlVmSettings { get; set; } + /// + /// Gets or sets the Azure VM families (calling instance series to keep it + /// consistent with other targets). + /// + public IList AzureSqlVmInstanceSeries + { + get + { + if (AzureSqlVmSettings is null) + AzureSqlVmSettings = new SqlVmSettings(); + return AzureSqlVmSettings.InstanceSeries; + } + } + + /// Gets or sets user preference indicating intent of multi-subnet configuration. + public MultiSubnetIntent? MultiSubnetIntent { get; set; } + /// Gets or sets user preference indicating intent of async commit mode. + public AsyncCommitModeIntent? AsyncCommitModeIntent { get; set; } + /// Gets or sets a value indicating whether internet access is available. + public bool? IsInternetAccessAvailable { get; set; } + /// + /// Gets or sets the Azure Location or Azure region where to which the machines + /// will be migrated. + /// + public AzureLocation? DisasterRecoveryLocation { get; set; } + /// Gets or sets a value indicating whether HADR assessments needs to be created. + public bool? EnableHadrAssessment { get; set; } + /// Gets or sets a value indicating azure security offering type. + public AzureSecurityOfferingType? AzureSecurityOfferingType { get; set; } + /// Reserved instance. + public AzureReservedInstance? ReservedInstance { get; set; } + /// SQL server license. + public SqlServerLicense? SqlServerLicense { get; set; } + /// Gets the group type for the assessment. + public MigrationAssessmentGroupType? GroupType { get; set; } + /// Assessment type of the assessment. + public AssessmentType? AssessmentType { get; set; } + /// Azure Location or Azure region where to which the machines will be migrated. + public AzureLocation? AzureLocation { get; set; } + /// Azure Offer Code. + public AzureOfferCode? AzureOfferCode { get; set; } + /// Currency in which prices should be reported. + public AzureCurrency? Currency { get; set; } + /// + /// Percentage of buffer that user wants on performance metrics when recommending + /// Azure sizes. + /// + public double? ScalingFactor { get; set; } + /// + /// Percentile of the utilization data values to be considered while assessing + /// machines. + /// + public PercentileOfUtilization? Percentile { get; set; } + /// + /// Time Range for which the historic utilization data should be considered for + /// assessment. + /// + public AssessmentTimeRange? TimeRange { get; set; } + /// Gets or sets the start time to consider performance data for assessment. + public DateTimeOffset? PerfDataStartOn { get; set; } + /// Gets or sets the end time to consider performance data for assessment. + public DateTimeOffset? PerfDataEndOn { get; set; } + /// User configurable setting to display the Stage of Assessment. + public AssessmentStage? Stage { get; } + /// Custom discount percentage. + public double? DiscountPercentage { get; set; } + /// Assessment sizing criterion. + public AssessmentSizingCriterion? SizingCriterion { get; set; } + /// Confidence Rating in Percentage. + public double? ConfidenceRatingInPercentage { get; set; } + /// Last time when rates were queried. + public DateTimeOffset? PricesQueriedOn { get; } + /// Date and Time when assessment was created. + public DateTimeOffset? CreatedOn { get; } + /// Date and Time when assessment was last updated. + public DateTimeOffset? UpdatedOn { get; } + /// Whether assessment is in valid state and all machines have been assessed. + public AssessmentStatus? Status { get; } + /// Schema version. + public string SchemaVersion { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2Resource.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2Resource.Serialization.cs new file mode 100644 index 000000000000..1a1ea8e06a92 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2Resource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentSqlAssessmentV2Resource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MigrationAssessmentSqlAssessmentV2Data IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MigrationAssessmentSqlAssessmentV2Data IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2Resource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2Resource.cs new file mode 100644 index 000000000000..3a0065f2758f --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2Resource.cs @@ -0,0 +1,790 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A Class representing a MigrationAssessmentSqlAssessmentV2 along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMigrationAssessmentSqlAssessmentV2Resource method. + /// Otherwise you can get one from its parent resource using the GetMigrationAssessmentSqlAssessmentV2 method. + /// + public partial class MigrationAssessmentSqlAssessmentV2Resource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The groupName. + /// The assessmentName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics; + private readonly SqlAssessmentV2RestOperations _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient; + private readonly MigrationAssessmentSqlAssessmentV2Data _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/groups/sqlAssessments"; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentSqlAssessmentV2Resource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MigrationAssessmentSqlAssessmentV2Resource(ArmClient client, MigrationAssessmentSqlAssessmentV2Data data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MigrationAssessmentSqlAssessmentV2Resource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsApiVersion); + _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient = new SqlAssessmentV2RestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MigrationAssessmentSqlAssessmentV2Data Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of AssessedSqlDatabaseV2Resources in the MigrationAssessmentSqlAssessmentV2. + /// An object representing collection of AssessedSqlDatabaseV2Resources and their operations over a AssessedSqlDatabaseV2Resource. + public virtual AssessedSqlDatabaseV2Collection GetAssessedSqlDatabaseV2s() + { + return GetCachedClient(client => new AssessedSqlDatabaseV2Collection(client, Id)); + } + + /// + /// Get a AssessedSqlDatabaseV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlDatabases/{assessedSqlDatabaseName} + /// + /// + /// Operation Id + /// AssessedSqlDatabaseV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Databases ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAssessedSqlDatabaseV2Async(string assessedSqlDatabaseName, CancellationToken cancellationToken = default) + { + return await GetAssessedSqlDatabaseV2s().GetAsync(assessedSqlDatabaseName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AssessedSqlDatabaseV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlDatabases/{assessedSqlDatabaseName} + /// + /// + /// Operation Id + /// AssessedSqlDatabaseV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Databases ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAssessedSqlDatabaseV2(string assessedSqlDatabaseName, CancellationToken cancellationToken = default) + { + return GetAssessedSqlDatabaseV2s().Get(assessedSqlDatabaseName, cancellationToken); + } + + /// Gets a collection of AssessedSqlInstanceV2Resources in the MigrationAssessmentSqlAssessmentV2. + /// An object representing collection of AssessedSqlInstanceV2Resources and their operations over a AssessedSqlInstanceV2Resource. + public virtual AssessedSqlInstanceV2Collection GetAssessedSqlInstanceV2s() + { + return GetCachedClient(client => new AssessedSqlInstanceV2Collection(client, Id)); + } + + /// + /// Get a AssessedSqlInstanceV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlInstances/{assessedSqlInstanceName} + /// + /// + /// Operation Id + /// AssessedSqlInstanceV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Instance ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAssessedSqlInstanceV2Async(string assessedSqlInstanceName, CancellationToken cancellationToken = default) + { + return await GetAssessedSqlInstanceV2s().GetAsync(assessedSqlInstanceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AssessedSqlInstanceV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlInstances/{assessedSqlInstanceName} + /// + /// + /// Operation Id + /// AssessedSqlInstanceV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Instance ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAssessedSqlInstanceV2(string assessedSqlInstanceName, CancellationToken cancellationToken = default) + { + return GetAssessedSqlInstanceV2s().Get(assessedSqlInstanceName, cancellationToken); + } + + /// Gets a collection of AssessedSqlMachineResources in the MigrationAssessmentSqlAssessmentV2. + /// An object representing collection of AssessedSqlMachineResources and their operations over a AssessedSqlMachineResource. + public virtual AssessedSqlMachineCollection GetAssessedSqlMachines() + { + return GetCachedClient(client => new AssessedSqlMachineCollection(client, Id)); + } + + /// + /// Get a AssessedSqlMachine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlMachines/{assessedSqlMachineName} + /// + /// + /// Operation Id + /// AssessedSqlMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAssessedSqlMachineAsync(string assessedSqlMachineName, CancellationToken cancellationToken = default) + { + return await GetAssessedSqlMachines().GetAsync(assessedSqlMachineName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AssessedSqlMachine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/assessedSqlMachines/{assessedSqlMachineName} + /// + /// + /// Operation Id + /// AssessedSqlMachinesOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAssessedSqlMachine(string assessedSqlMachineName, CancellationToken cancellationToken = default) + { + return GetAssessedSqlMachines().Get(assessedSqlMachineName, cancellationToken); + } + + /// Gets a collection of AssessedSqlRecommendedEntityResources in the MigrationAssessmentSqlAssessmentV2. + /// An object representing collection of AssessedSqlRecommendedEntityResources and their operations over a AssessedSqlRecommendedEntityResource. + public virtual AssessedSqlRecommendedEntityCollection GetAssessedSqlRecommendedEntities() + { + return GetCachedClient(client => new AssessedSqlRecommendedEntityCollection(client, Id)); + } + + /// + /// Get a AssessedSqlRecommendedEntity + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/recommendedAssessedEntities/{recommendedAssessedEntityName} + /// + /// + /// Operation Id + /// AssessedSqlRecommendedEntityOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Recommended Entity ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAssessedSqlRecommendedEntityAsync(string recommendedAssessedEntityName, CancellationToken cancellationToken = default) + { + return await GetAssessedSqlRecommendedEntities().GetAsync(recommendedAssessedEntityName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AssessedSqlRecommendedEntity + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/recommendedAssessedEntities/{recommendedAssessedEntityName} + /// + /// + /// Operation Id + /// AssessedSqlRecommendedEntityOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql assessment Assessed Recommended Entity ARM name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAssessedSqlRecommendedEntity(string recommendedAssessedEntityName, CancellationToken cancellationToken = default) + { + return GetAssessedSqlRecommendedEntities().Get(recommendedAssessedEntityName, cancellationToken); + } + + /// Gets a collection of MigrationAssessmentSqlAssessmentV2SummaryResources in the MigrationAssessmentSqlAssessmentV2. + /// An object representing collection of MigrationAssessmentSqlAssessmentV2SummaryResources and their operations over a MigrationAssessmentSqlAssessmentV2SummaryResource. + public virtual MigrationAssessmentSqlAssessmentV2SummaryCollection GetMigrationAssessmentSqlAssessmentV2Summaries() + { + return GetCachedClient(client => new MigrationAssessmentSqlAssessmentV2SummaryCollection(client, Id)); + } + + /// + /// Get a SqlAssessmentV2Summary + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// SqlAssessmentV2SummaryOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Gets the Name of the SQL Summary. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMigrationAssessmentSqlAssessmentV2SummaryAsync(string summaryName, CancellationToken cancellationToken = default) + { + return await GetMigrationAssessmentSqlAssessmentV2Summaries().GetAsync(summaryName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a SqlAssessmentV2Summary + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// SqlAssessmentV2SummaryOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Gets the Name of the SQL Summary. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMigrationAssessmentSqlAssessmentV2Summary(string summaryName, CancellationToken cancellationToken = default) + { + return GetMigrationAssessmentSqlAssessmentV2Summaries().Get(summaryName, cancellationToken); + } + + /// + /// Get a SqlAssessmentV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName} + /// + /// + /// Operation Id + /// SqlAssessmentV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentV2Resource.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentSqlAssessmentV2Resource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SqlAssessmentV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName} + /// + /// + /// Operation Id + /// SqlAssessmentV2Operations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentV2Resource.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentSqlAssessmentV2Resource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a SqlAssessmentV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName} + /// + /// + /// Operation Id + /// SqlAssessmentV2Operations_Delete + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentV2Resource.Delete"); + scope.Start(); + try + { + var response = await _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AssessmentArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a SqlAssessmentV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName} + /// + /// + /// Operation Id + /// SqlAssessmentV2Operations_Delete + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentV2Resource.Delete"); + scope.Start(); + try + { + var response = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AssessmentArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a SqlAssessmentV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName} + /// + /// + /// Operation Id + /// SqlAssessmentV2Operations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, MigrationAssessmentSqlAssessmentV2Data data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentV2Resource.Update"); + scope.Start(); + try + { + var response = await _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new MigrationAssessmentSqlAssessmentV2OperationSource(Client), _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics, Pipeline, _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a SqlAssessmentV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName} + /// + /// + /// Operation Id + /// SqlAssessmentV2Operations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, MigrationAssessmentSqlAssessmentV2Data data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentV2Resource.Update"); + scope.Start(); + try + { + var response = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new AssessmentArmOperation(new MigrationAssessmentSqlAssessmentV2OperationSource(Client), _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics, Pipeline, _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the URL for downloading the assessment in a report format. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/downloadUrl + /// + /// + /// Operation Id + /// SqlAssessmentV2Operations_DownloadUrl + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> DownloadUrlAsync(WaitUntil waitUntil, BinaryData body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentV2Resource.DownloadUrl"); + scope.Start(); + try + { + var response = await _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.DownloadUrlAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new AssessmentReportDownloadUriOperationSource(), _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics, Pipeline, _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.CreateDownloadUrlRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the URL for downloading the assessment in a report format. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/downloadUrl + /// + /// + /// Operation Id + /// SqlAssessmentV2Operations_DownloadUrl + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation DownloadUrl(WaitUntil waitUntil, BinaryData body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentV2Resource.DownloadUrl"); + scope.Start(); + try + { + var response = _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.DownloadUrl(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new AssessmentArmOperation(new AssessmentReportDownloadUriOperationSource(), _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsClientDiagnostics, Pipeline, _migrationAssessmentSqlAssessmentV2SqlAssessmentV2OperationsRestClient.CreateDownloadUrlRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2SummaryCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2SummaryCollection.cs new file mode 100644 index 000000000000..3bf49c9fb91c --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2SummaryCollection.cs @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMigrationAssessmentSqlAssessmentV2Summaries method from an instance of . + /// + public partial class MigrationAssessmentSqlAssessmentV2SummaryCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsClientDiagnostics; + private readonly SqlAssessmentV2SummaryRestOperations _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentSqlAssessmentV2SummaryCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MigrationAssessmentSqlAssessmentV2SummaryCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", MigrationAssessmentSqlAssessmentV2SummaryResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MigrationAssessmentSqlAssessmentV2SummaryResource.ResourceType, out string migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsApiVersion); + _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsRestClient = new SqlAssessmentV2SummaryRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MigrationAssessmentSqlAssessmentV2Resource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MigrationAssessmentSqlAssessmentV2Resource.ResourceType), nameof(id)); + } + + /// + /// Get a SqlAssessmentV2Summary + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// SqlAssessmentV2SummaryOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Gets the Name of the SQL Summary. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string summaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(summaryName, nameof(summaryName)); + + using var scope = _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentV2SummaryCollection.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, summaryName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentSqlAssessmentV2SummaryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SqlAssessmentV2Summary + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// SqlAssessmentV2SummaryOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Gets the Name of the SQL Summary. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string summaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(summaryName, nameof(summaryName)); + + using var scope = _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentV2SummaryCollection.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, summaryName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentSqlAssessmentV2SummaryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List SqlAssessmentV2Summary resources by SqlAssessmentV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/summaries + /// + /// + /// Operation Id + /// SqlAssessmentV2SummaryOperations_ListBySqlAssessmentV2 + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsRestClient.CreateListBySqlAssessmentV2Request(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsRestClient.CreateListBySqlAssessmentV2NextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentSqlAssessmentV2SummaryResource(Client, MigrationAssessmentSqlAssessmentV2SummaryData.DeserializeMigrationAssessmentSqlAssessmentV2SummaryData(e)), _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsClientDiagnostics, Pipeline, "MigrationAssessmentSqlAssessmentV2SummaryCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List SqlAssessmentV2Summary resources by SqlAssessmentV2 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/summaries + /// + /// + /// Operation Id + /// SqlAssessmentV2SummaryOperations_ListBySqlAssessmentV2 + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsRestClient.CreateListBySqlAssessmentV2Request(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsRestClient.CreateListBySqlAssessmentV2NextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentSqlAssessmentV2SummaryResource(Client, MigrationAssessmentSqlAssessmentV2SummaryData.DeserializeMigrationAssessmentSqlAssessmentV2SummaryData(e)), _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsClientDiagnostics, Pipeline, "MigrationAssessmentSqlAssessmentV2SummaryCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// SqlAssessmentV2SummaryOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Gets the Name of the SQL Summary. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string summaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(summaryName, nameof(summaryName)); + + using var scope = _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentV2SummaryCollection.Exists"); + scope.Start(); + try + { + var response = await _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, summaryName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// SqlAssessmentV2SummaryOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Gets the Name of the SQL Summary. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string summaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(summaryName, nameof(summaryName)); + + using var scope = _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentV2SummaryCollection.Exists"); + scope.Start(); + try + { + var response = _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, summaryName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// SqlAssessmentV2SummaryOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Gets the Name of the SQL Summary. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string summaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(summaryName, nameof(summaryName)); + + using var scope = _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentV2SummaryCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, summaryName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentSqlAssessmentV2SummaryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// SqlAssessmentV2SummaryOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Gets the Name of the SQL Summary. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string summaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(summaryName, nameof(summaryName)); + + using var scope = _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentV2SummaryCollection.GetIfExists"); + scope.Start(); + try + { + var response = _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, summaryName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentSqlAssessmentV2SummaryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2SummaryData.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2SummaryData.Serialization.cs new file mode 100644 index 000000000000..1845fd3bfb39 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2SummaryData.Serialization.cs @@ -0,0 +1,439 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentSqlAssessmentV2SummaryData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentSqlAssessmentV2SummaryData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsCollectionDefined(AssessmentSummary)) + { + writer.WritePropertyName("assessmentSummary"u8); + writer.WriteStartObject(); + foreach (var item in AssessmentSummary) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(DistributionBySupportStatus)) + { + writer.WritePropertyName("distributionBySupportStatus"u8); + writer.WriteStartObject(); + foreach (var item in DistributionBySupportStatus) + { + writer.WritePropertyName(item.Key); + writer.WriteNumberValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(DistributionByServicePackInsight)) + { + writer.WritePropertyName("distributionByServicePackInsight"u8); + writer.WriteStartObject(); + foreach (var item in DistributionByServicePackInsight) + { + writer.WritePropertyName(item.Key); + writer.WriteNumberValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(DistributionBySqlVersion)) + { + writer.WritePropertyName("distributionBySqlVersion"u8); + writer.WriteStartObject(); + foreach (var item in DistributionBySqlVersion) + { + writer.WritePropertyName(item.Key); + writer.WriteNumberValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(DistributionBySqlEdition)) + { + writer.WritePropertyName("distributionBySqlEdition"u8); + writer.WriteStartObject(); + foreach (var item in DistributionBySqlEdition) + { + writer.WritePropertyName(item.Key); + writer.WriteNumberValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(InstanceDistributionBySizingCriterion)) + { + writer.WritePropertyName("instanceDistributionBySizingCriterion"u8); + writer.WriteStartObject(); + foreach (var item in InstanceDistributionBySizingCriterion) + { + writer.WritePropertyName(item.Key); + writer.WriteNumberValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(DatabaseDistributionBySizingCriterion)) + { + writer.WritePropertyName("databaseDistributionBySizingCriterion"u8); + writer.WriteStartObject(); + foreach (var item in DatabaseDistributionBySizingCriterion) + { + writer.WritePropertyName(item.Key); + writer.WriteNumberValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfMachines)) + { + writer.WritePropertyName("numberOfMachines"u8); + writer.WriteNumberValue(NumberOfMachines.Value); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfSqlInstances)) + { + writer.WritePropertyName("numberOfSqlInstances"u8); + writer.WriteNumberValue(NumberOfSqlInstances.Value); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfSuccessfullyDiscoveredSqlInstances)) + { + writer.WritePropertyName("numberOfSuccessfullyDiscoveredSqlInstances"u8); + writer.WriteNumberValue(NumberOfSuccessfullyDiscoveredSqlInstances.Value); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfSqlDatabases)) + { + writer.WritePropertyName("numberOfSqlDatabases"u8); + writer.WriteNumberValue(NumberOfSqlDatabases.Value); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfFciInstances)) + { + writer.WritePropertyName("numberOfFciInstances"u8); + writer.WriteNumberValue(NumberOfFciInstances.Value); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfSqlAvailabilityGroups)) + { + writer.WritePropertyName("numberOfSqlAvailabilityGroups"u8); + writer.WriteNumberValue(NumberOfSqlAvailabilityGroups.Value); + } + writer.WriteEndObject(); + } + + MigrationAssessmentSqlAssessmentV2SummaryData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentSqlAssessmentV2SummaryData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentSqlAssessmentV2SummaryData(document.RootElement, options); + } + + internal static MigrationAssessmentSqlAssessmentV2SummaryData DeserializeMigrationAssessmentSqlAssessmentV2SummaryData(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; + IReadOnlyDictionary assessmentSummary = default; + IReadOnlyDictionary distributionBySupportStatus = default; + IReadOnlyDictionary distributionByServicePackInsight = default; + IReadOnlyDictionary distributionBySqlVersion = default; + IReadOnlyDictionary distributionBySqlEdition = default; + IReadOnlyDictionary instanceDistributionBySizingCriterion = default; + IReadOnlyDictionary databaseDistributionBySizingCriterion = default; + int? numberOfMachines = default; + int? numberOfSqlInstances = default; + int? numberOfSuccessfullyDiscoveredSqlInstances = default; + int? numberOfSqlDatabases = default; + int? numberOfFciInstances = default; + int? numberOfSqlAvailabilityGroups = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(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("assessmentSummary"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, SqlAssessmentV2SummaryDetails.DeserializeSqlAssessmentV2SummaryDetails(property1.Value, options)); + } + assessmentSummary = dictionary; + continue; + } + if (property0.NameEquals("distributionBySupportStatus"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetInt32()); + } + distributionBySupportStatus = dictionary; + continue; + } + if (property0.NameEquals("distributionByServicePackInsight"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetInt32()); + } + distributionByServicePackInsight = dictionary; + continue; + } + if (property0.NameEquals("distributionBySqlVersion"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetInt32()); + } + distributionBySqlVersion = dictionary; + continue; + } + if (property0.NameEquals("distributionBySqlEdition"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetInt32()); + } + distributionBySqlEdition = dictionary; + continue; + } + if (property0.NameEquals("instanceDistributionBySizingCriterion"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetInt32()); + } + instanceDistributionBySizingCriterion = dictionary; + continue; + } + if (property0.NameEquals("databaseDistributionBySizingCriterion"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetInt32()); + } + databaseDistributionBySizingCriterion = dictionary; + continue; + } + if (property0.NameEquals("numberOfMachines"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfMachines = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("numberOfSqlInstances"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfSqlInstances = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("numberOfSuccessfullyDiscoveredSqlInstances"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfSuccessfullyDiscoveredSqlInstances = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("numberOfSqlDatabases"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfSqlDatabases = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("numberOfFciInstances"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfFciInstances = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("numberOfSqlAvailabilityGroups"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfSqlAvailabilityGroups = property0.Value.GetInt32(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentSqlAssessmentV2SummaryData( + id, + name, + type, + systemData, + assessmentSummary ?? new ChangeTrackingDictionary(), + distributionBySupportStatus ?? new ChangeTrackingDictionary(), + distributionByServicePackInsight ?? new ChangeTrackingDictionary(), + distributionBySqlVersion ?? new ChangeTrackingDictionary(), + distributionBySqlEdition ?? new ChangeTrackingDictionary(), + instanceDistributionBySizingCriterion ?? new ChangeTrackingDictionary(), + databaseDistributionBySizingCriterion ?? new ChangeTrackingDictionary(), + numberOfMachines, + numberOfSqlInstances, + numberOfSuccessfullyDiscoveredSqlInstances, + numberOfSqlDatabases, + numberOfFciInstances, + numberOfSqlAvailabilityGroups, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentSqlAssessmentV2SummaryData)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentSqlAssessmentV2SummaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentSqlAssessmentV2SummaryData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentSqlAssessmentV2SummaryData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2SummaryData.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2SummaryData.cs new file mode 100644 index 000000000000..6e12fb7a395e --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2SummaryData.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing the MigrationAssessmentSqlAssessmentV2Summary data model. + /// SQL Assessment REST resource. + /// + public partial class MigrationAssessmentSqlAssessmentV2SummaryData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MigrationAssessmentSqlAssessmentV2SummaryData() + { + AssessmentSummary = new ChangeTrackingDictionary(); + DistributionBySupportStatus = new ChangeTrackingDictionary(); + DistributionByServicePackInsight = new ChangeTrackingDictionary(); + DistributionBySqlVersion = new ChangeTrackingDictionary(); + DistributionBySqlEdition = new ChangeTrackingDictionary(); + InstanceDistributionBySizingCriterion = new ChangeTrackingDictionary(); + DatabaseDistributionBySizingCriterion = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets or sets the Assessment summary. + /// Gets the distribution of sqlInstances by support status. + /// Gets the distribution distribution of sqlInstances by service pack insight. + /// Gets the distribution of sqlInstances by sql version. + /// Gets the distribution of sqlInstances by sql edition. + /// Gets the instance distribution by sizing criterion. + /// Gets the database distribution by sizing criterion. + /// Number of machines part of the assessment. + /// Number of sql instances part of the assessment. + /// Number of successfully discovered sql instances part of the assessment. + /// Number of sql databases part of the assessment. + /// Number of sql failover cluster instances part of the assessment. + /// Number of sql availability groups part of the assessment. + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentSqlAssessmentV2SummaryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IReadOnlyDictionary assessmentSummary, IReadOnlyDictionary distributionBySupportStatus, IReadOnlyDictionary distributionByServicePackInsight, IReadOnlyDictionary distributionBySqlVersion, IReadOnlyDictionary distributionBySqlEdition, IReadOnlyDictionary instanceDistributionBySizingCriterion, IReadOnlyDictionary databaseDistributionBySizingCriterion, int? numberOfMachines, int? numberOfSqlInstances, int? numberOfSuccessfullyDiscoveredSqlInstances, int? numberOfSqlDatabases, int? numberOfFciInstances, int? numberOfSqlAvailabilityGroups, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + AssessmentSummary = assessmentSummary; + DistributionBySupportStatus = distributionBySupportStatus; + DistributionByServicePackInsight = distributionByServicePackInsight; + DistributionBySqlVersion = distributionBySqlVersion; + DistributionBySqlEdition = distributionBySqlEdition; + InstanceDistributionBySizingCriterion = instanceDistributionBySizingCriterion; + DatabaseDistributionBySizingCriterion = databaseDistributionBySizingCriterion; + NumberOfMachines = numberOfMachines; + NumberOfSqlInstances = numberOfSqlInstances; + NumberOfSuccessfullyDiscoveredSqlInstances = numberOfSuccessfullyDiscoveredSqlInstances; + NumberOfSqlDatabases = numberOfSqlDatabases; + NumberOfFciInstances = numberOfFciInstances; + NumberOfSqlAvailabilityGroups = numberOfSqlAvailabilityGroups; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the Assessment summary. + public IReadOnlyDictionary AssessmentSummary { get; } + /// Gets the distribution of sqlInstances by support status. + public IReadOnlyDictionary DistributionBySupportStatus { get; } + /// Gets the distribution distribution of sqlInstances by service pack insight. + public IReadOnlyDictionary DistributionByServicePackInsight { get; } + /// Gets the distribution of sqlInstances by sql version. + public IReadOnlyDictionary DistributionBySqlVersion { get; } + /// Gets the distribution of sqlInstances by sql edition. + public IReadOnlyDictionary DistributionBySqlEdition { get; } + /// Gets the instance distribution by sizing criterion. + public IReadOnlyDictionary InstanceDistributionBySizingCriterion { get; } + /// Gets the database distribution by sizing criterion. + public IReadOnlyDictionary DatabaseDistributionBySizingCriterion { get; } + /// Number of machines part of the assessment. + public int? NumberOfMachines { get; } + /// Number of sql instances part of the assessment. + public int? NumberOfSqlInstances { get; } + /// Number of successfully discovered sql instances part of the assessment. + public int? NumberOfSuccessfullyDiscoveredSqlInstances { get; } + /// Number of sql databases part of the assessment. + public int? NumberOfSqlDatabases { get; } + /// Number of sql failover cluster instances part of the assessment. + public int? NumberOfFciInstances { get; } + /// Number of sql availability groups part of the assessment. + public int? NumberOfSqlAvailabilityGroups { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2SummaryResource.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2SummaryResource.Serialization.cs new file mode 100644 index 000000000000..97eeb6938440 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2SummaryResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentSqlAssessmentV2SummaryResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MigrationAssessmentSqlAssessmentV2SummaryData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MigrationAssessmentSqlAssessmentV2SummaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2SummaryResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2SummaryResource.cs new file mode 100644 index 000000000000..6f9281da2fe6 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlAssessmentV2SummaryResource.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A Class representing a MigrationAssessmentSqlAssessmentV2Summary along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMigrationAssessmentSqlAssessmentV2SummaryResource method. + /// Otherwise you can get one from its parent resource using the GetMigrationAssessmentSqlAssessmentV2Summary method. + /// + public partial class MigrationAssessmentSqlAssessmentV2SummaryResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The groupName. + /// The assessmentName. + /// The summaryName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string summaryName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/summaries/{summaryName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsClientDiagnostics; + private readonly SqlAssessmentV2SummaryRestOperations _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsRestClient; + private readonly MigrationAssessmentSqlAssessmentV2SummaryData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/groups/sqlAssessments/summaries"; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentSqlAssessmentV2SummaryResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MigrationAssessmentSqlAssessmentV2SummaryResource(ArmClient client, MigrationAssessmentSqlAssessmentV2SummaryData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MigrationAssessmentSqlAssessmentV2SummaryResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsApiVersion); + _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsRestClient = new SqlAssessmentV2SummaryRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MigrationAssessmentSqlAssessmentV2SummaryData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a SqlAssessmentV2Summary + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// SqlAssessmentV2SummaryOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentV2SummaryResource.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentSqlAssessmentV2SummaryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SqlAssessmentV2Summary + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/sqlAssessments/{assessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// SqlAssessmentV2SummaryOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlAssessmentV2SummaryResource.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentSqlAssessmentV2SummarySqlAssessmentV2SummaryOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentSqlAssessmentV2SummaryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlCollectorCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlCollectorCollection.cs new file mode 100644 index 000000000000..f2cedb729641 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlCollectorCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMigrationAssessmentSqlCollectors method from an instance of . + /// + public partial class MigrationAssessmentSqlCollectorCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _migrationAssessmentSqlCollectorSqlCollectorOperationsClientDiagnostics; + private readonly SqlCollectorRestOperations _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentSqlCollectorCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MigrationAssessmentSqlCollectorCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentSqlCollectorSqlCollectorOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", MigrationAssessmentSqlCollectorResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MigrationAssessmentSqlCollectorResource.ResourceType, out string migrationAssessmentSqlCollectorSqlCollectorOperationsApiVersion); + _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient = new SqlCollectorRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentSqlCollectorSqlCollectorOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MigrationAssessmentAssessmentProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MigrationAssessmentAssessmentProjectResource.ResourceType), nameof(id)); + } + + /// + /// Create a SqlCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlcollectors/{collectorName} + /// + /// + /// Operation Id + /// SqlCollectorOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Sql collector ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string collectorName, MigrationAssessmentSqlCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(collectorName, nameof(collectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentSqlCollectorSqlCollectorOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlCollectorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, collectorName, data, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new MigrationAssessmentSqlCollectorOperationSource(Client), _migrationAssessmentSqlCollectorSqlCollectorOperationsClientDiagnostics, Pipeline, _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, collectorName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a SqlCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlcollectors/{collectorName} + /// + /// + /// Operation Id + /// SqlCollectorOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Sql collector ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string collectorName, MigrationAssessmentSqlCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(collectorName, nameof(collectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentSqlCollectorSqlCollectorOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlCollectorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, collectorName, data, cancellationToken); + var operation = new AssessmentArmOperation(new MigrationAssessmentSqlCollectorOperationSource(Client), _migrationAssessmentSqlCollectorSqlCollectorOperationsClientDiagnostics, Pipeline, _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, collectorName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SqlCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlcollectors/{collectorName} + /// + /// + /// Operation Id + /// SqlCollectorOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string collectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(collectorName, nameof(collectorName)); + + using var scope = _migrationAssessmentSqlCollectorSqlCollectorOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlCollectorCollection.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, collectorName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentSqlCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SqlCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlcollectors/{collectorName} + /// + /// + /// Operation Id + /// SqlCollectorOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string collectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(collectorName, nameof(collectorName)); + + using var scope = _migrationAssessmentSqlCollectorSqlCollectorOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlCollectorCollection.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, collectorName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentSqlCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List SqlCollector resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlcollectors + /// + /// + /// Operation Id + /// SqlCollectorOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentSqlCollectorResource(Client, MigrationAssessmentSqlCollectorData.DeserializeMigrationAssessmentSqlCollectorData(e)), _migrationAssessmentSqlCollectorSqlCollectorOperationsClientDiagnostics, Pipeline, "MigrationAssessmentSqlCollectorCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List SqlCollector resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlcollectors + /// + /// + /// Operation Id + /// SqlCollectorOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentSqlCollectorResource(Client, MigrationAssessmentSqlCollectorData.DeserializeMigrationAssessmentSqlCollectorData(e)), _migrationAssessmentSqlCollectorSqlCollectorOperationsClientDiagnostics, Pipeline, "MigrationAssessmentSqlCollectorCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlcollectors/{collectorName} + /// + /// + /// Operation Id + /// SqlCollectorOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string collectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(collectorName, nameof(collectorName)); + + using var scope = _migrationAssessmentSqlCollectorSqlCollectorOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlCollectorCollection.Exists"); + scope.Start(); + try + { + var response = await _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, collectorName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlcollectors/{collectorName} + /// + /// + /// Operation Id + /// SqlCollectorOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string collectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(collectorName, nameof(collectorName)); + + using var scope = _migrationAssessmentSqlCollectorSqlCollectorOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlCollectorCollection.Exists"); + scope.Start(); + try + { + var response = _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, collectorName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlcollectors/{collectorName} + /// + /// + /// Operation Id + /// SqlCollectorOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string collectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(collectorName, nameof(collectorName)); + + using var scope = _migrationAssessmentSqlCollectorSqlCollectorOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlCollectorCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, collectorName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentSqlCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlcollectors/{collectorName} + /// + /// + /// Operation Id + /// SqlCollectorOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// Sql collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string collectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(collectorName, nameof(collectorName)); + + using var scope = _migrationAssessmentSqlCollectorSqlCollectorOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlCollectorCollection.GetIfExists"); + scope.Start(); + try + { + var response = _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, collectorName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentSqlCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlCollectorData.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlCollectorData.Serialization.cs new file mode 100644 index 000000000000..d3a683edb7a9 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlCollectorData.Serialization.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentSqlCollectorData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentSqlCollectorData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(AgentProperties)) + { + writer.WritePropertyName("agentProperties"u8); + writer.WriteObjectValue(AgentProperties, options); + } + if (Optional.IsDefined(DiscoverySiteId)) + { + writer.WritePropertyName("discoverySiteId"u8); + writer.WriteStringValue(DiscoverySiteId); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("createdTimestamp"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(UpdatedOn)) + { + writer.WritePropertyName("updatedTimestamp"u8); + writer.WriteStringValue(UpdatedOn.Value, "O"); + } + writer.WriteEndObject(); + } + + MigrationAssessmentSqlCollectorData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentSqlCollectorData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentSqlCollectorData(document.RootElement, options); + } + + internal static MigrationAssessmentSqlCollectorData DeserializeMigrationAssessmentSqlCollectorData(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; + MigrationAssessmentProvisioningState? provisioningState = default; + CollectorAgentPropertiesBase agentProperties = default; + string discoverySiteId = default; + DateTimeOffset? createdTimestamp = default; + DateTimeOffset? updatedTimestamp = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(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("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new MigrationAssessmentProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("agentProperties"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + agentProperties = CollectorAgentPropertiesBase.DeserializeCollectorAgentPropertiesBase(property0.Value, options); + continue; + } + if (property0.NameEquals("discoverySiteId"u8)) + { + discoverySiteId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("createdTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("updatedTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentSqlCollectorData( + id, + name, + type, + systemData, + provisioningState, + agentProperties, + discoverySiteId, + createdTimestamp, + updatedTimestamp, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentSqlCollectorData)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentSqlCollectorData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentSqlCollectorData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentSqlCollectorData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlCollectorData.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlCollectorData.cs new file mode 100644 index 000000000000..23aee13d7f8b --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlCollectorData.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing the MigrationAssessmentSqlCollector data model. + /// The SQL collector REST object. + /// + public partial class MigrationAssessmentSqlCollectorData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MigrationAssessmentSqlCollectorData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The status of the last operation. + /// Gets or sets the collector agent properties. + /// Gets the discovery site id. + /// Gets the Timestamp when collector was created. + /// Timestamp when collector was last updated. + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentSqlCollectorData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MigrationAssessmentProvisioningState? provisioningState, CollectorAgentPropertiesBase agentProperties, string discoverySiteId, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + AgentProperties = agentProperties; + DiscoverySiteId = discoverySiteId; + CreatedOn = createdOn; + UpdatedOn = updatedOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The status of the last operation. + public MigrationAssessmentProvisioningState? ProvisioningState { get; set; } + /// Gets or sets the collector agent properties. + public CollectorAgentPropertiesBase AgentProperties { get; set; } + /// Gets the discovery site id. + public string DiscoverySiteId { get; set; } + /// Gets the Timestamp when collector was created. + public DateTimeOffset? CreatedOn { get; } + /// Timestamp when collector was last updated. + public DateTimeOffset? UpdatedOn { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlCollectorResource.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlCollectorResource.Serialization.cs new file mode 100644 index 000000000000..89f8e84f5f4e --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlCollectorResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentSqlCollectorResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MigrationAssessmentSqlCollectorData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MigrationAssessmentSqlCollectorData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlCollectorResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlCollectorResource.cs new file mode 100644 index 000000000000..31aee6bf0365 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentSqlCollectorResource.cs @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A Class representing a MigrationAssessmentSqlCollector along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMigrationAssessmentSqlCollectorResource method. + /// Otherwise you can get one from its parent resource using the GetMigrationAssessmentSqlCollector method. + /// + public partial class MigrationAssessmentSqlCollectorResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The collectorName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string collectorName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlcollectors/{collectorName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _migrationAssessmentSqlCollectorSqlCollectorOperationsClientDiagnostics; + private readonly SqlCollectorRestOperations _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient; + private readonly MigrationAssessmentSqlCollectorData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/sqlcollectors"; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentSqlCollectorResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MigrationAssessmentSqlCollectorResource(ArmClient client, MigrationAssessmentSqlCollectorData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MigrationAssessmentSqlCollectorResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentSqlCollectorSqlCollectorOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string migrationAssessmentSqlCollectorSqlCollectorOperationsApiVersion); + _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient = new SqlCollectorRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentSqlCollectorSqlCollectorOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MigrationAssessmentSqlCollectorData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a SqlCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlcollectors/{collectorName} + /// + /// + /// Operation Id + /// SqlCollectorOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentSqlCollectorSqlCollectorOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlCollectorResource.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentSqlCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SqlCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlcollectors/{collectorName} + /// + /// + /// Operation Id + /// SqlCollectorOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentSqlCollectorSqlCollectorOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlCollectorResource.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentSqlCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a SqlCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlcollectors/{collectorName} + /// + /// + /// Operation Id + /// SqlCollectorOperations_Delete + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentSqlCollectorSqlCollectorOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlCollectorResource.Delete"); + scope.Start(); + try + { + var response = await _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AssessmentArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a SqlCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlcollectors/{collectorName} + /// + /// + /// Operation Id + /// SqlCollectorOperations_Delete + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentSqlCollectorSqlCollectorOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlCollectorResource.Delete"); + scope.Start(); + try + { + var response = _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AssessmentArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a SqlCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlcollectors/{collectorName} + /// + /// + /// Operation Id + /// SqlCollectorOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, MigrationAssessmentSqlCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentSqlCollectorSqlCollectorOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlCollectorResource.Update"); + scope.Start(); + try + { + var response = await _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new MigrationAssessmentSqlCollectorOperationSource(Client), _migrationAssessmentSqlCollectorSqlCollectorOperationsClientDiagnostics, Pipeline, _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a SqlCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/sqlcollectors/{collectorName} + /// + /// + /// Operation Id + /// SqlCollectorOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, MigrationAssessmentSqlCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentSqlCollectorSqlCollectorOperationsClientDiagnostics.CreateScope("MigrationAssessmentSqlCollectorResource.Update"); + scope.Start(); + try + { + var response = _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new AssessmentArmOperation(new MigrationAssessmentSqlCollectorOperationSource(Client), _migrationAssessmentSqlCollectorSqlCollectorOperationsClientDiagnostics, Pipeline, _migrationAssessmentSqlCollectorSqlCollectorOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentVMwareCollectorCollection.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentVMwareCollectorCollection.cs new file mode 100644 index 000000000000..22edef43e8e0 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentVMwareCollectorCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMigrationAssessmentVMwareCollectors method from an instance of . + /// + public partial class MigrationAssessmentVMwareCollectorCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsClientDiagnostics; + private readonly VmwareCollectorsRestOperations _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentVMwareCollectorCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MigrationAssessmentVMwareCollectorCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", MigrationAssessmentVMwareCollectorResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MigrationAssessmentVMwareCollectorResource.ResourceType, out string migrationAssessmentVMwareCollectorVMwareCollectorsOperationsApiVersion); + _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient = new VmwareCollectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentVMwareCollectorVMwareCollectorsOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MigrationAssessmentAssessmentProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MigrationAssessmentAssessmentProjectResource.ResourceType), nameof(id)); + } + + /// + /// Create a VmwareCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// + /// + /// Operation Id + /// VmwareCollectorsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// VMware collector ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string vmWareCollectorName, MigrationAssessmentVMwareCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vmWareCollectorName, nameof(vmWareCollectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentVMwareCollectorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, vmWareCollectorName, data, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new MigrationAssessmentVMwareCollectorOperationSource(Client), _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsClientDiagnostics, Pipeline, _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, vmWareCollectorName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a VmwareCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// + /// + /// Operation Id + /// VmwareCollectorsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// VMware collector ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string vmWareCollectorName, MigrationAssessmentVMwareCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vmWareCollectorName, nameof(vmWareCollectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentVMwareCollectorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, vmWareCollectorName, data, cancellationToken); + var operation = new AssessmentArmOperation(new MigrationAssessmentVMwareCollectorOperationSource(Client), _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsClientDiagnostics, Pipeline, _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, vmWareCollectorName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a VmwareCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// + /// + /// Operation Id + /// VmwareCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// VMware collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string vmWareCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vmWareCollectorName, nameof(vmWareCollectorName)); + + using var scope = _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentVMwareCollectorCollection.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, vmWareCollectorName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentVMwareCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a VmwareCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// + /// + /// Operation Id + /// VmwareCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// VMware collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string vmWareCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vmWareCollectorName, nameof(vmWareCollectorName)); + + using var scope = _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentVMwareCollectorCollection.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, vmWareCollectorName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentVMwareCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List VmwareCollector resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors + /// + /// + /// Operation Id + /// VmwareCollectorsOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentVMwareCollectorResource(Client, MigrationAssessmentVMwareCollectorData.DeserializeMigrationAssessmentVMwareCollectorData(e)), _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsClientDiagnostics, Pipeline, "MigrationAssessmentVMwareCollectorCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List VmwareCollector resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors + /// + /// + /// Operation Id + /// VmwareCollectorsOperations_ListByAssessmentProject + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient.CreateListByAssessmentProjectRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient.CreateListByAssessmentProjectNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MigrationAssessmentVMwareCollectorResource(Client, MigrationAssessmentVMwareCollectorData.DeserializeMigrationAssessmentVMwareCollectorData(e)), _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsClientDiagnostics, Pipeline, "MigrationAssessmentVMwareCollectorCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// + /// + /// Operation Id + /// VmwareCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// VMware collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string vmWareCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vmWareCollectorName, nameof(vmWareCollectorName)); + + using var scope = _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentVMwareCollectorCollection.Exists"); + scope.Start(); + try + { + var response = await _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, vmWareCollectorName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// + /// + /// Operation Id + /// VmwareCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// VMware collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string vmWareCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vmWareCollectorName, nameof(vmWareCollectorName)); + + using var scope = _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentVMwareCollectorCollection.Exists"); + scope.Start(); + try + { + var response = _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, vmWareCollectorName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// + /// + /// Operation Id + /// VmwareCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// VMware collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string vmWareCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vmWareCollectorName, nameof(vmWareCollectorName)); + + using var scope = _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentVMwareCollectorCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, vmWareCollectorName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentVMwareCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// + /// + /// Operation Id + /// VmwareCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// VMware collector ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string vmWareCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vmWareCollectorName, nameof(vmWareCollectorName)); + + using var scope = _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentVMwareCollectorCollection.GetIfExists"); + scope.Start(); + try + { + var response = _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, vmWareCollectorName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentVMwareCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentVMwareCollectorData.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentVMwareCollectorData.Serialization.cs new file mode 100644 index 000000000000..d796367c7c6a --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentVMwareCollectorData.Serialization.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentVMwareCollectorData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentVMwareCollectorData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(AgentProperties)) + { + writer.WritePropertyName("agentProperties"u8); + writer.WriteObjectValue(AgentProperties, options); + } + if (Optional.IsDefined(DiscoverySiteId)) + { + writer.WritePropertyName("discoverySiteId"u8); + writer.WriteStringValue(DiscoverySiteId); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("createdTimestamp"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(UpdatedOn)) + { + writer.WritePropertyName("updatedTimestamp"u8); + writer.WriteStringValue(UpdatedOn.Value, "O"); + } + writer.WriteEndObject(); + } + + MigrationAssessmentVMwareCollectorData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentVMwareCollectorData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentVMwareCollectorData(document.RootElement, options); + } + + internal static MigrationAssessmentVMwareCollectorData DeserializeMigrationAssessmentVMwareCollectorData(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; + MigrationAssessmentProvisioningState? provisioningState = default; + CollectorAgentPropertiesBase agentProperties = default; + string discoverySiteId = default; + DateTimeOffset? createdTimestamp = default; + DateTimeOffset? updatedTimestamp = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(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("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new MigrationAssessmentProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("agentProperties"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + agentProperties = CollectorAgentPropertiesBase.DeserializeCollectorAgentPropertiesBase(property0.Value, options); + continue; + } + if (property0.NameEquals("discoverySiteId"u8)) + { + discoverySiteId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("createdTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("updatedTimestamp"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedTimestamp = property0.Value.GetDateTimeOffset("O"); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentVMwareCollectorData( + id, + name, + type, + systemData, + provisioningState, + agentProperties, + discoverySiteId, + createdTimestamp, + updatedTimestamp, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentVMwareCollectorData)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentVMwareCollectorData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentVMwareCollectorData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentVMwareCollectorData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentVMwareCollectorData.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentVMwareCollectorData.cs new file mode 100644 index 000000000000..fab981d8993a --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentVMwareCollectorData.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A class representing the MigrationAssessmentVMwareCollector data model. + /// VMware collector resource. + /// + public partial class MigrationAssessmentVMwareCollectorData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MigrationAssessmentVMwareCollectorData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The status of the last operation. + /// Gets or sets the collector agent properties. + /// Gets the discovery site id. + /// Gets the Timestamp when collector was created. + /// Timestamp when collector was last updated. + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentVMwareCollectorData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MigrationAssessmentProvisioningState? provisioningState, CollectorAgentPropertiesBase agentProperties, string discoverySiteId, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + AgentProperties = agentProperties; + DiscoverySiteId = discoverySiteId; + CreatedOn = createdOn; + UpdatedOn = updatedOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The status of the last operation. + public MigrationAssessmentProvisioningState? ProvisioningState { get; set; } + /// Gets or sets the collector agent properties. + public CollectorAgentPropertiesBase AgentProperties { get; set; } + /// Gets the discovery site id. + public string DiscoverySiteId { get; set; } + /// Gets the Timestamp when collector was created. + public DateTimeOffset? CreatedOn { get; } + /// Timestamp when collector was last updated. + public DateTimeOffset? UpdatedOn { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentVMwareCollectorResource.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentVMwareCollectorResource.Serialization.cs new file mode 100644 index 000000000000..f1fe867e5edc --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentVMwareCollectorResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migration.Assessment +{ + public partial class MigrationAssessmentVMwareCollectorResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MigrationAssessmentVMwareCollectorData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MigrationAssessmentVMwareCollectorData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentVMwareCollectorResource.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentVMwareCollectorResource.cs new file mode 100644 index 000000000000..edc8397c476a --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/MigrationAssessmentVMwareCollectorResource.cs @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + /// + /// A Class representing a MigrationAssessmentVMwareCollector along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMigrationAssessmentVMwareCollectorResource method. + /// Otherwise you can get one from its parent resource using the GetMigrationAssessmentVMwareCollector method. + /// + public partial class MigrationAssessmentVMwareCollectorResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The vmWareCollectorName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string vmWareCollectorName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsClientDiagnostics; + private readonly VmwareCollectorsRestOperations _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient; + private readonly MigrationAssessmentVMwareCollectorData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/vmwarecollectors"; + + /// Initializes a new instance of the class for mocking. + protected MigrationAssessmentVMwareCollectorResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MigrationAssessmentVMwareCollectorResource(ArmClient client, MigrationAssessmentVMwareCollectorData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MigrationAssessmentVMwareCollectorResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migration.Assessment", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string migrationAssessmentVMwareCollectorVMwareCollectorsOperationsApiVersion); + _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient = new VmwareCollectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migrationAssessmentVMwareCollectorVMwareCollectorsOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MigrationAssessmentVMwareCollectorData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a VmwareCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// + /// + /// Operation Id + /// VmwareCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentVMwareCollectorResource.Get"); + scope.Start(); + try + { + var response = await _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentVMwareCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a VmwareCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// + /// + /// Operation Id + /// VmwareCollectorsOperations_Get + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentVMwareCollectorResource.Get"); + scope.Start(); + try + { + var response = _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigrationAssessmentVMwareCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a VmwareCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// + /// + /// Operation Id + /// VmwareCollectorsOperations_Delete + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentVMwareCollectorResource.Delete"); + scope.Start(); + try + { + var response = await _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AssessmentArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a VmwareCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// + /// + /// Operation Id + /// VmwareCollectorsOperations_Delete + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentVMwareCollectorResource.Delete"); + scope.Start(); + try + { + var response = _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AssessmentArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a VmwareCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// + /// + /// Operation Id + /// VmwareCollectorsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, MigrationAssessmentVMwareCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentVMwareCollectorResource.Update"); + scope.Start(); + try + { + var response = await _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new AssessmentArmOperation(new MigrationAssessmentVMwareCollectorOperationSource(Client), _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsClientDiagnostics, Pipeline, _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a VmwareCollector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// + /// + /// Operation Id + /// VmwareCollectorsOperations_Create + /// + /// + /// Default Api Version + /// 2023-03-15 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, MigrationAssessmentVMwareCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsClientDiagnostics.CreateScope("MigrationAssessmentVMwareCollectorResource.Update"); + scope.Start(); + try + { + var response = _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new AssessmentArmOperation(new MigrationAssessmentVMwareCollectorOperationSource(Client), _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsClientDiagnostics, Pipeline, _migrationAssessmentVMwareCollectorVMwareCollectorsOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedDataDisk.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedDataDisk.Serialization.cs new file mode 100644 index 000000000000..edd52d928385 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedDataDisk.Serialization.cs @@ -0,0 +1,367 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class AssessedDataDisk : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedDataDisk)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Suitability)) + { + writer.WritePropertyName("suitability"u8); + writer.WriteStringValue(Suitability.Value.ToString()); + } + if (Optional.IsDefined(SuitabilityExplanation)) + { + writer.WritePropertyName("suitabilityExplanation"u8); + writer.WriteStringValue(SuitabilityExplanation.Value.ToString()); + } + if (Optional.IsDefined(SuitabilityDetail)) + { + writer.WritePropertyName("suitabilityDetail"u8); + writer.WriteStringValue(SuitabilityDetail.Value.ToString()); + } + if (Optional.IsDefined(RecommendedDiskSize)) + { + writer.WritePropertyName("recommendedDiskSize"u8); + writer.WriteStringValue(RecommendedDiskSize.Value.ToString()); + } + if (Optional.IsDefined(RecommendedDiskType)) + { + writer.WritePropertyName("recommendedDiskType"u8); + writer.WriteStringValue(RecommendedDiskType.Value.ToString()); + } + if (Optional.IsDefined(RecommendedDiskSizeGigabytes)) + { + writer.WritePropertyName("recommendedDiskSizeGigabytes"u8); + writer.WriteNumberValue(RecommendedDiskSizeGigabytes.Value); + } + if (Optional.IsDefined(RecommendDiskThroughputInMbps)) + { + writer.WritePropertyName("recommendDiskThroughputInMbps"u8); + writer.WriteNumberValue(RecommendDiskThroughputInMbps.Value); + } + if (Optional.IsDefined(RecommendedDiskIops)) + { + writer.WritePropertyName("recommendedDiskIops"u8); + writer.WriteNumberValue(RecommendedDiskIops.Value); + } + if (Optional.IsDefined(MonthlyStorageCost)) + { + writer.WritePropertyName("monthlyStorageCost"u8); + writer.WriteNumberValue(MonthlyStorageCost.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (Optional.IsDefined(GigabytesProvisioned)) + { + writer.WritePropertyName("gigabytesProvisioned"u8); + writer.WriteNumberValue(GigabytesProvisioned.Value); + } + if (Optional.IsDefined(MegabytesPerSecondOfRead)) + { + writer.WritePropertyName("megabytesPerSecondOfRead"u8); + writer.WriteNumberValue(MegabytesPerSecondOfRead.Value); + } + if (Optional.IsDefined(MegabytesPerSecondOfWrite)) + { + writer.WritePropertyName("megabytesPerSecondOfWrite"u8); + writer.WriteNumberValue(MegabytesPerSecondOfWrite.Value); + } + if (Optional.IsDefined(NumberOfReadOperationsPerSecond)) + { + writer.WritePropertyName("numberOfReadOperationsPerSecond"u8); + writer.WriteNumberValue(NumberOfReadOperationsPerSecond.Value); + } + if (Optional.IsDefined(NumberOfWriteOperationsPerSecond)) + { + writer.WritePropertyName("numberOfWriteOperationsPerSecond"u8); + writer.WriteNumberValue(NumberOfWriteOperationsPerSecond.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssessedDataDisk IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedDataDisk)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssessedDataDisk(document.RootElement, options); + } + + internal static AssessedDataDisk DeserializeAssessedDataDisk(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MigrationAssessmentCloudSuitability? suitability = default; + AzureDiskSuitabilityExplanation? suitabilityExplanation = default; + AzureDiskSuitabilityDetail? suitabilityDetail = default; + AzureDiskSize? recommendedDiskSize = default; + AzureDiskType? recommendedDiskType = default; + int? recommendedDiskSizeGigabytes = default; + double? recommendDiskThroughputInMbps = default; + double? recommendedDiskIops = default; + double? monthlyStorageCost = default; + string name = default; + string displayName = default; + double? gigabytesProvisioned = default; + double? megabytesPerSecondOfRead = default; + double? megabytesPerSecondOfWrite = default; + double? numberOfReadOperationsPerSecond = default; + double? numberOfWriteOperationsPerSecond = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("suitability"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitability = new MigrationAssessmentCloudSuitability(property.Value.GetString()); + continue; + } + if (property.NameEquals("suitabilityExplanation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitabilityExplanation = new AzureDiskSuitabilityExplanation(property.Value.GetString()); + continue; + } + if (property.NameEquals("suitabilityDetail"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitabilityDetail = new AzureDiskSuitabilityDetail(property.Value.GetString()); + continue; + } + if (property.NameEquals("recommendedDiskSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendedDiskSize = new AzureDiskSize(property.Value.GetString()); + continue; + } + if (property.NameEquals("recommendedDiskType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendedDiskType = new AzureDiskType(property.Value.GetString()); + continue; + } + if (property.NameEquals("recommendedDiskSizeGigabytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendedDiskSizeGigabytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("recommendDiskThroughputInMbps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendDiskThroughputInMbps = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("recommendedDiskIops"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendedDiskIops = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyStorageCost"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyStorageCost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("gigabytesProvisioned"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gigabytesProvisioned = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("megabytesPerSecondOfRead"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + megabytesPerSecondOfRead = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("megabytesPerSecondOfWrite"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + megabytesPerSecondOfWrite = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("numberOfReadOperationsPerSecond"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfReadOperationsPerSecond = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("numberOfWriteOperationsPerSecond"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfWriteOperationsPerSecond = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssessedDataDisk( + suitability, + suitabilityExplanation, + suitabilityDetail, + recommendedDiskSize, + recommendedDiskType, + recommendedDiskSizeGigabytes, + recommendDiskThroughputInMbps, + recommendedDiskIops, + monthlyStorageCost, + name, + displayName, + gigabytesProvisioned, + megabytesPerSecondOfRead, + megabytesPerSecondOfWrite, + numberOfReadOperationsPerSecond, + numberOfWriteOperationsPerSecond, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssessedDataDisk)} does not support writing '{options.Format}' format."); + } + } + + AssessedDataDisk IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssessedDataDisk(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssessedDataDisk)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedDataDisk.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedDataDisk.cs new file mode 100644 index 000000000000..071b646678f2 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedDataDisk.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Assessed Disk data. Used in Assessed SQL machine DTO. + public partial class AssessedDataDisk + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal AssessedDataDisk() + { + } + + /// Initializes a new instance of . + /// Gets the suitability. + /// Gets the suitability explanation. + /// Gets the suitability detail. + /// Gets the recommended disk size. + /// Gets the recommended disk type. + /// Gets the recommended disk size. + /// Gets the recommended disk throughput. + /// Gets the recommended disk iops. + /// Gets the monthly storage cost. + /// Gets the name. + /// Gets the machine display name. + /// Gets the gigabytes provisioned. + /// Gets the megabytes per second of read. + /// Gets the megabytes per second of write. + /// Gets the number of read operations per second. + /// Gets the number of write operations per second. + /// Keeps track of any properties unknown to the library. + internal AssessedDataDisk(MigrationAssessmentCloudSuitability? suitability, AzureDiskSuitabilityExplanation? suitabilityExplanation, AzureDiskSuitabilityDetail? suitabilityDetail, AzureDiskSize? recommendedDiskSize, AzureDiskType? recommendedDiskType, int? recommendedDiskSizeGigabytes, double? recommendDiskThroughputInMbps, double? recommendedDiskIops, double? monthlyStorageCost, string name, string displayName, double? gigabytesProvisioned, double? megabytesPerSecondOfRead, double? megabytesPerSecondOfWrite, double? numberOfReadOperationsPerSecond, double? numberOfWriteOperationsPerSecond, IDictionary serializedAdditionalRawData) + { + Suitability = suitability; + SuitabilityExplanation = suitabilityExplanation; + SuitabilityDetail = suitabilityDetail; + RecommendedDiskSize = recommendedDiskSize; + RecommendedDiskType = recommendedDiskType; + RecommendedDiskSizeGigabytes = recommendedDiskSizeGigabytes; + RecommendDiskThroughputInMbps = recommendDiskThroughputInMbps; + RecommendedDiskIops = recommendedDiskIops; + MonthlyStorageCost = monthlyStorageCost; + Name = name; + DisplayName = displayName; + GigabytesProvisioned = gigabytesProvisioned; + MegabytesPerSecondOfRead = megabytesPerSecondOfRead; + MegabytesPerSecondOfWrite = megabytesPerSecondOfWrite; + NumberOfReadOperationsPerSecond = numberOfReadOperationsPerSecond; + NumberOfWriteOperationsPerSecond = numberOfWriteOperationsPerSecond; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the suitability. + public MigrationAssessmentCloudSuitability? Suitability { get; } + /// Gets the suitability explanation. + public AzureDiskSuitabilityExplanation? SuitabilityExplanation { get; } + /// Gets the suitability detail. + public AzureDiskSuitabilityDetail? SuitabilityDetail { get; } + /// Gets the recommended disk size. + public AzureDiskSize? RecommendedDiskSize { get; } + /// Gets the recommended disk type. + public AzureDiskType? RecommendedDiskType { get; } + /// Gets the recommended disk size. + public int? RecommendedDiskSizeGigabytes { get; } + /// Gets the recommended disk throughput. + public double? RecommendDiskThroughputInMbps { get; } + /// Gets the recommended disk iops. + public double? RecommendedDiskIops { get; } + /// Gets the monthly storage cost. + public double? MonthlyStorageCost { get; } + /// Gets the name. + public string Name { get; } + /// Gets the machine display name. + public string DisplayName { get; } + /// Gets the gigabytes provisioned. + public double? GigabytesProvisioned { get; } + /// Gets the megabytes per second of read. + public double? MegabytesPerSecondOfRead { get; } + /// Gets the megabytes per second of write. + public double? MegabytesPerSecondOfWrite { get; } + /// Gets the number of read operations per second. + public double? NumberOfReadOperationsPerSecond { get; } + /// Gets the number of write operations per second. + public double? NumberOfWriteOperationsPerSecond { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedDisk.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedDisk.Serialization.cs new file mode 100644 index 000000000000..8833382c9f5f --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedDisk.Serialization.cs @@ -0,0 +1,367 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class AssessedDisk : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedDisk)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Suitability)) + { + writer.WritePropertyName("suitability"u8); + writer.WriteStringValue(Suitability.Value.ToString()); + } + if (Optional.IsDefined(SuitabilityExplanation)) + { + writer.WritePropertyName("suitabilityExplanation"u8); + writer.WriteStringValue(SuitabilityExplanation.Value.ToString()); + } + if (Optional.IsDefined(SuitabilityDetail)) + { + writer.WritePropertyName("suitabilityDetail"u8); + writer.WriteStringValue(SuitabilityDetail.Value.ToString()); + } + if (Optional.IsDefined(RecommendedDiskSize)) + { + writer.WritePropertyName("recommendedDiskSize"u8); + writer.WriteStringValue(RecommendedDiskSize.Value.ToString()); + } + if (Optional.IsDefined(RecommendedDiskType)) + { + writer.WritePropertyName("recommendedDiskType"u8); + writer.WriteStringValue(RecommendedDiskType.Value.ToString()); + } + if (Optional.IsDefined(GigabytesForRecommendedDiskSize)) + { + writer.WritePropertyName("gigabytesForRecommendedDiskSize"u8); + writer.WriteNumberValue(GigabytesForRecommendedDiskSize.Value); + } + if (Optional.IsDefined(RecommendDiskThroughputInMbps)) + { + writer.WritePropertyName("recommendDiskThroughputInMbps"u8); + writer.WriteNumberValue(RecommendDiskThroughputInMbps.Value); + } + if (Optional.IsDefined(RecommendedDiskIops)) + { + writer.WritePropertyName("recommendedDiskIops"u8); + writer.WriteNumberValue(RecommendedDiskIops.Value); + } + if (Optional.IsDefined(MonthlyStorageCost)) + { + writer.WritePropertyName("monthlyStorageCost"u8); + writer.WriteNumberValue(MonthlyStorageCost.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (Optional.IsDefined(GigabytesProvisioned)) + { + writer.WritePropertyName("gigabytesProvisioned"u8); + writer.WriteNumberValue(GigabytesProvisioned.Value); + } + if (Optional.IsDefined(MegabytesPerSecondOfRead)) + { + writer.WritePropertyName("megabytesPerSecondOfRead"u8); + writer.WriteNumberValue(MegabytesPerSecondOfRead.Value); + } + if (Optional.IsDefined(MegabytesPerSecondOfWrite)) + { + writer.WritePropertyName("megabytesPerSecondOfWrite"u8); + writer.WriteNumberValue(MegabytesPerSecondOfWrite.Value); + } + if (Optional.IsDefined(NumberOfReadOperationsPerSecond)) + { + writer.WritePropertyName("numberOfReadOperationsPerSecond"u8); + writer.WriteNumberValue(NumberOfReadOperationsPerSecond.Value); + } + if (Optional.IsDefined(NumberOfWriteOperationsPerSecond)) + { + writer.WritePropertyName("numberOfWriteOperationsPerSecond"u8); + writer.WriteNumberValue(NumberOfWriteOperationsPerSecond.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssessedDisk IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedDisk)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssessedDisk(document.RootElement, options); + } + + internal static AssessedDisk DeserializeAssessedDisk(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MigrationAssessmentCloudSuitability? suitability = default; + AzureDiskSuitabilityExplanation? suitabilityExplanation = default; + AzureDiskSuitabilityDetail? suitabilityDetail = default; + AzureDiskSize? recommendedDiskSize = default; + AzureDiskType? recommendedDiskType = default; + int? gigabytesForRecommendedDiskSize = default; + double? recommendDiskThroughputInMbps = default; + double? recommendedDiskIops = default; + double? monthlyStorageCost = default; + string name = default; + string displayName = default; + double? gigabytesProvisioned = default; + double? megabytesPerSecondOfRead = default; + double? megabytesPerSecondOfWrite = default; + double? numberOfReadOperationsPerSecond = default; + double? numberOfWriteOperationsPerSecond = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("suitability"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitability = new MigrationAssessmentCloudSuitability(property.Value.GetString()); + continue; + } + if (property.NameEquals("suitabilityExplanation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitabilityExplanation = new AzureDiskSuitabilityExplanation(property.Value.GetString()); + continue; + } + if (property.NameEquals("suitabilityDetail"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitabilityDetail = new AzureDiskSuitabilityDetail(property.Value.GetString()); + continue; + } + if (property.NameEquals("recommendedDiskSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendedDiskSize = new AzureDiskSize(property.Value.GetString()); + continue; + } + if (property.NameEquals("recommendedDiskType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendedDiskType = new AzureDiskType(property.Value.GetString()); + continue; + } + if (property.NameEquals("gigabytesForRecommendedDiskSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gigabytesForRecommendedDiskSize = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("recommendDiskThroughputInMbps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendDiskThroughputInMbps = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("recommendedDiskIops"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendedDiskIops = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyStorageCost"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyStorageCost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("gigabytesProvisioned"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gigabytesProvisioned = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("megabytesPerSecondOfRead"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + megabytesPerSecondOfRead = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("megabytesPerSecondOfWrite"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + megabytesPerSecondOfWrite = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("numberOfReadOperationsPerSecond"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfReadOperationsPerSecond = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("numberOfWriteOperationsPerSecond"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfWriteOperationsPerSecond = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssessedDisk( + suitability, + suitabilityExplanation, + suitabilityDetail, + recommendedDiskSize, + recommendedDiskType, + gigabytesForRecommendedDiskSize, + recommendDiskThroughputInMbps, + recommendedDiskIops, + monthlyStorageCost, + name, + displayName, + gigabytesProvisioned, + megabytesPerSecondOfRead, + megabytesPerSecondOfWrite, + numberOfReadOperationsPerSecond, + numberOfWriteOperationsPerSecond, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssessedDisk)} does not support writing '{options.Format}' format."); + } + } + + AssessedDisk IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssessedDisk(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssessedDisk)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedDisk.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedDisk.cs new file mode 100644 index 000000000000..80fe822c619d --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedDisk.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AssessedDisk. + public partial class AssessedDisk + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal AssessedDisk() + { + } + + /// Initializes a new instance of . + /// Gets the suitability. + /// Gets the suitability explanation. + /// Gets the suitability detail. + /// Gets the recommended disk size. + /// Gets the recommended disk type. + /// Gets the recommended disk size. + /// Gets the recommended disk throughput. + /// Gets the recommended disk iops. + /// Gets the monthly storage cost. + /// Gets the name. + /// Gets the machine display name. + /// Gets the gigabytes provisioned. + /// Gets the megabytes per second of read. + /// Gets the megabytes per second of write. + /// Gets the number of read operations per second. + /// Gets the number of write operations per second. + /// Keeps track of any properties unknown to the library. + internal AssessedDisk(MigrationAssessmentCloudSuitability? suitability, AzureDiskSuitabilityExplanation? suitabilityExplanation, AzureDiskSuitabilityDetail? suitabilityDetail, AzureDiskSize? recommendedDiskSize, AzureDiskType? recommendedDiskType, int? gigabytesForRecommendedDiskSize, double? recommendDiskThroughputInMbps, double? recommendedDiskIops, double? monthlyStorageCost, string name, string displayName, double? gigabytesProvisioned, double? megabytesPerSecondOfRead, double? megabytesPerSecondOfWrite, double? numberOfReadOperationsPerSecond, double? numberOfWriteOperationsPerSecond, IDictionary serializedAdditionalRawData) + { + Suitability = suitability; + SuitabilityExplanation = suitabilityExplanation; + SuitabilityDetail = suitabilityDetail; + RecommendedDiskSize = recommendedDiskSize; + RecommendedDiskType = recommendedDiskType; + GigabytesForRecommendedDiskSize = gigabytesForRecommendedDiskSize; + RecommendDiskThroughputInMbps = recommendDiskThroughputInMbps; + RecommendedDiskIops = recommendedDiskIops; + MonthlyStorageCost = monthlyStorageCost; + Name = name; + DisplayName = displayName; + GigabytesProvisioned = gigabytesProvisioned; + MegabytesPerSecondOfRead = megabytesPerSecondOfRead; + MegabytesPerSecondOfWrite = megabytesPerSecondOfWrite; + NumberOfReadOperationsPerSecond = numberOfReadOperationsPerSecond; + NumberOfWriteOperationsPerSecond = numberOfWriteOperationsPerSecond; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the suitability. + public MigrationAssessmentCloudSuitability? Suitability { get; } + /// Gets the suitability explanation. + public AzureDiskSuitabilityExplanation? SuitabilityExplanation { get; } + /// Gets the suitability detail. + public AzureDiskSuitabilityDetail? SuitabilityDetail { get; } + /// Gets the recommended disk size. + public AzureDiskSize? RecommendedDiskSize { get; } + /// Gets the recommended disk type. + public AzureDiskType? RecommendedDiskType { get; } + /// Gets the recommended disk size. + public int? GigabytesForRecommendedDiskSize { get; } + /// Gets the recommended disk throughput. + public double? RecommendDiskThroughputInMbps { get; } + /// Gets the recommended disk iops. + public double? RecommendedDiskIops { get; } + /// Gets the monthly storage cost. + public double? MonthlyStorageCost { get; } + /// Gets the name. + public string Name { get; } + /// Gets the machine display name. + public string DisplayName { get; } + /// Gets the gigabytes provisioned. + public double? GigabytesProvisioned { get; } + /// Gets the megabytes per second of read. + public double? MegabytesPerSecondOfRead { get; } + /// Gets the megabytes per second of write. + public double? MegabytesPerSecondOfWrite { get; } + /// Gets the number of read operations per second. + public double? NumberOfReadOperationsPerSecond { get; } + /// Gets the number of write operations per second. + public double? NumberOfWriteOperationsPerSecond { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedMachineListResult.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedMachineListResult.Serialization.cs new file mode 100644 index 000000000000..bf9e1a7c9bb9 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedMachineListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class AssessedMachineListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedMachineListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssessedMachineListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedMachineListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssessedMachineListResult(document.RootElement, options); + } + + internal static AssessedMachineListResult DeserializeAssessedMachineListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AssessedMachineData.DeserializeAssessedMachineData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssessedMachineListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssessedMachineListResult)} does not support writing '{options.Format}' format."); + } + } + + AssessedMachineListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssessedMachineListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssessedMachineListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedMachineListResult.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedMachineListResult.cs new file mode 100644 index 000000000000..5db69eed06f0 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedMachineListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The response of a AssessedMachine list operation. + internal partial class AssessedMachineListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The AssessedMachine items on this page. + /// is null. + internal AssessedMachineListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AssessedMachine items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AssessedMachineListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssessedMachineListResult() + { + } + + /// The AssessedMachine items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedMachineType.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedMachineType.cs new file mode 100644 index 000000000000..025a313a75ac --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedMachineType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AssessedMachineType. + public readonly partial struct AssessedMachineType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AssessedMachineType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string AssessedMachineValue = "AssessedMachine"; + private const string AvsAssessedMachineValue = "AvsAssessedMachine"; + private const string SqlAssessedMachineValue = "SqlAssessedMachine"; + + /// Unknown. + public static AssessedMachineType Unknown { get; } = new AssessedMachineType(UnknownValue); + /// AssessedMachine. + public static AssessedMachineType AssessedMachine { get; } = new AssessedMachineType(AssessedMachineValue); + /// AvsAssessedMachine. + public static AssessedMachineType AvsAssessedMachine { get; } = new AssessedMachineType(AvsAssessedMachineValue); + /// SqlAssessedMachine. + public static AssessedMachineType SqlAssessedMachine { get; } = new AssessedMachineType(SqlAssessedMachineValue); + /// Determines if two values are the same. + public static bool operator ==(AssessedMachineType left, AssessedMachineType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AssessedMachineType left, AssessedMachineType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AssessedMachineType(string value) => new AssessedMachineType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AssessedMachineType other && Equals(other); + /// + public bool Equals(AssessedMachineType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedNetworkAdapter.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedNetworkAdapter.Serialization.cs new file mode 100644 index 000000000000..9e4855a94a4e --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedNetworkAdapter.Serialization.cs @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class AssessedNetworkAdapter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedNetworkAdapter)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Suitability)) + { + writer.WritePropertyName("suitability"u8); + writer.WriteStringValue(Suitability.Value.ToString()); + } + if (Optional.IsDefined(SuitabilityDetail)) + { + writer.WritePropertyName("suitabilityDetail"u8); + writer.WriteStringValue(SuitabilityDetail.Value.ToString()); + } + if (Optional.IsDefined(SuitabilityExplanation)) + { + writer.WritePropertyName("suitabilityExplanation"u8); + writer.WriteStringValue(SuitabilityExplanation.Value.ToString()); + } + if (Optional.IsDefined(MonthlyBandwidthCosts)) + { + writer.WritePropertyName("monthlyBandwidthCosts"u8); + writer.WriteNumberValue(MonthlyBandwidthCosts.Value); + } + if (Optional.IsDefined(NetGigabytesTransmittedPerMonth)) + { + writer.WritePropertyName("netGigabytesTransmittedPerMonth"u8); + writer.WriteNumberValue(NetGigabytesTransmittedPerMonth.Value); + } + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (Optional.IsDefined(MacAddress)) + { + writer.WritePropertyName("macAddress"u8); + writer.WriteStringValue(MacAddress); + } + if (options.Format != "W" && Optional.IsCollectionDefined(IPAddresses)) + { + writer.WritePropertyName("ipAddresses"u8); + writer.WriteStartArray(); + foreach (var item in IPAddresses) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(MegabytesPerSecondReceived)) + { + writer.WritePropertyName("megabytesPerSecondReceived"u8); + writer.WriteNumberValue(MegabytesPerSecondReceived.Value); + } + if (Optional.IsDefined(MegabytesPerSecondTransmitted)) + { + writer.WritePropertyName("megabytesPerSecondTransmitted"u8); + writer.WriteNumberValue(MegabytesPerSecondTransmitted.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssessedNetworkAdapter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedNetworkAdapter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssessedNetworkAdapter(document.RootElement, options); + } + + internal static AssessedNetworkAdapter DeserializeAssessedNetworkAdapter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MigrationAssessmentCloudSuitability? suitability = default; + AzureNetworkAdapterSuitabilityDetail? suitabilityDetail = default; + AzureNetworkAdapterSuitabilityExplanation? suitabilityExplanation = default; + double? monthlyBandwidthCosts = default; + double? netGigabytesTransmittedPerMonth = default; + string displayName = default; + string macAddress = default; + IReadOnlyList ipAddresses = default; + double? megabytesPerSecondReceived = default; + double? megabytesPerSecondTransmitted = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("suitability"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitability = new MigrationAssessmentCloudSuitability(property.Value.GetString()); + continue; + } + if (property.NameEquals("suitabilityDetail"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitabilityDetail = new AzureNetworkAdapterSuitabilityDetail(property.Value.GetString()); + continue; + } + if (property.NameEquals("suitabilityExplanation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitabilityExplanation = new AzureNetworkAdapterSuitabilityExplanation(property.Value.GetString()); + continue; + } + if (property.NameEquals("monthlyBandwidthCosts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyBandwidthCosts = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("netGigabytesTransmittedPerMonth"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + netGigabytesTransmittedPerMonth = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("macAddress"u8)) + { + macAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipAddresses"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipAddresses = array; + continue; + } + if (property.NameEquals("megabytesPerSecondReceived"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + megabytesPerSecondReceived = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("megabytesPerSecondTransmitted"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + megabytesPerSecondTransmitted = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssessedNetworkAdapter( + suitability, + suitabilityDetail, + suitabilityExplanation, + monthlyBandwidthCosts, + netGigabytesTransmittedPerMonth, + displayName, + macAddress, + ipAddresses ?? new ChangeTrackingList(), + megabytesPerSecondReceived, + megabytesPerSecondTransmitted, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssessedNetworkAdapter)} does not support writing '{options.Format}' format."); + } + } + + AssessedNetworkAdapter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssessedNetworkAdapter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssessedNetworkAdapter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedNetworkAdapter.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedNetworkAdapter.cs new file mode 100644 index 000000000000..6139a0eec54d --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedNetworkAdapter.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Assessed Network Adapter. + public partial class AssessedNetworkAdapter + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal AssessedNetworkAdapter() + { + IPAddresses = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets the suitability. + /// Gets the suitability detail. + /// Gets the suitability explanation. + /// Gets the monthly bandwidth costs. + /// Gets the net gigabytes transmitted per month. + /// Gets the display name. + /// Gets the mac address. + /// Gets the ip addresses. + /// Gets the megabytes per second received. + /// Gets the megabytes per second transmitted. + /// Keeps track of any properties unknown to the library. + internal AssessedNetworkAdapter(MigrationAssessmentCloudSuitability? suitability, AzureNetworkAdapterSuitabilityDetail? suitabilityDetail, AzureNetworkAdapterSuitabilityExplanation? suitabilityExplanation, double? monthlyBandwidthCosts, double? netGigabytesTransmittedPerMonth, string displayName, string macAddress, IReadOnlyList ipAddresses, double? megabytesPerSecondReceived, double? megabytesPerSecondTransmitted, IDictionary serializedAdditionalRawData) + { + Suitability = suitability; + SuitabilityDetail = suitabilityDetail; + SuitabilityExplanation = suitabilityExplanation; + MonthlyBandwidthCosts = monthlyBandwidthCosts; + NetGigabytesTransmittedPerMonth = netGigabytesTransmittedPerMonth; + DisplayName = displayName; + MacAddress = macAddress; + IPAddresses = ipAddresses; + MegabytesPerSecondReceived = megabytesPerSecondReceived; + MegabytesPerSecondTransmitted = megabytesPerSecondTransmitted; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the suitability. + public MigrationAssessmentCloudSuitability? Suitability { get; } + /// Gets the suitability detail. + public AzureNetworkAdapterSuitabilityDetail? SuitabilityDetail { get; } + /// Gets the suitability explanation. + public AzureNetworkAdapterSuitabilityExplanation? SuitabilityExplanation { get; } + /// Gets the monthly bandwidth costs. + public double? MonthlyBandwidthCosts { get; } + /// Gets the net gigabytes transmitted per month. + public double? NetGigabytesTransmittedPerMonth { get; } + /// Gets the display name. + public string DisplayName { get; } + /// Gets the mac address. + public string MacAddress { get; } + /// Gets the ip addresses. + public IReadOnlyList IPAddresses { get; } + /// Gets the megabytes per second received. + public double? MegabytesPerSecondReceived { get; } + /// Gets the megabytes per second transmitted. + public double? MegabytesPerSecondTransmitted { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlDatabaseV2ListResult.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlDatabaseV2ListResult.Serialization.cs new file mode 100644 index 000000000000..db566b649f7e --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlDatabaseV2ListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class AssessedSqlDatabaseV2ListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedSqlDatabaseV2ListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssessedSqlDatabaseV2ListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedSqlDatabaseV2ListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssessedSqlDatabaseV2ListResult(document.RootElement, options); + } + + internal static AssessedSqlDatabaseV2ListResult DeserializeAssessedSqlDatabaseV2ListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AssessedSqlDatabaseV2Data.DeserializeAssessedSqlDatabaseV2Data(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssessedSqlDatabaseV2ListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssessedSqlDatabaseV2ListResult)} does not support writing '{options.Format}' format."); + } + } + + AssessedSqlDatabaseV2ListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssessedSqlDatabaseV2ListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssessedSqlDatabaseV2ListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlDatabaseV2ListResult.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlDatabaseV2ListResult.cs new file mode 100644 index 000000000000..b6fb10e85578 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlDatabaseV2ListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The response of a AssessedSqlDatabaseV2 list operation. + internal partial class AssessedSqlDatabaseV2ListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The AssessedSqlDatabaseV2 items on this page. + /// is null. + internal AssessedSqlDatabaseV2ListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AssessedSqlDatabaseV2 items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AssessedSqlDatabaseV2ListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssessedSqlDatabaseV2ListResult() + { + } + + /// The AssessedSqlDatabaseV2 items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceDatabaseSummary.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceDatabaseSummary.Serialization.cs new file mode 100644 index 000000000000..f3afa654ce4e --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceDatabaseSummary.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class AssessedSqlInstanceDatabaseSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedSqlInstanceDatabaseSummary)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(NumberOfUserDatabases)) + { + writer.WritePropertyName("numberOfUserDatabases"u8); + writer.WriteNumberValue(NumberOfUserDatabases.Value); + } + if (Optional.IsDefined(TotalDatabaseSizeInMB)) + { + writer.WritePropertyName("totalDatabaseSizeInMB"u8); + writer.WriteNumberValue(TotalDatabaseSizeInMB.Value); + } + if (Optional.IsDefined(LargestDatabaseSizeInMB)) + { + writer.WritePropertyName("largestDatabaseSizeInMB"u8); + writer.WriteNumberValue(LargestDatabaseSizeInMB.Value); + } + if (Optional.IsDefined(TotalDiscoveredUserDatabases)) + { + writer.WritePropertyName("totalDiscoveredUserDatabases"u8); + writer.WriteNumberValue(TotalDiscoveredUserDatabases.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssessedSqlInstanceDatabaseSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedSqlInstanceDatabaseSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssessedSqlInstanceDatabaseSummary(document.RootElement, options); + } + + internal static AssessedSqlInstanceDatabaseSummary DeserializeAssessedSqlInstanceDatabaseSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? numberOfUserDatabases = default; + double? totalDatabaseSizeInMB = default; + double? largestDatabaseSizeInMB = default; + int? totalDiscoveredUserDatabases = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("numberOfUserDatabases"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfUserDatabases = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("totalDatabaseSizeInMB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalDatabaseSizeInMB = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("largestDatabaseSizeInMB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + largestDatabaseSizeInMB = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("totalDiscoveredUserDatabases"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalDiscoveredUserDatabases = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssessedSqlInstanceDatabaseSummary(numberOfUserDatabases, totalDatabaseSizeInMB, largestDatabaseSizeInMB, totalDiscoveredUserDatabases, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssessedSqlInstanceDatabaseSummary)} does not support writing '{options.Format}' format."); + } + } + + AssessedSqlInstanceDatabaseSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssessedSqlInstanceDatabaseSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssessedSqlInstanceDatabaseSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceDatabaseSummary.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceDatabaseSummary.cs new file mode 100644 index 000000000000..74281f36d5e9 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceDatabaseSummary.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Assessed Sql Instance Database Summary. + public partial class AssessedSqlInstanceDatabaseSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal AssessedSqlInstanceDatabaseSummary() + { + } + + /// Initializes a new instance of . + /// Gets the number of user databases. + /// Gets the total database size in MB. + /// Gets the largest database size in MB. + /// Gets the total discovered user databases. + /// Keeps track of any properties unknown to the library. + internal AssessedSqlInstanceDatabaseSummary(int? numberOfUserDatabases, double? totalDatabaseSizeInMB, double? largestDatabaseSizeInMB, int? totalDiscoveredUserDatabases, IDictionary serializedAdditionalRawData) + { + NumberOfUserDatabases = numberOfUserDatabases; + TotalDatabaseSizeInMB = totalDatabaseSizeInMB; + LargestDatabaseSizeInMB = largestDatabaseSizeInMB; + TotalDiscoveredUserDatabases = totalDiscoveredUserDatabases; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the number of user databases. + public int? NumberOfUserDatabases { get; } + /// Gets the total database size in MB. + public double? TotalDatabaseSizeInMB { get; } + /// Gets the largest database size in MB. + public double? LargestDatabaseSizeInMB { get; } + /// Gets the total discovered user databases. + public int? TotalDiscoveredUserDatabases { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceDiskDetails.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceDiskDetails.Serialization.cs new file mode 100644 index 000000000000..81ff9f28f0dc --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceDiskDetails.Serialization.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class AssessedSqlInstanceDiskDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedSqlInstanceDiskDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DiskId)) + { + writer.WritePropertyName("diskId"u8); + writer.WriteStringValue(DiskId); + } + if (Optional.IsDefined(DiskSizeInMB)) + { + writer.WritePropertyName("diskSizeInMB"u8); + writer.WriteNumberValue(DiskSizeInMB.Value); + } + if (Optional.IsDefined(MegabytesPerSecondOfRead)) + { + writer.WritePropertyName("megabytesPerSecondOfRead"u8); + writer.WriteNumberValue(MegabytesPerSecondOfRead.Value); + } + if (Optional.IsDefined(MegabytesPerSecondOfWrite)) + { + writer.WritePropertyName("megabytesPerSecondOfWrite"u8); + writer.WriteNumberValue(MegabytesPerSecondOfWrite.Value); + } + if (Optional.IsDefined(NumberOfReadOperationsPerSecond)) + { + writer.WritePropertyName("numberOfReadOperationsPerSecond"u8); + writer.WriteNumberValue(NumberOfReadOperationsPerSecond.Value); + } + if (Optional.IsDefined(NumberOfWriteOperationsPerSecond)) + { + writer.WritePropertyName("numberOfWriteOperationsPerSecond"u8); + writer.WriteNumberValue(NumberOfWriteOperationsPerSecond.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssessedSqlInstanceDiskDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedSqlInstanceDiskDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssessedSqlInstanceDiskDetails(document.RootElement, options); + } + + internal static AssessedSqlInstanceDiskDetails DeserializeAssessedSqlInstanceDiskDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string diskId = default; + double? diskSizeInMB = default; + double? megabytesPerSecondOfRead = default; + double? megabytesPerSecondOfWrite = default; + double? numberOfReadOperationsPerSecond = default; + double? numberOfWriteOperationsPerSecond = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("diskId"u8)) + { + diskId = property.Value.GetString(); + continue; + } + if (property.NameEquals("diskSizeInMB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskSizeInMB = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("megabytesPerSecondOfRead"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + megabytesPerSecondOfRead = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("megabytesPerSecondOfWrite"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + megabytesPerSecondOfWrite = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("numberOfReadOperationsPerSecond"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfReadOperationsPerSecond = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("numberOfWriteOperationsPerSecond"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfWriteOperationsPerSecond = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssessedSqlInstanceDiskDetails( + diskId, + diskSizeInMB, + megabytesPerSecondOfRead, + megabytesPerSecondOfWrite, + numberOfReadOperationsPerSecond, + numberOfWriteOperationsPerSecond, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssessedSqlInstanceDiskDetails)} does not support writing '{options.Format}' format."); + } + } + + AssessedSqlInstanceDiskDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssessedSqlInstanceDiskDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssessedSqlInstanceDiskDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceDiskDetails.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceDiskDetails.cs new file mode 100644 index 000000000000..8044c86dab1d --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceDiskDetails.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Assessed Sql Instance Disk Details. + public partial class AssessedSqlInstanceDiskDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal AssessedSqlInstanceDiskDetails() + { + } + + /// Initializes a new instance of . + /// Gets the disk id. + /// Gets the disk size in mb. + /// Gets the megabytes per second of read. + /// Gets the megabytes per second of write. + /// Gets the number of read operations per second. + /// Gets the number of write operations per second. + /// Keeps track of any properties unknown to the library. + internal AssessedSqlInstanceDiskDetails(string diskId, double? diskSizeInMB, double? megabytesPerSecondOfRead, double? megabytesPerSecondOfWrite, double? numberOfReadOperationsPerSecond, double? numberOfWriteOperationsPerSecond, IDictionary serializedAdditionalRawData) + { + DiskId = diskId; + DiskSizeInMB = diskSizeInMB; + MegabytesPerSecondOfRead = megabytesPerSecondOfRead; + MegabytesPerSecondOfWrite = megabytesPerSecondOfWrite; + NumberOfReadOperationsPerSecond = numberOfReadOperationsPerSecond; + NumberOfWriteOperationsPerSecond = numberOfWriteOperationsPerSecond; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the disk id. + public string DiskId { get; } + /// Gets the disk size in mb. + public double? DiskSizeInMB { get; } + /// Gets the megabytes per second of read. + public double? MegabytesPerSecondOfRead { get; } + /// Gets the megabytes per second of write. + public double? MegabytesPerSecondOfWrite { get; } + /// Gets the number of read operations per second. + public double? NumberOfReadOperationsPerSecond { get; } + /// Gets the number of write operations per second. + public double? NumberOfWriteOperationsPerSecond { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceStorageDetails.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceStorageDetails.Serialization.cs new file mode 100644 index 000000000000..f5179b4b2775 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceStorageDetails.Serialization.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class AssessedSqlInstanceStorageDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedSqlInstanceStorageDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(StorageType)) + { + writer.WritePropertyName("storageType"u8); + writer.WriteStringValue(StorageType); + } + if (Optional.IsDefined(DiskSizeInMB)) + { + writer.WritePropertyName("diskSizeInMB"u8); + writer.WriteNumberValue(DiskSizeInMB.Value); + } + if (Optional.IsDefined(MegabytesPerSecondOfRead)) + { + writer.WritePropertyName("megabytesPerSecondOfRead"u8); + writer.WriteNumberValue(MegabytesPerSecondOfRead.Value); + } + if (Optional.IsDefined(MegabytesPerSecondOfWrite)) + { + writer.WritePropertyName("megabytesPerSecondOfWrite"u8); + writer.WriteNumberValue(MegabytesPerSecondOfWrite.Value); + } + if (Optional.IsDefined(NumberOfReadOperationsPerSecond)) + { + writer.WritePropertyName("numberOfReadOperationsPerSecond"u8); + writer.WriteNumberValue(NumberOfReadOperationsPerSecond.Value); + } + if (Optional.IsDefined(NumberOfWriteOperationsPerSecond)) + { + writer.WritePropertyName("numberOfWriteOperationsPerSecond"u8); + writer.WriteNumberValue(NumberOfWriteOperationsPerSecond.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssessedSqlInstanceStorageDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedSqlInstanceStorageDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssessedSqlInstanceStorageDetails(document.RootElement, options); + } + + internal static AssessedSqlInstanceStorageDetails DeserializeAssessedSqlInstanceStorageDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string storageType = default; + double? diskSizeInMB = default; + double? megabytesPerSecondOfRead = default; + double? megabytesPerSecondOfWrite = default; + double? numberOfReadOperationsPerSecond = default; + double? numberOfWriteOperationsPerSecond = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("storageType"u8)) + { + storageType = property.Value.GetString(); + continue; + } + if (property.NameEquals("diskSizeInMB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskSizeInMB = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("megabytesPerSecondOfRead"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + megabytesPerSecondOfRead = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("megabytesPerSecondOfWrite"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + megabytesPerSecondOfWrite = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("numberOfReadOperationsPerSecond"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfReadOperationsPerSecond = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("numberOfWriteOperationsPerSecond"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfWriteOperationsPerSecond = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssessedSqlInstanceStorageDetails( + storageType, + diskSizeInMB, + megabytesPerSecondOfRead, + megabytesPerSecondOfWrite, + numberOfReadOperationsPerSecond, + numberOfWriteOperationsPerSecond, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssessedSqlInstanceStorageDetails)} does not support writing '{options.Format}' format."); + } + } + + AssessedSqlInstanceStorageDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssessedSqlInstanceStorageDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssessedSqlInstanceStorageDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceStorageDetails.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceStorageDetails.cs new file mode 100644 index 000000000000..d15056e3f8ee --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceStorageDetails.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Assessed Sql Instance Storage Details. + public partial class AssessedSqlInstanceStorageDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal AssessedSqlInstanceStorageDetails() + { + } + + /// Initializes a new instance of . + /// Gets the storage type. + /// Gets the disk size in mb. + /// Gets the megabytes per second of read. + /// Gets the megabytes per second of read. + /// Gets the number of read operations per second. + /// Gets the number of write operations per second. + /// Keeps track of any properties unknown to the library. + internal AssessedSqlInstanceStorageDetails(string storageType, double? diskSizeInMB, double? megabytesPerSecondOfRead, double? megabytesPerSecondOfWrite, double? numberOfReadOperationsPerSecond, double? numberOfWriteOperationsPerSecond, IDictionary serializedAdditionalRawData) + { + StorageType = storageType; + DiskSizeInMB = diskSizeInMB; + MegabytesPerSecondOfRead = megabytesPerSecondOfRead; + MegabytesPerSecondOfWrite = megabytesPerSecondOfWrite; + NumberOfReadOperationsPerSecond = numberOfReadOperationsPerSecond; + NumberOfWriteOperationsPerSecond = numberOfWriteOperationsPerSecond; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the storage type. + public string StorageType { get; } + /// Gets the disk size in mb. + public double? DiskSizeInMB { get; } + /// Gets the megabytes per second of read. + public double? MegabytesPerSecondOfRead { get; } + /// Gets the megabytes per second of read. + public double? MegabytesPerSecondOfWrite { get; } + /// Gets the number of read operations per second. + public double? NumberOfReadOperationsPerSecond { get; } + /// Gets the number of write operations per second. + public double? NumberOfWriteOperationsPerSecond { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceSummary.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceSummary.Serialization.cs new file mode 100644 index 000000000000..03871869df50 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceSummary.Serialization.cs @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class AssessedSqlInstanceSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedSqlInstanceSummary)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(InstanceId)) + { + writer.WritePropertyName("instanceId"u8); + writer.WriteStringValue(InstanceId); + } + if (Optional.IsDefined(InstanceName)) + { + writer.WritePropertyName("instanceName"u8); + writer.WriteStringValue(InstanceName); + } + if (Optional.IsDefined(SqlInstanceSdsArmId)) + { + writer.WritePropertyName("sqlInstanceSdsArmId"u8); + writer.WriteStringValue(SqlInstanceSdsArmId); + } + if (Optional.IsDefined(SqlInstanceEntityId)) + { + writer.WritePropertyName("sqlInstanceEntityId"u8); + writer.WriteStringValue(SqlInstanceEntityId); + } + if (Optional.IsDefined(SqlEdition)) + { + writer.WritePropertyName("sqlEdition"u8); + writer.WriteStringValue(SqlEdition); + } + if (Optional.IsDefined(SqlVersion)) + { + writer.WritePropertyName("sqlVersion"u8); + writer.WriteStringValue(SqlVersion); + } + if (Optional.IsDefined(IsClustered)) + { + writer.WritePropertyName("isClustered"u8); + writer.WriteBooleanValue(IsClustered.Value); + } + if (Optional.IsDefined(IsHighAvailabilityEnabled)) + { + writer.WritePropertyName("isHighAvailabilityEnabled"u8); + writer.WriteBooleanValue(IsHighAvailabilityEnabled.Value); + } + if (Optional.IsDefined(SqlFciState)) + { + writer.WritePropertyName("sqlFciState"u8); + writer.WriteStringValue(SqlFciState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssessedSqlInstanceSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedSqlInstanceSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssessedSqlInstanceSummary(document.RootElement, options); + } + + internal static AssessedSqlInstanceSummary DeserializeAssessedSqlInstanceSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceId = default; + string instanceName = default; + ResourceIdentifier sqlInstanceSdsArmId = default; + string sqlInstanceEntityId = default; + string sqlEdition = default; + string sqlVersion = default; + bool? isClustered = default; + bool? isHighAvailabilityEnabled = default; + SqlFciState? sqlFciState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceId"u8)) + { + instanceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceName"u8)) + { + instanceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sqlInstanceSdsArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sqlInstanceSdsArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("sqlInstanceEntityId"u8)) + { + sqlInstanceEntityId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sqlEdition"u8)) + { + sqlEdition = property.Value.GetString(); + continue; + } + if (property.NameEquals("sqlVersion"u8)) + { + sqlVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("isClustered"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isClustered = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isHighAvailabilityEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isHighAvailabilityEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("sqlFciState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sqlFciState = new SqlFciState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssessedSqlInstanceSummary( + instanceId, + instanceName, + sqlInstanceSdsArmId, + sqlInstanceEntityId, + sqlEdition, + sqlVersion, + isClustered, + isHighAvailabilityEnabled, + sqlFciState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssessedSqlInstanceSummary)} does not support writing '{options.Format}' format."); + } + } + + AssessedSqlInstanceSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssessedSqlInstanceSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssessedSqlInstanceSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceSummary.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceSummary.cs new file mode 100644 index 000000000000..130707414476 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceSummary.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Assessed Sql Instance Summary. + public partial class AssessedSqlInstanceSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal AssessedSqlInstanceSummary() + { + } + + /// Initializes a new instance of . + /// Gets the instance id. + /// Gets the instance name. + /// Gets the instance arm id. + /// Gets the instance entity id. + /// Gets the Sql edition. + /// Gets the Sql version. + /// Gets whether Sql is clustered. + /// Gets whether Sql is highly available. + /// Gets the Sql Fci state. + /// Keeps track of any properties unknown to the library. + internal AssessedSqlInstanceSummary(string instanceId, string instanceName, ResourceIdentifier sqlInstanceSdsArmId, string sqlInstanceEntityId, string sqlEdition, string sqlVersion, bool? isClustered, bool? isHighAvailabilityEnabled, SqlFciState? sqlFciState, IDictionary serializedAdditionalRawData) + { + InstanceId = instanceId; + InstanceName = instanceName; + SqlInstanceSdsArmId = sqlInstanceSdsArmId; + SqlInstanceEntityId = sqlInstanceEntityId; + SqlEdition = sqlEdition; + SqlVersion = sqlVersion; + IsClustered = isClustered; + IsHighAvailabilityEnabled = isHighAvailabilityEnabled; + SqlFciState = sqlFciState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the instance id. + public string InstanceId { get; } + /// Gets the instance name. + public string InstanceName { get; } + /// Gets the instance arm id. + public ResourceIdentifier SqlInstanceSdsArmId { get; } + /// Gets the instance entity id. + public string SqlInstanceEntityId { get; } + /// Gets the Sql edition. + public string SqlEdition { get; } + /// Gets the Sql version. + public string SqlVersion { get; } + /// Gets whether Sql is clustered. + public bool? IsClustered { get; } + /// Gets whether Sql is highly available. + public bool? IsHighAvailabilityEnabled { get; } + /// Gets the Sql Fci state. + public SqlFciState? SqlFciState { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceV2ListResult.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceV2ListResult.Serialization.cs new file mode 100644 index 000000000000..d638cd7f6980 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceV2ListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class AssessedSqlInstanceV2ListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedSqlInstanceV2ListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssessedSqlInstanceV2ListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedSqlInstanceV2ListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssessedSqlInstanceV2ListResult(document.RootElement, options); + } + + internal static AssessedSqlInstanceV2ListResult DeserializeAssessedSqlInstanceV2ListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AssessedSqlInstanceV2Data.DeserializeAssessedSqlInstanceV2Data(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssessedSqlInstanceV2ListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssessedSqlInstanceV2ListResult)} does not support writing '{options.Format}' format."); + } + } + + AssessedSqlInstanceV2ListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssessedSqlInstanceV2ListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssessedSqlInstanceV2ListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceV2ListResult.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceV2ListResult.cs new file mode 100644 index 000000000000..b5332044320a --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlInstanceV2ListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The response of a AssessedSqlInstanceV2 list operation. + internal partial class AssessedSqlInstanceV2ListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The AssessedSqlInstanceV2 items on this page. + /// is null. + internal AssessedSqlInstanceV2ListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AssessedSqlInstanceV2 items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AssessedSqlInstanceV2ListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssessedSqlInstanceV2ListResult() + { + } + + /// The AssessedSqlInstanceV2 items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlMachineListResult.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlMachineListResult.Serialization.cs new file mode 100644 index 000000000000..1526cf2dbd1c --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlMachineListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class AssessedSqlMachineListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedSqlMachineListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssessedSqlMachineListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedSqlMachineListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssessedSqlMachineListResult(document.RootElement, options); + } + + internal static AssessedSqlMachineListResult DeserializeAssessedSqlMachineListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AssessedSqlMachineData.DeserializeAssessedSqlMachineData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssessedSqlMachineListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssessedSqlMachineListResult)} does not support writing '{options.Format}' format."); + } + } + + AssessedSqlMachineListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssessedSqlMachineListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssessedSqlMachineListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlMachineListResult.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlMachineListResult.cs new file mode 100644 index 000000000000..80739c856ab0 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlMachineListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The response of a AssessedSqlMachine list operation. + internal partial class AssessedSqlMachineListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The AssessedSqlMachine items on this page. + /// is null. + internal AssessedSqlMachineListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AssessedSqlMachine items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AssessedSqlMachineListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssessedSqlMachineListResult() + { + } + + /// The AssessedSqlMachine items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlRecommendedEntityListResult.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlRecommendedEntityListResult.Serialization.cs new file mode 100644 index 000000000000..f1c12a03a25a --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlRecommendedEntityListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class AssessedSqlRecommendedEntityListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedSqlRecommendedEntityListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssessedSqlRecommendedEntityListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessedSqlRecommendedEntityListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssessedSqlRecommendedEntityListResult(document.RootElement, options); + } + + internal static AssessedSqlRecommendedEntityListResult DeserializeAssessedSqlRecommendedEntityListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AssessedSqlRecommendedEntityData.DeserializeAssessedSqlRecommendedEntityData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssessedSqlRecommendedEntityListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssessedSqlRecommendedEntityListResult)} does not support writing '{options.Format}' format."); + } + } + + AssessedSqlRecommendedEntityListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssessedSqlRecommendedEntityListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssessedSqlRecommendedEntityListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlRecommendedEntityListResult.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlRecommendedEntityListResult.cs new file mode 100644 index 000000000000..3c751708f97e --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessedSqlRecommendedEntityListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The response of a AssessedSqlRecommendedEntity list operation. + internal partial class AssessedSqlRecommendedEntityListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The AssessedSqlRecommendedEntity items on this page. + /// is null. + internal AssessedSqlRecommendedEntityListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AssessedSqlRecommendedEntity items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AssessedSqlRecommendedEntityListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssessedSqlRecommendedEntityListResult() + { + } + + /// The AssessedSqlRecommendedEntity items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentEnvironmentType.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentEnvironmentType.cs new file mode 100644 index 000000000000..0bb4266b6476 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentEnvironmentType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AssessmentEnvironmentType. + public readonly partial struct AssessmentEnvironmentType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AssessmentEnvironmentType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ProductionValue = "Production"; + private const string TestValue = "Test"; + + /// Production. + public static AssessmentEnvironmentType Production { get; } = new AssessmentEnvironmentType(ProductionValue); + /// Test. + public static AssessmentEnvironmentType Test { get; } = new AssessmentEnvironmentType(TestValue); + /// Determines if two values are the same. + public static bool operator ==(AssessmentEnvironmentType left, AssessmentEnvironmentType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AssessmentEnvironmentType left, AssessmentEnvironmentType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AssessmentEnvironmentType(string value) => new AssessmentEnvironmentType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AssessmentEnvironmentType other && Equals(other); + /// + public bool Equals(AssessmentEnvironmentType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentErrorSummary.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentErrorSummary.Serialization.cs new file mode 100644 index 000000000000..2a2c198aa9a9 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentErrorSummary.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class AssessmentErrorSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessmentErrorSummary)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(AssessmentType)) + { + writer.WritePropertyName("assessmentType"u8); + writer.WriteStringValue(AssessmentType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Count)) + { + writer.WritePropertyName("count"u8); + writer.WriteNumberValue(Count.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssessmentErrorSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessmentErrorSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssessmentErrorSummary(document.RootElement, options); + } + + internal static AssessmentErrorSummary DeserializeAssessmentErrorSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AssessmentType? assessmentType = default; + int? count = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("assessmentType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assessmentType = new AssessmentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssessmentErrorSummary(assessmentType, count, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssessmentErrorSummary)} does not support writing '{options.Format}' format."); + } + } + + AssessmentErrorSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssessmentErrorSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssessmentErrorSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentErrorSummary.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentErrorSummary.cs new file mode 100644 index 000000000000..aa9ecd46dfad --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentErrorSummary.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Error summary containing affected entities for each type of assessment. + public partial class AssessmentErrorSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal AssessmentErrorSummary() + { + } + + /// Initializes a new instance of . + /// Gets the assessment type. + /// Gets the affected entity count. + /// Keeps track of any properties unknown to the library. + internal AssessmentErrorSummary(AssessmentType? assessmentType, int? count, IDictionary serializedAdditionalRawData) + { + AssessmentType = assessmentType; + Count = count; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the assessment type. + public AssessmentType? AssessmentType { get; } + /// Gets the affected entity count. + public int? Count { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentListResult.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentListResult.Serialization.cs new file mode 100644 index 000000000000..06b1828c29c8 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class AssessmentListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessmentListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssessmentListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessmentListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssessmentListResult(document.RootElement, options); + } + + internal static AssessmentListResult DeserializeAssessmentListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MigrationAssessmentAssessmentData.DeserializeMigrationAssessmentAssessmentData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssessmentListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssessmentListResult)} does not support writing '{options.Format}' format."); + } + } + + AssessmentListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssessmentListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssessmentListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentListResult.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentListResult.cs new file mode 100644 index 000000000000..75090c241969 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The response of a Assessment list operation. + internal partial class AssessmentListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The Assessment items on this page. + /// is null. + internal AssessmentListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Assessment items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AssessmentListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssessmentListResult() + { + } + + /// The Assessment items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentOptionsListResult.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentOptionsListResult.Serialization.cs new file mode 100644 index 000000000000..461926128431 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentOptionsListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class AssessmentOptionsListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessmentOptionsListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssessmentOptionsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessmentOptionsListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssessmentOptionsListResult(document.RootElement, options); + } + + internal static AssessmentOptionsListResult DeserializeAssessmentOptionsListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MigrationAssessmentAssessmentOptionData.DeserializeMigrationAssessmentAssessmentOptionData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssessmentOptionsListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssessmentOptionsListResult)} does not support writing '{options.Format}' format."); + } + } + + AssessmentOptionsListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssessmentOptionsListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssessmentOptionsListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentOptionsListResult.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentOptionsListResult.cs new file mode 100644 index 000000000000..a9e0dfc1f96d --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentOptionsListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The response of a AssessmentOptions list operation. + internal partial class AssessmentOptionsListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The AssessmentOptions items on this page. + /// is null. + internal AssessmentOptionsListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AssessmentOptions items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AssessmentOptionsListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssessmentOptionsListResult() + { + } + + /// The AssessmentOptions items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentProjectListResult.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentProjectListResult.Serialization.cs new file mode 100644 index 000000000000..750742796acc --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentProjectListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class AssessmentProjectListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessmentProjectListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssessmentProjectListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessmentProjectListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssessmentProjectListResult(document.RootElement, options); + } + + internal static AssessmentProjectListResult DeserializeAssessmentProjectListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MigrationAssessmentAssessmentProjectData.DeserializeMigrationAssessmentAssessmentProjectData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssessmentProjectListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssessmentProjectListResult)} does not support writing '{options.Format}' format."); + } + } + + AssessmentProjectListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssessmentProjectListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssessmentProjectListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentProjectListResult.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentProjectListResult.cs new file mode 100644 index 000000000000..61e5884770b1 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentProjectListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The response of a AssessmentProject list operation. + internal partial class AssessmentProjectListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The AssessmentProject items on this page. + /// is null. + internal AssessmentProjectListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AssessmentProject items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AssessmentProjectListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssessmentProjectListResult() + { + } + + /// The AssessmentProject items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentProjectStatus.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentProjectStatus.cs new file mode 100644 index 000000000000..6485fc2be78f --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentProjectStatus.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Project Status. + public readonly partial struct AssessmentProjectStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AssessmentProjectStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ActiveValue = "Active"; + private const string InactiveValue = "Inactive"; + + /// Active Status. + public static AssessmentProjectStatus Active { get; } = new AssessmentProjectStatus(ActiveValue); + /// Inactive Status. + public static AssessmentProjectStatus Inactive { get; } = new AssessmentProjectStatus(InactiveValue); + /// Determines if two values are the same. + public static bool operator ==(AssessmentProjectStatus left, AssessmentProjectStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AssessmentProjectStatus left, AssessmentProjectStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AssessmentProjectStatus(string value) => new AssessmentProjectStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AssessmentProjectStatus other && Equals(other); + /// + public bool Equals(AssessmentProjectStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentProjectSummaryListResult.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentProjectSummaryListResult.Serialization.cs new file mode 100644 index 000000000000..a15c22626541 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentProjectSummaryListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class AssessmentProjectSummaryListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessmentProjectSummaryListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssessmentProjectSummaryListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessmentProjectSummaryListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssessmentProjectSummaryListResult(document.RootElement, options); + } + + internal static AssessmentProjectSummaryListResult DeserializeAssessmentProjectSummaryListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MigrationAssessmentAssessmentProjectSummaryData.DeserializeMigrationAssessmentAssessmentProjectSummaryData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssessmentProjectSummaryListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssessmentProjectSummaryListResult)} does not support writing '{options.Format}' format."); + } + } + + AssessmentProjectSummaryListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssessmentProjectSummaryListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssessmentProjectSummaryListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentProjectSummaryListResult.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentProjectSummaryListResult.cs new file mode 100644 index 000000000000..8ff4c168c52e --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentProjectSummaryListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The response of a AssessmentProjectSummary list operation. + internal partial class AssessmentProjectSummaryListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The AssessmentProjectSummary items on this page. + /// is null. + internal AssessmentProjectSummaryListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AssessmentProjectSummary items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AssessmentProjectSummaryListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssessmentProjectSummaryListResult() + { + } + + /// The AssessmentProjectSummary items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentReportDownloadUri.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentReportDownloadUri.Serialization.cs new file mode 100644 index 000000000000..c4185d88542d --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentReportDownloadUri.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class AssessmentReportDownloadUri : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessmentReportDownloadUri)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("assessmentReportUrl"u8); + writer.WriteStringValue(AssessmentReportUri.AbsoluteUri); + } + if (options.Format != "W") + { + writer.WritePropertyName("expirationTime"u8); + writer.WriteStringValue(ExpireOn, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AssessmentReportDownloadUri IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssessmentReportDownloadUri)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssessmentReportDownloadUri(document.RootElement, options); + } + + internal static AssessmentReportDownloadUri DeserializeAssessmentReportDownloadUri(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri assessmentReportUrl = default; + DateTimeOffset expirationTime = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("assessmentReportUrl"u8)) + { + assessmentReportUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("expirationTime"u8)) + { + expirationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssessmentReportDownloadUri(assessmentReportUrl, expirationTime, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssessmentReportDownloadUri)} does not support writing '{options.Format}' format."); + } + } + + AssessmentReportDownloadUri IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssessmentReportDownloadUri(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssessmentReportDownloadUri)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentReportDownloadUri.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentReportDownloadUri.cs new file mode 100644 index 000000000000..e192605c2b47 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentReportDownloadUri.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Data model of Download URL for assessment report. + public partial class AssessmentReportDownloadUri + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Hyperlink to download report. + /// Expiry date of download url. + internal AssessmentReportDownloadUri(Uri assessmentReportUri, DateTimeOffset expireOn) + { + AssessmentReportUri = assessmentReportUri; + ExpireOn = expireOn; + } + + /// Initializes a new instance of . + /// Hyperlink to download report. + /// Expiry date of download url. + /// Keeps track of any properties unknown to the library. + internal AssessmentReportDownloadUri(Uri assessmentReportUri, DateTimeOffset expireOn, IDictionary serializedAdditionalRawData) + { + AssessmentReportUri = assessmentReportUri; + ExpireOn = expireOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssessmentReportDownloadUri() + { + } + + /// Hyperlink to download report. + public Uri AssessmentReportUri { get; } + /// Expiry date of download url. + public DateTimeOffset ExpireOn { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentSizingCriterion.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentSizingCriterion.cs new file mode 100644 index 000000000000..ee6c86c00e1f --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentSizingCriterion.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Assessment Sizing Criteria. + public readonly partial struct AssessmentSizingCriterion : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AssessmentSizingCriterion(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PerformanceBasedValue = "PerformanceBased"; + private const string AsOnPremisesValue = "AsOnPremises"; + + /// Performance Data based Sizing. + public static AssessmentSizingCriterion PerformanceBased { get; } = new AssessmentSizingCriterion(PerformanceBasedValue); + /// As On Premises or Static Data based Sizing. + public static AssessmentSizingCriterion AsOnPremises { get; } = new AssessmentSizingCriterion(AsOnPremisesValue); + /// Determines if two values are the same. + public static bool operator ==(AssessmentSizingCriterion left, AssessmentSizingCriterion right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AssessmentSizingCriterion left, AssessmentSizingCriterion right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AssessmentSizingCriterion(string value) => new AssessmentSizingCriterion(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AssessmentSizingCriterion other && Equals(other); + /// + public bool Equals(AssessmentSizingCriterion other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentStage.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentStage.cs new file mode 100644 index 000000000000..d32a977ec38e --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentStage.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AssessmentStage. + public readonly partial struct AssessmentStage : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AssessmentStage(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InProgressValue = "InProgress"; + private const string UnderReviewValue = "UnderReview"; + private const string ApprovedValue = "Approved"; + + /// InProgress. + public static AssessmentStage InProgress { get; } = new AssessmentStage(InProgressValue); + /// UnderReview. + public static AssessmentStage UnderReview { get; } = new AssessmentStage(UnderReviewValue); + /// Approved. + public static AssessmentStage Approved { get; } = new AssessmentStage(ApprovedValue); + /// Determines if two values are the same. + public static bool operator ==(AssessmentStage left, AssessmentStage right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AssessmentStage left, AssessmentStage right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AssessmentStage(string value) => new AssessmentStage(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AssessmentStage other && Equals(other); + /// + public bool Equals(AssessmentStage other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentStatus.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentStatus.cs new file mode 100644 index 000000000000..c55a0dc95761 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentStatus.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Assessment Status. + public readonly partial struct AssessmentStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AssessmentStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CreatedValue = "Created"; + private const string UpdatedValue = "Updated"; + private const string RunningValue = "Running"; + private const string CompletedValue = "Completed"; + private const string InvalidValue = "Invalid"; + private const string OutOfSyncValue = "OutOfSync"; + private const string OutDatedValue = "OutDated"; + private const string DeletedValue = "Deleted"; + + /// Assessment is Created. + public static AssessmentStatus Created { get; } = new AssessmentStatus(CreatedValue); + /// Assessment is Updated. + public static AssessmentStatus Updated { get; } = new AssessmentStatus(UpdatedValue); + /// Assessment is currently running. + public static AssessmentStatus Running { get; } = new AssessmentStatus(RunningValue); + /// Assessment is Completed or Ready. + public static AssessmentStatus Completed { get; } = new AssessmentStatus(CompletedValue); + /// Assessment is Failed i.e. it is now invalid. + public static AssessmentStatus Invalid { get; } = new AssessmentStatus(InvalidValue); + /// Assessment is Out of Sync. + public static AssessmentStatus OutOfSync { get; } = new AssessmentStatus(OutOfSyncValue); + /// Assessment is Out Dated. + public static AssessmentStatus OutDated { get; } = new AssessmentStatus(OutDatedValue); + /// Assessment is Deleted. + public static AssessmentStatus Deleted { get; } = new AssessmentStatus(DeletedValue); + /// Determines if two values are the same. + public static bool operator ==(AssessmentStatus left, AssessmentStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AssessmentStatus left, AssessmentStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AssessmentStatus(string value) => new AssessmentStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AssessmentStatus other && Equals(other); + /// + public bool Equals(AssessmentStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentTimeRange.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentTimeRange.cs new file mode 100644 index 000000000000..b28537898a98 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentTimeRange.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AssessmentTimeRange. + public readonly partial struct AssessmentTimeRange : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AssessmentTimeRange(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DayValue = "Day"; + private const string WeekValue = "Week"; + private const string MonthValue = "Month"; + private const string CustomValue = "Custom"; + + /// Day. + public static AssessmentTimeRange Day { get; } = new AssessmentTimeRange(DayValue); + /// Week. + public static AssessmentTimeRange Week { get; } = new AssessmentTimeRange(WeekValue); + /// Month. + public static AssessmentTimeRange Month { get; } = new AssessmentTimeRange(MonthValue); + /// Custom. + public static AssessmentTimeRange Custom { get; } = new AssessmentTimeRange(CustomValue); + /// Determines if two values are the same. + public static bool operator ==(AssessmentTimeRange left, AssessmentTimeRange right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AssessmentTimeRange left, AssessmentTimeRange right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AssessmentTimeRange(string value) => new AssessmentTimeRange(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AssessmentTimeRange other && Equals(other); + /// + public bool Equals(AssessmentTimeRange other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentType.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentType.cs new file mode 100644 index 000000000000..f61d47687d8f --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AssessmentType.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AssessmentType. + public readonly partial struct AssessmentType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AssessmentType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string MachineAssessmentValue = "MachineAssessment"; + private const string AvsAssessmentValue = "AvsAssessment"; + private const string SqlAssessmentValue = "SqlAssessment"; + private const string WebAppAssessmentValue = "WebAppAssessment"; + + /// Unknown. + public static AssessmentType Unknown { get; } = new AssessmentType(UnknownValue); + /// MachineAssessment. + public static AssessmentType MachineAssessment { get; } = new AssessmentType(MachineAssessmentValue); + /// AvsAssessment. + public static AssessmentType AvsAssessment { get; } = new AssessmentType(AvsAssessmentValue); + /// SqlAssessment. + public static AssessmentType SqlAssessment { get; } = new AssessmentType(SqlAssessmentValue); + /// WebAppAssessment. + public static AssessmentType WebAppAssessment { get; } = new AssessmentType(WebAppAssessmentValue); + /// Determines if two values are the same. + public static bool operator ==(AssessmentType left, AssessmentType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AssessmentType left, AssessmentType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AssessmentType(string value) => new AssessmentType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AssessmentType other && Equals(other); + /// + public bool Equals(AssessmentType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AsyncCommitModeIntent.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AsyncCommitModeIntent.cs new file mode 100644 index 000000000000..c07b17b722f1 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AsyncCommitModeIntent.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AsyncCommitModeIntent. + public readonly partial struct AsyncCommitModeIntent : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AsyncCommitModeIntent(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string HighAvailabilityValue = "HighAvailability"; + private const string DisasterRecoveryValue = "DisasterRecovery"; + + /// None. + public static AsyncCommitModeIntent None { get; } = new AsyncCommitModeIntent(NoneValue); + /// HighAvailability. + public static AsyncCommitModeIntent HighAvailability { get; } = new AsyncCommitModeIntent(HighAvailabilityValue); + /// DisasterRecovery. + public static AsyncCommitModeIntent DisasterRecovery { get; } = new AsyncCommitModeIntent(DisasterRecoveryValue); + /// Determines if two values are the same. + public static bool operator ==(AsyncCommitModeIntent left, AsyncCommitModeIntent right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AsyncCommitModeIntent left, AsyncCommitModeIntent right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AsyncCommitModeIntent(string value) => new AsyncCommitModeIntent(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AsyncCommitModeIntent other && Equals(other); + /// + public bool Equals(AsyncCommitModeIntent other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessedDisk.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessedDisk.Serialization.cs new file mode 100644 index 000000000000..826d6015d3fd --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessedDisk.Serialization.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class AvsAssessedDisk : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsAssessedDisk)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (options.Format != "W" && Optional.IsDefined(GigabytesProvisioned)) + { + writer.WritePropertyName("gigabytesProvisioned"u8); + writer.WriteNumberValue(GigabytesProvisioned.Value); + } + if (options.Format != "W" && Optional.IsDefined(MegabytesPerSecondOfRead)) + { + writer.WritePropertyName("megabytesPerSecondOfRead"u8); + writer.WriteNumberValue(MegabytesPerSecondOfRead.Value); + } + if (options.Format != "W" && Optional.IsDefined(MegabytesPerSecondOfWrite)) + { + writer.WritePropertyName("megabytesPerSecondOfWrite"u8); + writer.WriteNumberValue(MegabytesPerSecondOfWrite.Value); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfReadOperationsPerSecond)) + { + writer.WritePropertyName("numberOfReadOperationsPerSecond"u8); + writer.WriteNumberValue(NumberOfReadOperationsPerSecond.Value); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfWriteOperationsPerSecond)) + { + writer.WritePropertyName("numberOfWriteOperationsPerSecond"u8); + writer.WriteNumberValue(NumberOfWriteOperationsPerSecond.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AvsAssessedDisk IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsAssessedDisk)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsAssessedDisk(document.RootElement, options); + } + + internal static AvsAssessedDisk DeserializeAvsAssessedDisk(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string displayName = default; + double? gigabytesProvisioned = default; + double? megabytesPerSecondOfRead = default; + double? megabytesPerSecondOfWrite = default; + double? numberOfReadOperationsPerSecond = default; + double? numberOfWriteOperationsPerSecond = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("gigabytesProvisioned"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gigabytesProvisioned = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("megabytesPerSecondOfRead"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + megabytesPerSecondOfRead = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("megabytesPerSecondOfWrite"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + megabytesPerSecondOfWrite = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("numberOfReadOperationsPerSecond"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfReadOperationsPerSecond = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("numberOfWriteOperationsPerSecond"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfWriteOperationsPerSecond = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AvsAssessedDisk( + name, + displayName, + gigabytesProvisioned, + megabytesPerSecondOfRead, + megabytesPerSecondOfWrite, + numberOfReadOperationsPerSecond, + numberOfWriteOperationsPerSecond, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AvsAssessedDisk)} does not support writing '{options.Format}' format."); + } + } + + AvsAssessedDisk IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAvsAssessedDisk(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsAssessedDisk)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessedDisk.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessedDisk.cs new file mode 100644 index 000000000000..30274bac4dd1 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessedDisk.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// AVS assessed disk web model class. + public partial class AvsAssessedDisk + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal AvsAssessedDisk() + { + } + + /// Initializes a new instance of . + /// Gets the ID of the disk. + /// Gets the display name of the disk. + /// Gigabytes Provisioned for a disk in private data center. + /// Disk Read Throughput in MB/s. + /// Disk Write Throughput in MB/s. + /// Read Operations per second. + /// Write Operations per second. + /// Keeps track of any properties unknown to the library. + internal AvsAssessedDisk(string name, string displayName, double? gigabytesProvisioned, double? megabytesPerSecondOfRead, double? megabytesPerSecondOfWrite, double? numberOfReadOperationsPerSecond, double? numberOfWriteOperationsPerSecond, IDictionary serializedAdditionalRawData) + { + Name = name; + DisplayName = displayName; + GigabytesProvisioned = gigabytesProvisioned; + MegabytesPerSecondOfRead = megabytesPerSecondOfRead; + MegabytesPerSecondOfWrite = megabytesPerSecondOfWrite; + NumberOfReadOperationsPerSecond = numberOfReadOperationsPerSecond; + NumberOfWriteOperationsPerSecond = numberOfWriteOperationsPerSecond; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the ID of the disk. + public string Name { get; } + /// Gets the display name of the disk. + public string DisplayName { get; } + /// Gigabytes Provisioned for a disk in private data center. + public double? GigabytesProvisioned { get; } + /// Disk Read Throughput in MB/s. + public double? MegabytesPerSecondOfRead { get; } + /// Disk Write Throughput in MB/s. + public double? MegabytesPerSecondOfWrite { get; } + /// Read Operations per second. + public double? NumberOfReadOperationsPerSecond { get; } + /// Write Operations per second. + public double? NumberOfWriteOperationsPerSecond { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessedMachineListResult.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessedMachineListResult.Serialization.cs new file mode 100644 index 000000000000..d3d4440c0a82 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessedMachineListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class AvsAssessedMachineListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsAssessedMachineListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AvsAssessedMachineListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsAssessedMachineListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsAssessedMachineListResult(document.RootElement, options); + } + + internal static AvsAssessedMachineListResult DeserializeAvsAssessedMachineListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MigrationAssessmentAvsAssessedMachineData.DeserializeMigrationAssessmentAvsAssessedMachineData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AvsAssessedMachineListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AvsAssessedMachineListResult)} does not support writing '{options.Format}' format."); + } + } + + AvsAssessedMachineListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAvsAssessedMachineListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsAssessedMachineListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessedMachineListResult.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessedMachineListResult.cs new file mode 100644 index 000000000000..f43fe20b2c55 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessedMachineListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The response of a AvsAssessedMachine list operation. + internal partial class AvsAssessedMachineListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The AvsAssessedMachine items on this page. + /// is null. + internal AvsAssessedMachineListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AvsAssessedMachine items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AvsAssessedMachineListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AvsAssessedMachineListResult() + { + } + + /// The AvsAssessedMachine items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessedNetworkAdapter.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessedNetworkAdapter.Serialization.cs new file mode 100644 index 000000000000..063c1336b093 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessedNetworkAdapter.Serialization.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class AvsAssessedNetworkAdapter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsAssessedNetworkAdapter)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(MacAddress)) + { + writer.WritePropertyName("macAddress"u8); + writer.WriteStringValue(MacAddress); + } + if (options.Format != "W" && Optional.IsCollectionDefined(IPAddresses)) + { + writer.WritePropertyName("ipAddresses"u8); + writer.WriteStartArray(); + foreach (var item in IPAddresses) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (options.Format != "W" && Optional.IsDefined(MegabytesPerSecondReceived)) + { + writer.WritePropertyName("megabytesPerSecondReceived"u8); + writer.WriteNumberValue(MegabytesPerSecondReceived.Value); + } + if (options.Format != "W" && Optional.IsDefined(MegabytesPerSecondTransmitted)) + { + writer.WritePropertyName("megabytesPerSecondTransmitted"u8); + writer.WriteNumberValue(MegabytesPerSecondTransmitted.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AvsAssessedNetworkAdapter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsAssessedNetworkAdapter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsAssessedNetworkAdapter(document.RootElement, options); + } + + internal static AvsAssessedNetworkAdapter DeserializeAvsAssessedNetworkAdapter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string macAddress = default; + IReadOnlyList ipAddresses = default; + string displayName = default; + double? megabytesPerSecondReceived = default; + double? megabytesPerSecondTransmitted = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("macAddress"u8)) + { + macAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipAddresses"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipAddresses = array; + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("megabytesPerSecondReceived"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + megabytesPerSecondReceived = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("megabytesPerSecondTransmitted"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + megabytesPerSecondTransmitted = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AvsAssessedNetworkAdapter( + macAddress, + ipAddresses ?? new ChangeTrackingList(), + displayName, + megabytesPerSecondReceived, + megabytesPerSecondTransmitted, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AvsAssessedNetworkAdapter)} does not support writing '{options.Format}' format."); + } + } + + AvsAssessedNetworkAdapter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAvsAssessedNetworkAdapter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsAssessedNetworkAdapter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessedNetworkAdapter.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessedNetworkAdapter.cs new file mode 100644 index 000000000000..13d0f789d701 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessedNetworkAdapter.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Second level object returned as part of AVS AssessedMachine REST resource. + public partial class AvsAssessedNetworkAdapter + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal AvsAssessedNetworkAdapter() + { + IPAddresses = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Mac address of the NIC. + /// IP V4 addresses for the machine. + /// Gets the display name of the network adapter. + /// + /// Gets the Received data for Network Adapter in MB/s. + /// This value is + /// the percentile of historical data based on options selected in Assessment. + /// + /// + /// Gets the Transmitted data for Network Adapter in MB/s. + /// This value + /// is the percentile of historical data based on options selected in Assessment. + /// + /// Keeps track of any properties unknown to the library. + internal AvsAssessedNetworkAdapter(string macAddress, IReadOnlyList ipAddresses, string displayName, double? megabytesPerSecondReceived, double? megabytesPerSecondTransmitted, IDictionary serializedAdditionalRawData) + { + MacAddress = macAddress; + IPAddresses = ipAddresses; + DisplayName = displayName; + MegabytesPerSecondReceived = megabytesPerSecondReceived; + MegabytesPerSecondTransmitted = megabytesPerSecondTransmitted; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Mac address of the NIC. + public string MacAddress { get; } + /// IP V4 addresses for the machine. + public IReadOnlyList IPAddresses { get; } + /// Gets the display name of the network adapter. + public string DisplayName { get; } + /// + /// Gets the Received data for Network Adapter in MB/s. + /// This value is + /// the percentile of historical data based on options selected in Assessment. + /// + public double? MegabytesPerSecondReceived { get; } + /// + /// Gets the Transmitted data for Network Adapter in MB/s. + /// This value + /// is the percentile of historical data based on options selected in Assessment. + /// + public double? MegabytesPerSecondTransmitted { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessmentListResult.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessmentListResult.Serialization.cs new file mode 100644 index 000000000000..2cfc0a0bc49a --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessmentListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class AvsAssessmentListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsAssessmentListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AvsAssessmentListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsAssessmentListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsAssessmentListResult(document.RootElement, options); + } + + internal static AvsAssessmentListResult DeserializeAvsAssessmentListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MigrationAssessmentAvsAssessmentData.DeserializeMigrationAssessmentAvsAssessmentData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AvsAssessmentListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AvsAssessmentListResult)} does not support writing '{options.Format}' format."); + } + } + + AvsAssessmentListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAvsAssessmentListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsAssessmentListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessmentListResult.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessmentListResult.cs new file mode 100644 index 000000000000..6750a12d97bc --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessmentListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The response of a AvsAssessment list operation. + internal partial class AvsAssessmentListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The AvsAssessment items on this page. + /// is null. + internal AvsAssessmentListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AvsAssessment items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AvsAssessmentListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AvsAssessmentListResult() + { + } + + /// The AvsAssessment items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessmentOptionsListResult.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessmentOptionsListResult.Serialization.cs new file mode 100644 index 000000000000..93dcbcc23ce2 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessmentOptionsListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class AvsAssessmentOptionsListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsAssessmentOptionsListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AvsAssessmentOptionsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsAssessmentOptionsListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsAssessmentOptionsListResult(document.RootElement, options); + } + + internal static AvsAssessmentOptionsListResult DeserializeAvsAssessmentOptionsListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MigrationAssessmentAvsAssessmentOptionData.DeserializeMigrationAssessmentAvsAssessmentOptionData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AvsAssessmentOptionsListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AvsAssessmentOptionsListResult)} does not support writing '{options.Format}' format."); + } + } + + AvsAssessmentOptionsListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAvsAssessmentOptionsListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsAssessmentOptionsListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessmentOptionsListResult.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessmentOptionsListResult.cs new file mode 100644 index 000000000000..998b9f504652 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsAssessmentOptionsListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The response of a AvsAssessmentOptions list operation. + internal partial class AvsAssessmentOptionsListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The AvsAssessmentOptions items on this page. + /// is null. + internal AvsAssessmentOptionsListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AvsAssessmentOptions items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AvsAssessmentOptionsListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AvsAssessmentOptionsListResult() + { + } + + /// The AvsAssessmentOptions items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsNodeType.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsNodeType.cs new file mode 100644 index 000000000000..52465602dcb4 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsNodeType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AvsNodeType. + public readonly partial struct AvsNodeType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AvsNodeType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string AV36Value = "AV36"; + + /// Unknown. + public static AvsNodeType Unknown { get; } = new AvsNodeType(UnknownValue); + /// AV36. + public static AvsNodeType AV36 { get; } = new AvsNodeType(AV36Value); + /// Determines if two values are the same. + public static bool operator ==(AvsNodeType left, AvsNodeType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AvsNodeType left, AvsNodeType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AvsNodeType(string value) => new AvsNodeType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AvsNodeType other && Equals(other); + /// + public bool Equals(AvsNodeType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsSkuConfig.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsSkuConfig.Serialization.cs new file mode 100644 index 000000000000..83dba1da8509 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsSkuConfig.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class AvsSkuConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsSkuConfig)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(NodeType)) + { + writer.WritePropertyName("nodeType"u8); + writer.WriteStringValue(NodeType.Value.ToString()); + } + if (Optional.IsCollectionDefined(TargetLocations)) + { + writer.WritePropertyName("targetLocations"u8); + writer.WriteStartArray(); + foreach (var item in TargetLocations) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AvsSkuConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvsSkuConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvsSkuConfig(document.RootElement, options); + } + + internal static AvsSkuConfig DeserializeAvsSkuConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AvsNodeType? nodeType = default; + IList targetLocations = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nodeType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nodeType = new AvsNodeType(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetLocations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new AzureLocation(item.GetString())); + } + targetLocations = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AvsSkuConfig(nodeType, targetLocations ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AvsSkuConfig)} does not support writing '{options.Format}' format."); + } + } + + AvsSkuConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAvsSkuConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvsSkuConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsSkuConfig.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsSkuConfig.cs new file mode 100644 index 000000000000..3bb9fe4a4c27 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsSkuConfig.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// AVS SKU specific options. + public partial class AvsSkuConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AvsSkuConfig() + { + TargetLocations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// AVS Node type. + /// List of locations where this node type is available. + /// Keeps track of any properties unknown to the library. + internal AvsSkuConfig(AvsNodeType? nodeType, IList targetLocations, IDictionary serializedAdditionalRawData) + { + NodeType = nodeType; + TargetLocations = targetLocations; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// AVS Node type. + public AvsNodeType? NodeType { get; set; } + /// List of locations where this node type is available. + public IList TargetLocations { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsSuitabilityExplanation.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsSuitabilityExplanation.cs new file mode 100644 index 000000000000..c49e34d10a49 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsSuitabilityExplanation.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AvsSuitabilityExplanation. + public readonly partial struct AvsSuitabilityExplanation : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AvsSuitabilityExplanation(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string NotApplicableValue = "NotApplicable"; + private const string UnsupportedLocationForSelectedNodeValue = "UnsupportedLocationForSelectedNode"; + + /// Unknown. + public static AvsSuitabilityExplanation Unknown { get; } = new AvsSuitabilityExplanation(UnknownValue); + /// NotApplicable. + public static AvsSuitabilityExplanation NotApplicable { get; } = new AvsSuitabilityExplanation(NotApplicableValue); + /// UnsupportedLocationForSelectedNode. + public static AvsSuitabilityExplanation UnsupportedLocationForSelectedNode { get; } = new AvsSuitabilityExplanation(UnsupportedLocationForSelectedNodeValue); + /// Determines if two values are the same. + public static bool operator ==(AvsSuitabilityExplanation left, AvsSuitabilityExplanation right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AvsSuitabilityExplanation left, AvsSuitabilityExplanation right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AvsSuitabilityExplanation(string value) => new AvsSuitabilityExplanation(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AvsSuitabilityExplanation other && Equals(other); + /// + public bool Equals(AvsSuitabilityExplanation other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsVmSuitabilityDetail.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsVmSuitabilityDetail.cs new file mode 100644 index 000000000000..1908c34ed3aa --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsVmSuitabilityDetail.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AvsVmSuitabilityDetail. + public readonly partial struct AvsVmSuitabilityDetail : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AvsVmSuitabilityDetail(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string PercentageOfCoresUtilizedMissingValue = "PercentageOfCoresUtilizedMissing"; + private const string PercentageOfMemoryUtilizedMissingValue = "PercentageOfMemoryUtilizedMissing"; + private const string PercentageOfCoresUtilizedOutOfRangeValue = "PercentageOfCoresUtilizedOutOfRange"; + private const string PercentageOfMemoryUtilizedOutOfRangeValue = "PercentageOfMemoryUtilizedOutOfRange"; + private const string PercentageOfStorageUtilizedOutOfRangeValue = "PercentageOfStorageUtilizedOutOfRange"; + + /// None. + public static AvsVmSuitabilityDetail None { get; } = new AvsVmSuitabilityDetail(NoneValue); + /// PercentageOfCoresUtilizedMissing. + public static AvsVmSuitabilityDetail PercentageOfCoresUtilizedMissing { get; } = new AvsVmSuitabilityDetail(PercentageOfCoresUtilizedMissingValue); + /// PercentageOfMemoryUtilizedMissing. + public static AvsVmSuitabilityDetail PercentageOfMemoryUtilizedMissing { get; } = new AvsVmSuitabilityDetail(PercentageOfMemoryUtilizedMissingValue); + /// PercentageOfCoresUtilizedOutOfRange. + public static AvsVmSuitabilityDetail PercentageOfCoresUtilizedOutOfRange { get; } = new AvsVmSuitabilityDetail(PercentageOfCoresUtilizedOutOfRangeValue); + /// PercentageOfMemoryUtilizedOutOfRange. + public static AvsVmSuitabilityDetail PercentageOfMemoryUtilizedOutOfRange { get; } = new AvsVmSuitabilityDetail(PercentageOfMemoryUtilizedOutOfRangeValue); + /// PercentageOfStorageUtilizedOutOfRange. + public static AvsVmSuitabilityDetail PercentageOfStorageUtilizedOutOfRange { get; } = new AvsVmSuitabilityDetail(PercentageOfStorageUtilizedOutOfRangeValue); + /// Determines if two values are the same. + public static bool operator ==(AvsVmSuitabilityDetail left, AvsVmSuitabilityDetail right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AvsVmSuitabilityDetail left, AvsVmSuitabilityDetail right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AvsVmSuitabilityDetail(string value) => new AvsVmSuitabilityDetail(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AvsVmSuitabilityDetail other && Equals(other); + /// + public bool Equals(AvsVmSuitabilityDetail other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsVmSuitabilityExplanation.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsVmSuitabilityExplanation.cs new file mode 100644 index 000000000000..6a5a8054052e --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AvsVmSuitabilityExplanation.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AvsVmSuitabilityExplanation. + public readonly partial struct AvsVmSuitabilityExplanation : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AvsVmSuitabilityExplanation(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string NotApplicableValue = "NotApplicable"; + private const string IPV6NotSupportedValue = "IpV6NotSupported"; + private const string UnsupportedOperatingSystemValue = "UnsupportedOperatingSystem"; + + /// Unknown. + public static AvsVmSuitabilityExplanation Unknown { get; } = new AvsVmSuitabilityExplanation(UnknownValue); + /// NotApplicable. + public static AvsVmSuitabilityExplanation NotApplicable { get; } = new AvsVmSuitabilityExplanation(NotApplicableValue); + /// IpV6NotSupported. + public static AvsVmSuitabilityExplanation IPV6NotSupported { get; } = new AvsVmSuitabilityExplanation(IPV6NotSupportedValue); + /// UnsupportedOperatingSystem. + public static AvsVmSuitabilityExplanation UnsupportedOperatingSystem { get; } = new AvsVmSuitabilityExplanation(UnsupportedOperatingSystemValue); + /// Determines if two values are the same. + public static bool operator ==(AvsVmSuitabilityExplanation left, AvsVmSuitabilityExplanation right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AvsVmSuitabilityExplanation left, AvsVmSuitabilityExplanation right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AvsVmSuitabilityExplanation(string value) => new AvsVmSuitabilityExplanation(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AvsVmSuitabilityExplanation other && Equals(other); + /// + public bool Equals(AvsVmSuitabilityExplanation other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureCurrency.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureCurrency.cs new file mode 100644 index 000000000000..29a99c8608fc --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureCurrency.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Currency for Azure. + public readonly partial struct AzureCurrency : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureCurrency(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string USDValue = "USD"; + private const string DKKValue = "DKK"; + private const string CADValue = "CAD"; + private const string IdRValue = "IDR"; + private const string JPYValue = "JPY"; + private const string KRWValue = "KRW"; + private const string NZDValue = "NZD"; + private const string NOKValue = "NOK"; + private const string RUBValue = "RUB"; + private const string SARValue = "SAR"; + private const string ZARValue = "ZAR"; + private const string SEKValue = "SEK"; + private const string TRYValue = "TRY"; + private const string GBPValue = "GBP"; + private const string MXNValue = "MXN"; + private const string MYRValue = "MYR"; + private const string INRValue = "INR"; + private const string HKDValue = "HKD"; + private const string BRLValue = "BRL"; + private const string TWDValue = "TWD"; + private const string EURValue = "EUR"; + private const string CHFValue = "CHF"; + private const string ARSValue = "ARS"; + private const string AUDValue = "AUD"; + private const string CNYValue = "CNY"; + + /// Unknown. + public static AzureCurrency Unknown { get; } = new AzureCurrency(UnknownValue); + /// USD. + public static AzureCurrency USD { get; } = new AzureCurrency(USDValue); + /// DKK. + public static AzureCurrency DKK { get; } = new AzureCurrency(DKKValue); + /// CAD. + public static AzureCurrency CAD { get; } = new AzureCurrency(CADValue); + /// IDR. + public static AzureCurrency IdR { get; } = new AzureCurrency(IdRValue); + /// JPY. + public static AzureCurrency JPY { get; } = new AzureCurrency(JPYValue); + /// KRW. + public static AzureCurrency KRW { get; } = new AzureCurrency(KRWValue); + /// NZD. + public static AzureCurrency NZD { get; } = new AzureCurrency(NZDValue); + /// NOK. + public static AzureCurrency NOK { get; } = new AzureCurrency(NOKValue); + /// RUB. + public static AzureCurrency RUB { get; } = new AzureCurrency(RUBValue); + /// SAR. + public static AzureCurrency SAR { get; } = new AzureCurrency(SARValue); + /// ZAR. + public static AzureCurrency ZAR { get; } = new AzureCurrency(ZARValue); + /// SEK. + public static AzureCurrency SEK { get; } = new AzureCurrency(SEKValue); + /// TRY. + public static AzureCurrency TRY { get; } = new AzureCurrency(TRYValue); + /// GBP. + public static AzureCurrency GBP { get; } = new AzureCurrency(GBPValue); + /// MXN. + public static AzureCurrency MXN { get; } = new AzureCurrency(MXNValue); + /// MYR. + public static AzureCurrency MYR { get; } = new AzureCurrency(MYRValue); + /// INR. + public static AzureCurrency INR { get; } = new AzureCurrency(INRValue); + /// HKD. + public static AzureCurrency HKD { get; } = new AzureCurrency(HKDValue); + /// BRL. + public static AzureCurrency BRL { get; } = new AzureCurrency(BRLValue); + /// TWD. + public static AzureCurrency TWD { get; } = new AzureCurrency(TWDValue); + /// EUR. + public static AzureCurrency EUR { get; } = new AzureCurrency(EURValue); + /// CHF. + public static AzureCurrency CHF { get; } = new AzureCurrency(CHFValue); + /// ARS. + public static AzureCurrency ARS { get; } = new AzureCurrency(ARSValue); + /// AUD. + public static AzureCurrency AUD { get; } = new AzureCurrency(AUDValue); + /// CNY. + public static AzureCurrency CNY { get; } = new AzureCurrency(CNYValue); + /// Determines if two values are the same. + public static bool operator ==(AzureCurrency left, AzureCurrency right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureCurrency left, AzureCurrency right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureCurrency(string value) => new AzureCurrency(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureCurrency other && Equals(other); + /// + public bool Equals(AzureCurrency other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureDiskSize.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureDiskSize.cs new file mode 100644 index 000000000000..f168f2707cca --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureDiskSize.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AzureDiskSize. + public readonly partial struct AzureDiskSize : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureDiskSize(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string StandardS4Value = "Standard_S4"; + private const string StandardS6Value = "Standard_S6"; + private const string StandardS10Value = "Standard_S10"; + private const string StandardS15Value = "Standard_S15"; + private const string StandardS20Value = "Standard_S20"; + private const string StandardS30Value = "Standard_S30"; + private const string StandardS40Value = "Standard_S40"; + private const string StandardS50Value = "Standard_S50"; + private const string StandardS60Value = "Standard_S60"; + private const string StandardS70Value = "Standard_S70"; + private const string StandardS80Value = "Standard_S80"; + private const string PremiumP4Value = "Premium_P4"; + private const string PremiumP6Value = "Premium_P6"; + private const string PremiumP10Value = "Premium_P10"; + private const string PremiumP15Value = "Premium_P15"; + private const string PremiumP20Value = "Premium_P20"; + private const string PremiumP30Value = "Premium_P30"; + private const string PremiumP40Value = "Premium_P40"; + private const string PremiumP50Value = "Premium_P50"; + private const string PremiumP60Value = "Premium_P60"; + private const string PremiumP70Value = "Premium_P70"; + private const string PremiumP80Value = "Premium_P80"; + private const string StandardSsdE10Value = "StandardSSD_E10"; + private const string StandardSsdE15Value = "StandardSSD_E15"; + private const string StandardSsdE20Value = "StandardSSD_E20"; + private const string StandardSsdE30Value = "StandardSSD_E30"; + private const string StandardSsdE40Value = "StandardSSD_E40"; + private const string StandardSsdE50Value = "StandardSSD_E50"; + private const string StandardSsdE60Value = "StandardSSD_E60"; + private const string StandardSsdE70Value = "StandardSSD_E70"; + private const string StandardSsdE80Value = "StandardSSD_E80"; + private const string StandardSsdE4Value = "StandardSSD_E4"; + private const string StandardSsdE6Value = "StandardSSD_E6"; + private const string StandardSsdE1Value = "StandardSSD_E1"; + private const string StandardSsdE2Value = "StandardSSD_E2"; + private const string StandardSsdE3Value = "StandardSSD_E3"; + private const string PremiumP1Value = "Premium_P1"; + private const string PremiumP2Value = "Premium_P2"; + private const string PremiumP3Value = "Premium_P3"; + private const string UltraValue = "Ultra"; + private const string PremiumV2Value = "PremiumV2"; + + /// Unknown. + public static AzureDiskSize Unknown { get; } = new AzureDiskSize(UnknownValue); + /// Standard_S4. + public static AzureDiskSize StandardS4 { get; } = new AzureDiskSize(StandardS4Value); + /// Standard_S6. + public static AzureDiskSize StandardS6 { get; } = new AzureDiskSize(StandardS6Value); + /// Standard_S10. + public static AzureDiskSize StandardS10 { get; } = new AzureDiskSize(StandardS10Value); + /// Standard_S15. + public static AzureDiskSize StandardS15 { get; } = new AzureDiskSize(StandardS15Value); + /// Standard_S20. + public static AzureDiskSize StandardS20 { get; } = new AzureDiskSize(StandardS20Value); + /// Standard_S30. + public static AzureDiskSize StandardS30 { get; } = new AzureDiskSize(StandardS30Value); + /// Standard_S40. + public static AzureDiskSize StandardS40 { get; } = new AzureDiskSize(StandardS40Value); + /// Standard_S50. + public static AzureDiskSize StandardS50 { get; } = new AzureDiskSize(StandardS50Value); + /// Standard_S60. + public static AzureDiskSize StandardS60 { get; } = new AzureDiskSize(StandardS60Value); + /// Standard_S70. + public static AzureDiskSize StandardS70 { get; } = new AzureDiskSize(StandardS70Value); + /// Standard_S80. + public static AzureDiskSize StandardS80 { get; } = new AzureDiskSize(StandardS80Value); + /// Premium_P4. + public static AzureDiskSize PremiumP4 { get; } = new AzureDiskSize(PremiumP4Value); + /// Premium_P6. + public static AzureDiskSize PremiumP6 { get; } = new AzureDiskSize(PremiumP6Value); + /// Premium_P10. + public static AzureDiskSize PremiumP10 { get; } = new AzureDiskSize(PremiumP10Value); + /// Premium_P15. + public static AzureDiskSize PremiumP15 { get; } = new AzureDiskSize(PremiumP15Value); + /// Premium_P20. + public static AzureDiskSize PremiumP20 { get; } = new AzureDiskSize(PremiumP20Value); + /// Premium_P30. + public static AzureDiskSize PremiumP30 { get; } = new AzureDiskSize(PremiumP30Value); + /// Premium_P40. + public static AzureDiskSize PremiumP40 { get; } = new AzureDiskSize(PremiumP40Value); + /// Premium_P50. + public static AzureDiskSize PremiumP50 { get; } = new AzureDiskSize(PremiumP50Value); + /// Premium_P60. + public static AzureDiskSize PremiumP60 { get; } = new AzureDiskSize(PremiumP60Value); + /// Premium_P70. + public static AzureDiskSize PremiumP70 { get; } = new AzureDiskSize(PremiumP70Value); + /// Premium_P80. + public static AzureDiskSize PremiumP80 { get; } = new AzureDiskSize(PremiumP80Value); + /// StandardSSD_E10. + public static AzureDiskSize StandardSsdE10 { get; } = new AzureDiskSize(StandardSsdE10Value); + /// StandardSSD_E15. + public static AzureDiskSize StandardSsdE15 { get; } = new AzureDiskSize(StandardSsdE15Value); + /// StandardSSD_E20. + public static AzureDiskSize StandardSsdE20 { get; } = new AzureDiskSize(StandardSsdE20Value); + /// StandardSSD_E30. + public static AzureDiskSize StandardSsdE30 { get; } = new AzureDiskSize(StandardSsdE30Value); + /// StandardSSD_E40. + public static AzureDiskSize StandardSsdE40 { get; } = new AzureDiskSize(StandardSsdE40Value); + /// StandardSSD_E50. + public static AzureDiskSize StandardSsdE50 { get; } = new AzureDiskSize(StandardSsdE50Value); + /// StandardSSD_E60. + public static AzureDiskSize StandardSsdE60 { get; } = new AzureDiskSize(StandardSsdE60Value); + /// StandardSSD_E70. + public static AzureDiskSize StandardSsdE70 { get; } = new AzureDiskSize(StandardSsdE70Value); + /// StandardSSD_E80. + public static AzureDiskSize StandardSsdE80 { get; } = new AzureDiskSize(StandardSsdE80Value); + /// StandardSSD_E4. + public static AzureDiskSize StandardSsdE4 { get; } = new AzureDiskSize(StandardSsdE4Value); + /// StandardSSD_E6. + public static AzureDiskSize StandardSsdE6 { get; } = new AzureDiskSize(StandardSsdE6Value); + /// StandardSSD_E1. + public static AzureDiskSize StandardSsdE1 { get; } = new AzureDiskSize(StandardSsdE1Value); + /// StandardSSD_E2. + public static AzureDiskSize StandardSsdE2 { get; } = new AzureDiskSize(StandardSsdE2Value); + /// StandardSSD_E3. + public static AzureDiskSize StandardSsdE3 { get; } = new AzureDiskSize(StandardSsdE3Value); + /// Premium_P1. + public static AzureDiskSize PremiumP1 { get; } = new AzureDiskSize(PremiumP1Value); + /// Premium_P2. + public static AzureDiskSize PremiumP2 { get; } = new AzureDiskSize(PremiumP2Value); + /// Premium_P3. + public static AzureDiskSize PremiumP3 { get; } = new AzureDiskSize(PremiumP3Value); + /// Ultra. + public static AzureDiskSize Ultra { get; } = new AzureDiskSize(UltraValue); + /// PremiumV2. + public static AzureDiskSize PremiumV2 { get; } = new AzureDiskSize(PremiumV2Value); + /// Determines if two values are the same. + public static bool operator ==(AzureDiskSize left, AzureDiskSize right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureDiskSize left, AzureDiskSize right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureDiskSize(string value) => new AzureDiskSize(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureDiskSize other && Equals(other); + /// + public bool Equals(AzureDiskSize other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureDiskSuitabilityDetail.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureDiskSuitabilityDetail.cs new file mode 100644 index 000000000000..9a21a9a4e97f --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureDiskSuitabilityDetail.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AzureDiskSuitabilityDetail. + public readonly partial struct AzureDiskSuitabilityDetail : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureDiskSuitabilityDetail(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string NumberOfReadOperationsPerSecondMissingValue = "NumberOfReadOperationsPerSecondMissing"; + private const string NumberOfWriteOperationsPerSecondMissingValue = "NumberOfWriteOperationsPerSecondMissing"; + private const string MegabytesPerSecondOfReadMissingValue = "MegabytesPerSecondOfReadMissing"; + private const string MegabytesPerSecondOfWriteMissingValue = "MegabytesPerSecondOfWriteMissing"; + private const string DiskGigabytesConsumedMissingValue = "DiskGigabytesConsumedMissing"; + private const string DiskGigabytesProvisionedMissingValue = "DiskGigabytesProvisionedMissing"; + private const string NumberOfReadOperationsPerSecondOutOfRangeValue = "NumberOfReadOperationsPerSecondOutOfRange"; + private const string NumberOfWriteOperationsPerSecondOutOfRangeValue = "NumberOfWriteOperationsPerSecondOutOfRange"; + private const string MegabytesPerSecondOfReadOutOfRangeValue = "MegabytesPerSecondOfReadOutOfRange"; + private const string MegabytesPerSecondOfWriteOutOfRangeValue = "MegabytesPerSecondOfWriteOutOfRange"; + private const string DiskGigabytesConsumedOutOfRangeValue = "DiskGigabytesConsumedOutOfRange"; + private const string DiskGigabytesProvisionedOutOfRangeValue = "DiskGigabytesProvisionedOutOfRange"; + + /// None. + public static AzureDiskSuitabilityDetail None { get; } = new AzureDiskSuitabilityDetail(NoneValue); + /// NumberOfReadOperationsPerSecondMissing. + public static AzureDiskSuitabilityDetail NumberOfReadOperationsPerSecondMissing { get; } = new AzureDiskSuitabilityDetail(NumberOfReadOperationsPerSecondMissingValue); + /// NumberOfWriteOperationsPerSecondMissing. + public static AzureDiskSuitabilityDetail NumberOfWriteOperationsPerSecondMissing { get; } = new AzureDiskSuitabilityDetail(NumberOfWriteOperationsPerSecondMissingValue); + /// MegabytesPerSecondOfReadMissing. + public static AzureDiskSuitabilityDetail MegabytesPerSecondOfReadMissing { get; } = new AzureDiskSuitabilityDetail(MegabytesPerSecondOfReadMissingValue); + /// MegabytesPerSecondOfWriteMissing. + public static AzureDiskSuitabilityDetail MegabytesPerSecondOfWriteMissing { get; } = new AzureDiskSuitabilityDetail(MegabytesPerSecondOfWriteMissingValue); + /// DiskGigabytesConsumedMissing. + public static AzureDiskSuitabilityDetail DiskGigabytesConsumedMissing { get; } = new AzureDiskSuitabilityDetail(DiskGigabytesConsumedMissingValue); + /// DiskGigabytesProvisionedMissing. + public static AzureDiskSuitabilityDetail DiskGigabytesProvisionedMissing { get; } = new AzureDiskSuitabilityDetail(DiskGigabytesProvisionedMissingValue); + /// NumberOfReadOperationsPerSecondOutOfRange. + public static AzureDiskSuitabilityDetail NumberOfReadOperationsPerSecondOutOfRange { get; } = new AzureDiskSuitabilityDetail(NumberOfReadOperationsPerSecondOutOfRangeValue); + /// NumberOfWriteOperationsPerSecondOutOfRange. + public static AzureDiskSuitabilityDetail NumberOfWriteOperationsPerSecondOutOfRange { get; } = new AzureDiskSuitabilityDetail(NumberOfWriteOperationsPerSecondOutOfRangeValue); + /// MegabytesPerSecondOfReadOutOfRange. + public static AzureDiskSuitabilityDetail MegabytesPerSecondOfReadOutOfRange { get; } = new AzureDiskSuitabilityDetail(MegabytesPerSecondOfReadOutOfRangeValue); + /// MegabytesPerSecondOfWriteOutOfRange. + public static AzureDiskSuitabilityDetail MegabytesPerSecondOfWriteOutOfRange { get; } = new AzureDiskSuitabilityDetail(MegabytesPerSecondOfWriteOutOfRangeValue); + /// DiskGigabytesConsumedOutOfRange. + public static AzureDiskSuitabilityDetail DiskGigabytesConsumedOutOfRange { get; } = new AzureDiskSuitabilityDetail(DiskGigabytesConsumedOutOfRangeValue); + /// DiskGigabytesProvisionedOutOfRange. + public static AzureDiskSuitabilityDetail DiskGigabytesProvisionedOutOfRange { get; } = new AzureDiskSuitabilityDetail(DiskGigabytesProvisionedOutOfRangeValue); + /// Determines if two values are the same. + public static bool operator ==(AzureDiskSuitabilityDetail left, AzureDiskSuitabilityDetail right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureDiskSuitabilityDetail left, AzureDiskSuitabilityDetail right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureDiskSuitabilityDetail(string value) => new AzureDiskSuitabilityDetail(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureDiskSuitabilityDetail other && Equals(other); + /// + public bool Equals(AzureDiskSuitabilityDetail other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureDiskSuitabilityExplanation.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureDiskSuitabilityExplanation.cs new file mode 100644 index 000000000000..9ca311fa0ed1 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureDiskSuitabilityExplanation.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AzureDiskSuitabilityExplanation. + public readonly partial struct AzureDiskSuitabilityExplanation : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureDiskSuitabilityExplanation(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string NotApplicableValue = "NotApplicable"; + private const string DiskSizeGreaterThanSupportedValue = "DiskSizeGreaterThanSupported"; + private const string NoSuitableDiskSizeForIopsValue = "NoSuitableDiskSizeForIops"; + private const string NoSuitableDiskSizeForThroughputValue = "NoSuitableDiskSizeForThroughput"; + private const string NoDiskSizeFoundInSelectedLocationValue = "NoDiskSizeFoundInSelectedLocation"; + private const string NoDiskSizeFoundForSelectedRedundancyValue = "NoDiskSizeFoundForSelectedRedundancy"; + private const string InternalErrorOccurredForDiskEvaluationValue = "InternalErrorOccurredForDiskEvaluation"; + private const string NoEAPriceFoundForDiskSizeValue = "NoEaPriceFoundForDiskSize"; + + /// Unknown. + public static AzureDiskSuitabilityExplanation Unknown { get; } = new AzureDiskSuitabilityExplanation(UnknownValue); + /// NotApplicable. + public static AzureDiskSuitabilityExplanation NotApplicable { get; } = new AzureDiskSuitabilityExplanation(NotApplicableValue); + /// DiskSizeGreaterThanSupported. + public static AzureDiskSuitabilityExplanation DiskSizeGreaterThanSupported { get; } = new AzureDiskSuitabilityExplanation(DiskSizeGreaterThanSupportedValue); + /// NoSuitableDiskSizeForIops. + public static AzureDiskSuitabilityExplanation NoSuitableDiskSizeForIops { get; } = new AzureDiskSuitabilityExplanation(NoSuitableDiskSizeForIopsValue); + /// NoSuitableDiskSizeForThroughput. + public static AzureDiskSuitabilityExplanation NoSuitableDiskSizeForThroughput { get; } = new AzureDiskSuitabilityExplanation(NoSuitableDiskSizeForThroughputValue); + /// NoDiskSizeFoundInSelectedLocation. + public static AzureDiskSuitabilityExplanation NoDiskSizeFoundInSelectedLocation { get; } = new AzureDiskSuitabilityExplanation(NoDiskSizeFoundInSelectedLocationValue); + /// NoDiskSizeFoundForSelectedRedundancy. + public static AzureDiskSuitabilityExplanation NoDiskSizeFoundForSelectedRedundancy { get; } = new AzureDiskSuitabilityExplanation(NoDiskSizeFoundForSelectedRedundancyValue); + /// InternalErrorOccurredForDiskEvaluation. + public static AzureDiskSuitabilityExplanation InternalErrorOccurredForDiskEvaluation { get; } = new AzureDiskSuitabilityExplanation(InternalErrorOccurredForDiskEvaluationValue); + /// NoEaPriceFoundForDiskSize. + public static AzureDiskSuitabilityExplanation NoEAPriceFoundForDiskSize { get; } = new AzureDiskSuitabilityExplanation(NoEAPriceFoundForDiskSizeValue); + /// Determines if two values are the same. + public static bool operator ==(AzureDiskSuitabilityExplanation left, AzureDiskSuitabilityExplanation right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureDiskSuitabilityExplanation left, AzureDiskSuitabilityExplanation right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureDiskSuitabilityExplanation(string value) => new AzureDiskSuitabilityExplanation(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureDiskSuitabilityExplanation other && Equals(other); + /// + public bool Equals(AzureDiskSuitabilityExplanation other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureDiskType.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureDiskType.cs new file mode 100644 index 000000000000..2bb930063cfa --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureDiskType.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AzureDiskType. + public readonly partial struct AzureDiskType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureDiskType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string StandardValue = "Standard"; + private const string StandardSsdValue = "StandardSSD"; + private const string PremiumValue = "Premium"; + private const string StandardOrPremiumValue = "StandardOrPremium"; + private const string UltraValue = "Ultra"; + private const string PremiumV2Value = "PremiumV2"; + + /// Unknown. + public static AzureDiskType Unknown { get; } = new AzureDiskType(UnknownValue); + /// Standard. + public static AzureDiskType Standard { get; } = new AzureDiskType(StandardValue); + /// StandardSSD. + public static AzureDiskType StandardSsd { get; } = new AzureDiskType(StandardSsdValue); + /// Premium. + public static AzureDiskType Premium { get; } = new AzureDiskType(PremiumValue); + /// StandardOrPremium. + public static AzureDiskType StandardOrPremium { get; } = new AzureDiskType(StandardOrPremiumValue); + /// Ultra. + public static AzureDiskType Ultra { get; } = new AzureDiskType(UltraValue); + /// PremiumV2. + public static AzureDiskType PremiumV2 { get; } = new AzureDiskType(PremiumV2Value); + /// Determines if two values are the same. + public static bool operator ==(AzureDiskType left, AzureDiskType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureDiskType left, AzureDiskType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureDiskType(string value) => new AzureDiskType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureDiskType other && Equals(other); + /// + public bool Equals(AzureDiskType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureHybridUseBenefit.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureHybridUseBenefit.cs new file mode 100644 index 000000000000..ee37c21cb39b --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureHybridUseBenefit.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AzureHybridUseBenefit. + public readonly partial struct AzureHybridUseBenefit : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureHybridUseBenefit(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string YesValue = "Yes"; + private const string NoValue = "No"; + + /// Unknown. + public static AzureHybridUseBenefit Unknown { get; } = new AzureHybridUseBenefit(UnknownValue); + /// Yes. + public static AzureHybridUseBenefit Yes { get; } = new AzureHybridUseBenefit(YesValue); + /// No. + public static AzureHybridUseBenefit No { get; } = new AzureHybridUseBenefit(NoValue); + /// Determines if two values are the same. + public static bool operator ==(AzureHybridUseBenefit left, AzureHybridUseBenefit right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureHybridUseBenefit left, AzureHybridUseBenefit right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureHybridUseBenefit(string value) => new AzureHybridUseBenefit(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureHybridUseBenefit other && Equals(other); + /// + public bool Equals(AzureHybridUseBenefit other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureManagedDiskSkuDto.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureManagedDiskSkuDto.Serialization.cs new file mode 100644 index 000000000000..6579d273c159 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureManagedDiskSkuDto.Serialization.cs @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class AzureManagedDiskSkuDto : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureManagedDiskSkuDto)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(DiskType)) + { + writer.WritePropertyName("diskType"u8); + writer.WriteStringValue(DiskType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(DiskSize)) + { + writer.WritePropertyName("diskSize"u8); + writer.WriteStringValue(DiskSize.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(DiskRedundancy)) + { + writer.WritePropertyName("diskRedundancy"u8); + writer.WriteStringValue(DiskRedundancy.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(StorageCost)) + { + writer.WritePropertyName("storageCost"u8); + writer.WriteNumberValue(StorageCost.Value); + } + if (options.Format != "W" && Optional.IsDefined(RecommendedSizeInGib)) + { + writer.WritePropertyName("recommendedSizeInGib"u8); + writer.WriteNumberValue(RecommendedSizeInGib.Value); + } + if (options.Format != "W" && Optional.IsDefined(RecommendedThroughputInMbps)) + { + writer.WritePropertyName("recommendedThroughputInMbps"u8); + writer.WriteNumberValue(RecommendedThroughputInMbps.Value); + } + if (options.Format != "W" && Optional.IsDefined(RecommendedIops)) + { + writer.WritePropertyName("recommendedIops"u8); + writer.WriteNumberValue(RecommendedIops.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureManagedDiskSkuDto IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureManagedDiskSkuDto)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureManagedDiskSkuDto(document.RootElement, options); + } + + internal static AzureManagedDiskSkuDto DeserializeAzureManagedDiskSkuDto(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureManagedDiskSkuDtoDiskType? diskType = default; + AzureDiskSize? diskSize = default; + AzureManagedDiskSkuDtoDiskRedundancy? diskRedundancy = default; + double? storageCost = default; + double? recommendedSizeInGib = default; + double? recommendedThroughputInMbps = default; + double? recommendedIops = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("diskType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskType = new AzureManagedDiskSkuDtoDiskType(property.Value.GetString()); + continue; + } + if (property.NameEquals("diskSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskSize = new AzureDiskSize(property.Value.GetString()); + continue; + } + if (property.NameEquals("diskRedundancy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskRedundancy = new AzureManagedDiskSkuDtoDiskRedundancy(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageCost"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageCost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("recommendedSizeInGib"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendedSizeInGib = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("recommendedThroughputInMbps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendedThroughputInMbps = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("recommendedIops"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendedIops = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureManagedDiskSkuDto( + diskType, + diskSize, + diskRedundancy, + storageCost, + recommendedSizeInGib, + recommendedThroughputInMbps, + recommendedIops, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureManagedDiskSkuDto)} does not support writing '{options.Format}' format."); + } + } + + AzureManagedDiskSkuDto IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureManagedDiskSkuDto(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureManagedDiskSkuDto)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureManagedDiskSkuDto.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureManagedDiskSkuDto.cs new file mode 100644 index 000000000000..9f223c5b4f09 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureManagedDiskSkuDto.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Class representing an Azure Managed Disk SKU. + public partial class AzureManagedDiskSkuDto + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal AzureManagedDiskSkuDto() + { + } + + /// Initializes a new instance of . + /// Gets the Type ("tier") of disk - e.g. standard, premium, ultra. + /// Gets the Size of the managed disk - e.g. P30, P40. + /// Gets disk redundancy - e.g. LRS, ZRS. + /// Gets the managed disk storage cost. + /// Gets the recommended in GB of the managed disk. + /// Gets the recommended throughput in MBPS of the managed disk. + /// Gets the recommended IOPS of the managed disk. + /// Keeps track of any properties unknown to the library. + internal AzureManagedDiskSkuDto(AzureManagedDiskSkuDtoDiskType? diskType, AzureDiskSize? diskSize, AzureManagedDiskSkuDtoDiskRedundancy? diskRedundancy, double? storageCost, double? recommendedSizeInGib, double? recommendedThroughputInMbps, double? recommendedIops, IDictionary serializedAdditionalRawData) + { + DiskType = diskType; + DiskSize = diskSize; + DiskRedundancy = diskRedundancy; + StorageCost = storageCost; + RecommendedSizeInGib = recommendedSizeInGib; + RecommendedThroughputInMbps = recommendedThroughputInMbps; + RecommendedIops = recommendedIops; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the Type ("tier") of disk - e.g. standard, premium, ultra. + public AzureManagedDiskSkuDtoDiskType? DiskType { get; } + /// Gets the Size of the managed disk - e.g. P30, P40. + public AzureDiskSize? DiskSize { get; } + /// Gets disk redundancy - e.g. LRS, ZRS. + public AzureManagedDiskSkuDtoDiskRedundancy? DiskRedundancy { get; } + /// Gets the managed disk storage cost. + public double? StorageCost { get; } + /// Gets the recommended in GB of the managed disk. + public double? RecommendedSizeInGib { get; } + /// Gets the recommended throughput in MBPS of the managed disk. + public double? RecommendedThroughputInMbps { get; } + /// Gets the recommended IOPS of the managed disk. + public double? RecommendedIops { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureManagedDiskSkuDtoDiskRedundancy.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureManagedDiskSkuDtoDiskRedundancy.cs new file mode 100644 index 000000000000..876cbe8bdd5c --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureManagedDiskSkuDtoDiskRedundancy.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AzureManagedDiskSkuDtoDiskRedundancy. + public readonly partial struct AzureManagedDiskSkuDtoDiskRedundancy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureManagedDiskSkuDtoDiskRedundancy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string LrsValue = "LRS"; + private const string ZrsValue = "ZRS"; + + /// Unknown. + public static AzureManagedDiskSkuDtoDiskRedundancy Unknown { get; } = new AzureManagedDiskSkuDtoDiskRedundancy(UnknownValue); + /// LRS. + public static AzureManagedDiskSkuDtoDiskRedundancy Lrs { get; } = new AzureManagedDiskSkuDtoDiskRedundancy(LrsValue); + /// ZRS. + public static AzureManagedDiskSkuDtoDiskRedundancy Zrs { get; } = new AzureManagedDiskSkuDtoDiskRedundancy(ZrsValue); + /// Determines if two values are the same. + public static bool operator ==(AzureManagedDiskSkuDtoDiskRedundancy left, AzureManagedDiskSkuDtoDiskRedundancy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureManagedDiskSkuDtoDiskRedundancy left, AzureManagedDiskSkuDtoDiskRedundancy right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureManagedDiskSkuDtoDiskRedundancy(string value) => new AzureManagedDiskSkuDtoDiskRedundancy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureManagedDiskSkuDtoDiskRedundancy other && Equals(other); + /// + public bool Equals(AzureManagedDiskSkuDtoDiskRedundancy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureManagedDiskSkuDtoDiskType.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureManagedDiskSkuDtoDiskType.cs new file mode 100644 index 000000000000..a85ba2ec51c9 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureManagedDiskSkuDtoDiskType.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AzureManagedDiskSkuDtoDiskType. + public readonly partial struct AzureManagedDiskSkuDtoDiskType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureManagedDiskSkuDtoDiskType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string StandardValue = "Standard"; + private const string StandardSsdValue = "StandardSSD"; + private const string PremiumValue = "Premium"; + private const string StandardOrPremiumValue = "StandardOrPremium"; + private const string UltraValue = "Ultra"; + private const string PremiumV2Value = "PremiumV2"; + + /// Unknown. + public static AzureManagedDiskSkuDtoDiskType Unknown { get; } = new AzureManagedDiskSkuDtoDiskType(UnknownValue); + /// Standard. + public static AzureManagedDiskSkuDtoDiskType Standard { get; } = new AzureManagedDiskSkuDtoDiskType(StandardValue); + /// StandardSSD. + public static AzureManagedDiskSkuDtoDiskType StandardSsd { get; } = new AzureManagedDiskSkuDtoDiskType(StandardSsdValue); + /// Premium. + public static AzureManagedDiskSkuDtoDiskType Premium { get; } = new AzureManagedDiskSkuDtoDiskType(PremiumValue); + /// StandardOrPremium. + public static AzureManagedDiskSkuDtoDiskType StandardOrPremium { get; } = new AzureManagedDiskSkuDtoDiskType(StandardOrPremiumValue); + /// Ultra. + public static AzureManagedDiskSkuDtoDiskType Ultra { get; } = new AzureManagedDiskSkuDtoDiskType(UltraValue); + /// PremiumV2. + public static AzureManagedDiskSkuDtoDiskType PremiumV2 { get; } = new AzureManagedDiskSkuDtoDiskType(PremiumV2Value); + /// Determines if two values are the same. + public static bool operator ==(AzureManagedDiskSkuDtoDiskType left, AzureManagedDiskSkuDtoDiskType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureManagedDiskSkuDtoDiskType left, AzureManagedDiskSkuDtoDiskType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureManagedDiskSkuDtoDiskType(string value) => new AzureManagedDiskSkuDtoDiskType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureManagedDiskSkuDtoDiskType other && Equals(other); + /// + public bool Equals(AzureManagedDiskSkuDtoDiskType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureNetworkAdapterSuitabilityDetail.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureNetworkAdapterSuitabilityDetail.cs new file mode 100644 index 000000000000..139b5e51d102 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureNetworkAdapterSuitabilityDetail.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AzureNetworkAdapterSuitabilityDetail. + public readonly partial struct AzureNetworkAdapterSuitabilityDetail : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureNetworkAdapterSuitabilityDetail(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string MegabytesOfDataTransmittedMissingValue = "MegabytesOfDataTransmittedMissing"; + private const string MegabytesOfDataTransmittedOutOfRangeValue = "MegabytesOfDataTransmittedOutOfRange"; + private const string MegabytesOfDataRecievedMissingValue = "MegabytesOfDataRecievedMissing"; + private const string MegabytesOfDataRecievedOutOfRangeValue = "MegabytesOfDataRecievedOutOfRange"; + + /// None. + public static AzureNetworkAdapterSuitabilityDetail None { get; } = new AzureNetworkAdapterSuitabilityDetail(NoneValue); + /// MegabytesOfDataTransmittedMissing. + public static AzureNetworkAdapterSuitabilityDetail MegabytesOfDataTransmittedMissing { get; } = new AzureNetworkAdapterSuitabilityDetail(MegabytesOfDataTransmittedMissingValue); + /// MegabytesOfDataTransmittedOutOfRange. + public static AzureNetworkAdapterSuitabilityDetail MegabytesOfDataTransmittedOutOfRange { get; } = new AzureNetworkAdapterSuitabilityDetail(MegabytesOfDataTransmittedOutOfRangeValue); + /// MegabytesOfDataRecievedMissing. + public static AzureNetworkAdapterSuitabilityDetail MegabytesOfDataRecievedMissing { get; } = new AzureNetworkAdapterSuitabilityDetail(MegabytesOfDataRecievedMissingValue); + /// MegabytesOfDataRecievedOutOfRange. + public static AzureNetworkAdapterSuitabilityDetail MegabytesOfDataRecievedOutOfRange { get; } = new AzureNetworkAdapterSuitabilityDetail(MegabytesOfDataRecievedOutOfRangeValue); + /// Determines if two values are the same. + public static bool operator ==(AzureNetworkAdapterSuitabilityDetail left, AzureNetworkAdapterSuitabilityDetail right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureNetworkAdapterSuitabilityDetail left, AzureNetworkAdapterSuitabilityDetail right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureNetworkAdapterSuitabilityDetail(string value) => new AzureNetworkAdapterSuitabilityDetail(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureNetworkAdapterSuitabilityDetail other && Equals(other); + /// + public bool Equals(AzureNetworkAdapterSuitabilityDetail other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureNetworkAdapterSuitabilityExplanation.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureNetworkAdapterSuitabilityExplanation.cs new file mode 100644 index 000000000000..3fea7e83774d --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureNetworkAdapterSuitabilityExplanation.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AzureNetworkAdapterSuitabilityExplanation. + public readonly partial struct AzureNetworkAdapterSuitabilityExplanation : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureNetworkAdapterSuitabilityExplanation(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string NotApplicableValue = "NotApplicable"; + private const string InternalErrorOccurredValue = "InternalErrorOccurred"; + + /// Unknown. + public static AzureNetworkAdapterSuitabilityExplanation Unknown { get; } = new AzureNetworkAdapterSuitabilityExplanation(UnknownValue); + /// NotApplicable. + public static AzureNetworkAdapterSuitabilityExplanation NotApplicable { get; } = new AzureNetworkAdapterSuitabilityExplanation(NotApplicableValue); + /// InternalErrorOccurred. + public static AzureNetworkAdapterSuitabilityExplanation InternalErrorOccurred { get; } = new AzureNetworkAdapterSuitabilityExplanation(InternalErrorOccurredValue); + /// Determines if two values are the same. + public static bool operator ==(AzureNetworkAdapterSuitabilityExplanation left, AzureNetworkAdapterSuitabilityExplanation right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureNetworkAdapterSuitabilityExplanation left, AzureNetworkAdapterSuitabilityExplanation right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureNetworkAdapterSuitabilityExplanation(string value) => new AzureNetworkAdapterSuitabilityExplanation(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureNetworkAdapterSuitabilityExplanation other && Equals(other); + /// + public bool Equals(AzureNetworkAdapterSuitabilityExplanation other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureOfferCode.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureOfferCode.cs new file mode 100644 index 000000000000..9daacb8dba3e --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureOfferCode.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AzureOfferCode. + public readonly partial struct AzureOfferCode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureOfferCode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string MSAZR0003PValue = "MSAZR0003P"; + private const string MSAZR0044PValue = "MSAZR0044P"; + private const string MSAZR0059PValue = "MSAZR0059P"; + private const string MSAZR0060PValue = "MSAZR0060P"; + private const string MSAZR0062PValue = "MSAZR0062P"; + private const string MSAZR0063PValue = "MSAZR0063P"; + private const string MSAZR0064PValue = "MSAZR0064P"; + private const string MSAZR0029PValue = "MSAZR0029P"; + private const string MSAZR0022PValue = "MSAZR0022P"; + private const string MSAZR0023PValue = "MSAZR0023P"; + private const string MSAZR0148PValue = "MSAZR0148P"; + private const string MSAZR0025PValue = "MSAZR0025P"; + private const string MSAZR0036PValue = "MSAZR0036P"; + private const string MSAZR0120PValue = "MSAZR0120P"; + private const string MSAZR0121PValue = "MSAZR0121P"; + private const string MSAZR0122PValue = "MSAZR0122P"; + private const string MSAZR0123PValue = "MSAZR0123P"; + private const string MSAZR0124PValue = "MSAZR0124P"; + private const string MSAZR0125PValue = "MSAZR0125P"; + private const string MSAZR0126PValue = "MSAZR0126P"; + private const string MSAZR0127PValue = "MSAZR0127P"; + private const string MSAZR0128PValue = "MSAZR0128P"; + private const string MSAZR0129PValue = "MSAZR0129P"; + private const string MSAZR0130PValue = "MSAZR0130P"; + private const string MSAZR0111PValue = "MSAZR0111P"; + private const string MSAZR0144PValue = "MSAZR0144P"; + private const string MSAZR0149PValue = "MSAZR0149P"; + private const string MSMCAZR0044PValue = "MSMCAZR0044P"; + private const string MSMCAZR0059PValue = "MSMCAZR0059P"; + private const string MSMCAZR0060PValue = "MSMCAZR0060P"; + private const string MSMCAZR0063PValue = "MSMCAZR0063P"; + private const string MSMCAZR0120PValue = "MSMCAZR0120P"; + private const string MSMCAZR0121PValue = "MSMCAZR0121P"; + private const string MSMCAZR0125PValue = "MSMCAZR0125P"; + private const string MSMCAZR0128PValue = "MSMCAZR0128P"; + private const string MSAZRDE0003PValue = "MSAZRDE0003P"; + private const string MSAZRDE0044PValue = "MSAZRDE0044P"; + private const string MSAZRUSGOV0003PValue = "MSAZRUSGOV0003P"; + private const string EAValue = "EA"; + private const string MSAZR0243PValue = "MSAZR0243P"; + private const string SavingsPlan1YearValue = "SavingsPlan1Year"; + private const string SavingsPlan3YearValue = "SavingsPlan3Year"; + + /// Unknown. + public static AzureOfferCode Unknown { get; } = new AzureOfferCode(UnknownValue); + /// MSAZR0003P. + public static AzureOfferCode MSAZR0003P { get; } = new AzureOfferCode(MSAZR0003PValue); + /// MSAZR0044P. + public static AzureOfferCode MSAZR0044P { get; } = new AzureOfferCode(MSAZR0044PValue); + /// MSAZR0059P. + public static AzureOfferCode MSAZR0059P { get; } = new AzureOfferCode(MSAZR0059PValue); + /// MSAZR0060P. + public static AzureOfferCode MSAZR0060P { get; } = new AzureOfferCode(MSAZR0060PValue); + /// MSAZR0062P. + public static AzureOfferCode MSAZR0062P { get; } = new AzureOfferCode(MSAZR0062PValue); + /// MSAZR0063P. + public static AzureOfferCode MSAZR0063P { get; } = new AzureOfferCode(MSAZR0063PValue); + /// MSAZR0064P. + public static AzureOfferCode MSAZR0064P { get; } = new AzureOfferCode(MSAZR0064PValue); + /// MSAZR0029P. + public static AzureOfferCode MSAZR0029P { get; } = new AzureOfferCode(MSAZR0029PValue); + /// MSAZR0022P. + public static AzureOfferCode MSAZR0022P { get; } = new AzureOfferCode(MSAZR0022PValue); + /// MSAZR0023P. + public static AzureOfferCode MSAZR0023P { get; } = new AzureOfferCode(MSAZR0023PValue); + /// MSAZR0148P. + public static AzureOfferCode MSAZR0148P { get; } = new AzureOfferCode(MSAZR0148PValue); + /// MSAZR0025P. + public static AzureOfferCode MSAZR0025P { get; } = new AzureOfferCode(MSAZR0025PValue); + /// MSAZR0036P. + public static AzureOfferCode MSAZR0036P { get; } = new AzureOfferCode(MSAZR0036PValue); + /// MSAZR0120P. + public static AzureOfferCode MSAZR0120P { get; } = new AzureOfferCode(MSAZR0120PValue); + /// MSAZR0121P. + public static AzureOfferCode MSAZR0121P { get; } = new AzureOfferCode(MSAZR0121PValue); + /// MSAZR0122P. + public static AzureOfferCode MSAZR0122P { get; } = new AzureOfferCode(MSAZR0122PValue); + /// MSAZR0123P. + public static AzureOfferCode MSAZR0123P { get; } = new AzureOfferCode(MSAZR0123PValue); + /// MSAZR0124P. + public static AzureOfferCode MSAZR0124P { get; } = new AzureOfferCode(MSAZR0124PValue); + /// MSAZR0125P. + public static AzureOfferCode MSAZR0125P { get; } = new AzureOfferCode(MSAZR0125PValue); + /// MSAZR0126P. + public static AzureOfferCode MSAZR0126P { get; } = new AzureOfferCode(MSAZR0126PValue); + /// MSAZR0127P. + public static AzureOfferCode MSAZR0127P { get; } = new AzureOfferCode(MSAZR0127PValue); + /// MSAZR0128P. + public static AzureOfferCode MSAZR0128P { get; } = new AzureOfferCode(MSAZR0128PValue); + /// MSAZR0129P. + public static AzureOfferCode MSAZR0129P { get; } = new AzureOfferCode(MSAZR0129PValue); + /// MSAZR0130P. + public static AzureOfferCode MSAZR0130P { get; } = new AzureOfferCode(MSAZR0130PValue); + /// MSAZR0111P. + public static AzureOfferCode MSAZR0111P { get; } = new AzureOfferCode(MSAZR0111PValue); + /// MSAZR0144P. + public static AzureOfferCode MSAZR0144P { get; } = new AzureOfferCode(MSAZR0144PValue); + /// MSAZR0149P. + public static AzureOfferCode MSAZR0149P { get; } = new AzureOfferCode(MSAZR0149PValue); + /// MSMCAZR0044P. + public static AzureOfferCode MSMCAZR0044P { get; } = new AzureOfferCode(MSMCAZR0044PValue); + /// MSMCAZR0059P. + public static AzureOfferCode MSMCAZR0059P { get; } = new AzureOfferCode(MSMCAZR0059PValue); + /// MSMCAZR0060P. + public static AzureOfferCode MSMCAZR0060P { get; } = new AzureOfferCode(MSMCAZR0060PValue); + /// MSMCAZR0063P. + public static AzureOfferCode MSMCAZR0063P { get; } = new AzureOfferCode(MSMCAZR0063PValue); + /// MSMCAZR0120P. + public static AzureOfferCode MSMCAZR0120P { get; } = new AzureOfferCode(MSMCAZR0120PValue); + /// MSMCAZR0121P. + public static AzureOfferCode MSMCAZR0121P { get; } = new AzureOfferCode(MSMCAZR0121PValue); + /// MSMCAZR0125P. + public static AzureOfferCode MSMCAZR0125P { get; } = new AzureOfferCode(MSMCAZR0125PValue); + /// MSMCAZR0128P. + public static AzureOfferCode MSMCAZR0128P { get; } = new AzureOfferCode(MSMCAZR0128PValue); + /// MSAZRDE0003P. + public static AzureOfferCode MSAZRDE0003P { get; } = new AzureOfferCode(MSAZRDE0003PValue); + /// MSAZRDE0044P. + public static AzureOfferCode MSAZRDE0044P { get; } = new AzureOfferCode(MSAZRDE0044PValue); + /// MSAZRUSGOV0003P. + public static AzureOfferCode MSAZRUSGOV0003P { get; } = new AzureOfferCode(MSAZRUSGOV0003PValue); + /// EA. + public static AzureOfferCode EA { get; } = new AzureOfferCode(EAValue); + /// MSAZR0243P. + public static AzureOfferCode MSAZR0243P { get; } = new AzureOfferCode(MSAZR0243PValue); + /// SavingsPlan1Year. + public static AzureOfferCode SavingsPlan1Year { get; } = new AzureOfferCode(SavingsPlan1YearValue); + /// SavingsPlan3Year. + public static AzureOfferCode SavingsPlan3Year { get; } = new AzureOfferCode(SavingsPlan3YearValue); + /// Determines if two values are the same. + public static bool operator ==(AzureOfferCode left, AzureOfferCode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureOfferCode left, AzureOfferCode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureOfferCode(string value) => new AzureOfferCode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureOfferCode other && Equals(other); + /// + public bool Equals(AzureOfferCode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzurePricingTier.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzurePricingTier.cs new file mode 100644 index 000000000000..c56ef5c73084 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzurePricingTier.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AzurePricingTier. + public readonly partial struct AzurePricingTier : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzurePricingTier(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StandardValue = "Standard"; + private const string BasicValue = "Basic"; + + /// Standard. + public static AzurePricingTier Standard { get; } = new AzurePricingTier(StandardValue); + /// Basic. + public static AzurePricingTier Basic { get; } = new AzurePricingTier(BasicValue); + /// Determines if two values are the same. + public static bool operator ==(AzurePricingTier left, AzurePricingTier right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzurePricingTier left, AzurePricingTier right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzurePricingTier(string value) => new AzurePricingTier(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzurePricingTier other && Equals(other); + /// + public bool Equals(AzurePricingTier other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureQuorumWitnessDto.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureQuorumWitnessDto.Serialization.cs new file mode 100644 index 000000000000..17d269d70ddc --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureQuorumWitnessDto.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class AzureQuorumWitnessDto : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureQuorumWitnessDto)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(QuorumWitnessType)) + { + writer.WritePropertyName("quorumWitnessType"u8); + writer.WriteStringValue(QuorumWitnessType.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureQuorumWitnessDto IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureQuorumWitnessDto)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureQuorumWitnessDto(document.RootElement, options); + } + + internal static AzureQuorumWitnessDto DeserializeAzureQuorumWitnessDto(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureQuorumWitnessDtoQuorumWitnessType? quorumWitnessType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("quorumWitnessType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + quorumWitnessType = new AzureQuorumWitnessDtoQuorumWitnessType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureQuorumWitnessDto(quorumWitnessType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureQuorumWitnessDto)} does not support writing '{options.Format}' format."); + } + } + + AzureQuorumWitnessDto IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureQuorumWitnessDto(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureQuorumWitnessDto)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureQuorumWitnessDto.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureQuorumWitnessDto.cs new file mode 100644 index 000000000000..06b9749be7a9 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureQuorumWitnessDto.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Quorum Witness. + internal partial class AzureQuorumWitnessDto + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal AzureQuorumWitnessDto() + { + } + + /// Initializes a new instance of . + /// Gets quorum witness type. + /// Keeps track of any properties unknown to the library. + internal AzureQuorumWitnessDto(AzureQuorumWitnessDtoQuorumWitnessType? quorumWitnessType, IDictionary serializedAdditionalRawData) + { + QuorumWitnessType = quorumWitnessType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets quorum witness type. + public AzureQuorumWitnessDtoQuorumWitnessType? QuorumWitnessType { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureQuorumWitnessDtoQuorumWitnessType.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureQuorumWitnessDtoQuorumWitnessType.cs new file mode 100644 index 000000000000..3925e3df58ed --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureQuorumWitnessDtoQuorumWitnessType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AzureQuorumWitnessDtoQuorumWitnessType. + public readonly partial struct AzureQuorumWitnessDtoQuorumWitnessType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureQuorumWitnessDtoQuorumWitnessType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string CloudValue = "Cloud"; + private const string DiskValue = "Disk"; + + /// Unknown. + public static AzureQuorumWitnessDtoQuorumWitnessType Unknown { get; } = new AzureQuorumWitnessDtoQuorumWitnessType(UnknownValue); + /// Cloud. + public static AzureQuorumWitnessDtoQuorumWitnessType Cloud { get; } = new AzureQuorumWitnessDtoQuorumWitnessType(CloudValue); + /// Disk. + public static AzureQuorumWitnessDtoQuorumWitnessType Disk { get; } = new AzureQuorumWitnessDtoQuorumWitnessType(DiskValue); + /// Determines if two values are the same. + public static bool operator ==(AzureQuorumWitnessDtoQuorumWitnessType left, AzureQuorumWitnessDtoQuorumWitnessType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureQuorumWitnessDtoQuorumWitnessType left, AzureQuorumWitnessDtoQuorumWitnessType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureQuorumWitnessDtoQuorumWitnessType(string value) => new AzureQuorumWitnessDtoQuorumWitnessType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureQuorumWitnessDtoQuorumWitnessType other && Equals(other); + /// + public bool Equals(AzureQuorumWitnessDtoQuorumWitnessType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureReservedInstance.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureReservedInstance.cs new file mode 100644 index 000000000000..394b3f51f096 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureReservedInstance.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AzureReservedInstance. + public readonly partial struct AzureReservedInstance : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureReservedInstance(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string RI1YearValue = "RI1Year"; + private const string RI3YearValue = "RI3Year"; + + /// None. + public static AzureReservedInstance None { get; } = new AzureReservedInstance(NoneValue); + /// RI1Year. + public static AzureReservedInstance RI1Year { get; } = new AzureReservedInstance(RI1YearValue); + /// RI3Year. + public static AzureReservedInstance RI3Year { get; } = new AzureReservedInstance(RI3YearValue); + /// Determines if two values are the same. + public static bool operator ==(AzureReservedInstance left, AzureReservedInstance right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureReservedInstance left, AzureReservedInstance right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureReservedInstance(string value) => new AzureReservedInstance(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureReservedInstance other && Equals(other); + /// + public bool Equals(AzureReservedInstance other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSecurityOfferingType.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSecurityOfferingType.cs new file mode 100644 index 000000000000..32b8302bdd29 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSecurityOfferingType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AzureSecurityOfferingType. + public readonly partial struct AzureSecurityOfferingType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureSecurityOfferingType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NOValue = "NO"; + private const string MDCValue = "MDC"; + + /// NO. + public static AzureSecurityOfferingType NO { get; } = new AzureSecurityOfferingType(NOValue); + /// MDC. + public static AzureSecurityOfferingType MDC { get; } = new AzureSecurityOfferingType(MDCValue); + /// Determines if two values are the same. + public static bool operator ==(AzureSecurityOfferingType left, AzureSecurityOfferingType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureSecurityOfferingType left, AzureSecurityOfferingType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureSecurityOfferingType(string value) => new AzureSecurityOfferingType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureSecurityOfferingType other && Equals(other); + /// + public bool Equals(AzureSecurityOfferingType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSqlDataBaseType.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSqlDataBaseType.cs new file mode 100644 index 000000000000..97d48b4734d4 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSqlDataBaseType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AzureSqlDataBaseType. + public readonly partial struct AzureSqlDataBaseType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureSqlDataBaseType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string AutomaticValue = "Automatic"; + private const string SingleDatabaseValue = "SingleDatabase"; + private const string ElasticPoolValue = "ElasticPool"; + + /// Unknown. + public static AzureSqlDataBaseType Unknown { get; } = new AzureSqlDataBaseType(UnknownValue); + /// Automatic. + public static AzureSqlDataBaseType Automatic { get; } = new AzureSqlDataBaseType(AutomaticValue); + /// SingleDatabase. + public static AzureSqlDataBaseType SingleDatabase { get; } = new AzureSqlDataBaseType(SingleDatabaseValue); + /// ElasticPool. + public static AzureSqlDataBaseType ElasticPool { get; } = new AzureSqlDataBaseType(ElasticPoolValue); + /// Determines if two values are the same. + public static bool operator ==(AzureSqlDataBaseType left, AzureSqlDataBaseType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureSqlDataBaseType left, AzureSqlDataBaseType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureSqlDataBaseType(string value) => new AzureSqlDataBaseType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureSqlDataBaseType other && Equals(other); + /// + public bool Equals(AzureSqlDataBaseType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSqlIaasSkuDto.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSqlIaasSkuDto.Serialization.cs new file mode 100644 index 000000000000..344bef47d373 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSqlIaasSkuDto.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class AzureSqlIaasSkuDto : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureSqlIaasSkuDto)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(VirtualMachineSize)) + { + writer.WritePropertyName("virtualMachineSize"u8); + writer.WriteObjectValue(VirtualMachineSize, options); + } + if (options.Format != "W" && Optional.IsCollectionDefined(DataDiskSizes)) + { + writer.WritePropertyName("dataDiskSizes"u8); + writer.WriteStartArray(); + foreach (var item in DataDiskSizes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(LogDiskSizes)) + { + writer.WritePropertyName("logDiskSizes"u8); + writer.WriteStartArray(); + foreach (var item in LogDiskSizes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(AzureSqlTargetType)) + { + writer.WritePropertyName("azureSqlTargetType"u8); + writer.WriteStringValue(AzureSqlTargetType.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureSqlIaasSkuDto IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureSqlIaasSkuDto)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureSqlIaasSkuDto(document.RootElement, options); + } + + internal static AzureSqlIaasSkuDto DeserializeAzureSqlIaasSkuDto(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureVmSkuDto virtualMachineSize = default; + IReadOnlyList dataDiskSizes = default; + IReadOnlyList logDiskSizes = default; + MigrationAssessmentTargetType? azureSqlTargetType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("virtualMachineSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + virtualMachineSize = AzureVmSkuDto.DeserializeAzureVmSkuDto(property.Value, options); + continue; + } + if (property.NameEquals("dataDiskSizes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AzureManagedDiskSkuDto.DeserializeAzureManagedDiskSkuDto(item, options)); + } + dataDiskSizes = array; + continue; + } + if (property.NameEquals("logDiskSizes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AzureManagedDiskSkuDto.DeserializeAzureManagedDiskSkuDto(item, options)); + } + logDiskSizes = array; + continue; + } + if (property.NameEquals("azureSqlTargetType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSqlTargetType = new MigrationAssessmentTargetType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureSqlIaasSkuDto(virtualMachineSize, dataDiskSizes ?? new ChangeTrackingList(), logDiskSizes ?? new ChangeTrackingList(), azureSqlTargetType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureSqlIaasSkuDto)} does not support writing '{options.Format}' format."); + } + } + + AzureSqlIaasSkuDto IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureSqlIaasSkuDto(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureSqlIaasSkuDto)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSqlIaasSkuDto.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSqlIaasSkuDto.cs new file mode 100644 index 000000000000..3590e7988243 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSqlIaasSkuDto.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Class representing Azure SQL IAAS SKU. + public partial class AzureSqlIaasSkuDto + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal AzureSqlIaasSkuDto() + { + DataDiskSizes = new ChangeTrackingList(); + LogDiskSizes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets the The Azure Compute Virtual Machine. + /// Gets the The list of data disk sizes. + /// Gets the The list of log disk sizes. + /// Gets the target type. + /// Keeps track of any properties unknown to the library. + internal AzureSqlIaasSkuDto(AzureVmSkuDto virtualMachineSize, IReadOnlyList dataDiskSizes, IReadOnlyList logDiskSizes, MigrationAssessmentTargetType? azureSqlTargetType, IDictionary serializedAdditionalRawData) + { + VirtualMachineSize = virtualMachineSize; + DataDiskSizes = dataDiskSizes; + LogDiskSizes = logDiskSizes; + AzureSqlTargetType = azureSqlTargetType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the The Azure Compute Virtual Machine. + public AzureVmSkuDto VirtualMachineSize { get; } + /// Gets the The list of data disk sizes. + public IReadOnlyList DataDiskSizes { get; } + /// Gets the The list of log disk sizes. + public IReadOnlyList LogDiskSizes { get; } + /// Gets the target type. + public MigrationAssessmentTargetType? AzureSqlTargetType { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSqlInstanceType.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSqlInstanceType.cs new file mode 100644 index 000000000000..1fdb06bac6c2 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSqlInstanceType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AzureSqlInstanceType. + public readonly partial struct AzureSqlInstanceType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureSqlInstanceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string AutomaticValue = "Automatic"; + private const string SingleInstanceValue = "SingleInstance"; + private const string InstancePoolsValue = "InstancePools"; + + /// Unknown. + public static AzureSqlInstanceType Unknown { get; } = new AzureSqlInstanceType(UnknownValue); + /// Automatic. + public static AzureSqlInstanceType Automatic { get; } = new AzureSqlInstanceType(AutomaticValue); + /// SingleInstance. + public static AzureSqlInstanceType SingleInstance { get; } = new AzureSqlInstanceType(SingleInstanceValue); + /// InstancePools. + public static AzureSqlInstanceType InstancePools { get; } = new AzureSqlInstanceType(InstancePoolsValue); + /// Determines if two values are the same. + public static bool operator ==(AzureSqlInstanceType left, AzureSqlInstanceType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureSqlInstanceType left, AzureSqlInstanceType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureSqlInstanceType(string value) => new AzureSqlInstanceType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureSqlInstanceType other && Equals(other); + /// + public bool Equals(AzureSqlInstanceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSqlPaasSkuDto.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSqlPaasSkuDto.Serialization.cs new file mode 100644 index 000000000000..42b3b545a9ee --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSqlPaasSkuDto.Serialization.cs @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class AzureSqlPaasSkuDto : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureSqlPaasSkuDto)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(AzureSqlServiceTier)) + { + writer.WritePropertyName("azureSqlServiceTier"u8); + writer.WriteStringValue(AzureSqlServiceTier.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(AzureSqlComputeTier)) + { + writer.WritePropertyName("azureSqlComputeTier"u8); + writer.WriteStringValue(AzureSqlComputeTier.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(AzureSqlHardwareGeneration)) + { + writer.WritePropertyName("azureSqlHardwareGeneration"u8); + writer.WriteStringValue(AzureSqlHardwareGeneration.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(StorageMaxSizeInMB)) + { + writer.WritePropertyName("storageMaxSizeInMB"u8); + writer.WriteNumberValue(StorageMaxSizeInMB.Value); + } + if (options.Format != "W" && Optional.IsDefined(PredictedDataSizeInMB)) + { + writer.WritePropertyName("predictedDataSizeInMB"u8); + writer.WriteNumberValue(PredictedDataSizeInMB.Value); + } + if (options.Format != "W" && Optional.IsDefined(PredictedLogSizeInMB)) + { + writer.WritePropertyName("predictedLogSizeInMB"u8); + writer.WriteNumberValue(PredictedLogSizeInMB.Value); + } + if (options.Format != "W" && Optional.IsDefined(Cores)) + { + writer.WritePropertyName("cores"u8); + writer.WriteNumberValue(Cores.Value); + } + if (options.Format != "W" && Optional.IsDefined(AzureSqlTargetType)) + { + writer.WritePropertyName("azureSqlTargetType"u8); + writer.WriteStringValue(AzureSqlTargetType.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureSqlPaasSkuDto IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureSqlPaasSkuDto)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureSqlPaasSkuDto(document.RootElement, options); + } + + internal static AzureSqlPaasSkuDto DeserializeAzureSqlPaasSkuDto(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureSqlServiceTier? azureSqlServiceTier = default; + MigrationAssessmentComputeTier? azureSqlComputeTier = default; + MigrationAssessmentHardwareGeneration? azureSqlHardwareGeneration = default; + double? storageMaxSizeInMB = default; + double? predictedDataSizeInMB = default; + double? predictedLogSizeInMB = default; + int? cores = default; + MigrationAssessmentTargetType? azureSqlTargetType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azureSqlServiceTier"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSqlServiceTier = new AzureSqlServiceTier(property.Value.GetString()); + continue; + } + if (property.NameEquals("azureSqlComputeTier"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSqlComputeTier = new MigrationAssessmentComputeTier(property.Value.GetString()); + continue; + } + if (property.NameEquals("azureSqlHardwareGeneration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSqlHardwareGeneration = new MigrationAssessmentHardwareGeneration(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageMaxSizeInMB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageMaxSizeInMB = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("predictedDataSizeInMB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + predictedDataSizeInMB = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("predictedLogSizeInMB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + predictedLogSizeInMB = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("cores"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cores = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("azureSqlTargetType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSqlTargetType = new MigrationAssessmentTargetType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureSqlPaasSkuDto( + azureSqlServiceTier, + azureSqlComputeTier, + azureSqlHardwareGeneration, + storageMaxSizeInMB, + predictedDataSizeInMB, + predictedLogSizeInMB, + cores, + azureSqlTargetType, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureSqlPaasSkuDto)} does not support writing '{options.Format}' format."); + } + } + + AzureSqlPaasSkuDto IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureSqlPaasSkuDto(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureSqlPaasSkuDto)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSqlPaasSkuDto.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSqlPaasSkuDto.cs new file mode 100644 index 000000000000..0c06ece86fdf --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSqlPaasSkuDto.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Class representing Azure SQL PAAS SKU. + public partial class AzureSqlPaasSkuDto + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal AzureSqlPaasSkuDto() + { + } + + /// Initializes a new instance of . + /// Gets the service tier. + /// Gets the compute tier. + /// Gets the hardware generation. + /// Gets the storage maximum size in megabytes. + /// + /// Gets the predicted data size in megabytes in the Azure SQL, will impact the + /// billing cost. + /// + /// + /// Gets the predicted log size in megabytes in the Azure SQL, will impact the + /// billing cost. + /// + /// Gets the number of cores. + /// Gets the target type. + /// Keeps track of any properties unknown to the library. + internal AzureSqlPaasSkuDto(AzureSqlServiceTier? azureSqlServiceTier, MigrationAssessmentComputeTier? azureSqlComputeTier, MigrationAssessmentHardwareGeneration? azureSqlHardwareGeneration, double? storageMaxSizeInMB, double? predictedDataSizeInMB, double? predictedLogSizeInMB, int? cores, MigrationAssessmentTargetType? azureSqlTargetType, IDictionary serializedAdditionalRawData) + { + AzureSqlServiceTier = azureSqlServiceTier; + AzureSqlComputeTier = azureSqlComputeTier; + AzureSqlHardwareGeneration = azureSqlHardwareGeneration; + StorageMaxSizeInMB = storageMaxSizeInMB; + PredictedDataSizeInMB = predictedDataSizeInMB; + PredictedLogSizeInMB = predictedLogSizeInMB; + Cores = cores; + AzureSqlTargetType = azureSqlTargetType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the service tier. + public AzureSqlServiceTier? AzureSqlServiceTier { get; } + /// Gets the compute tier. + public MigrationAssessmentComputeTier? AzureSqlComputeTier { get; } + /// Gets the hardware generation. + public MigrationAssessmentHardwareGeneration? AzureSqlHardwareGeneration { get; } + /// Gets the storage maximum size in megabytes. + public double? StorageMaxSizeInMB { get; } + /// + /// Gets the predicted data size in megabytes in the Azure SQL, will impact the + /// billing cost. + /// + public double? PredictedDataSizeInMB { get; } + /// + /// Gets the predicted log size in megabytes in the Azure SQL, will impact the + /// billing cost. + /// + public double? PredictedLogSizeInMB { get; } + /// Gets the number of cores. + public int? Cores { get; } + /// Gets the target type. + public MigrationAssessmentTargetType? AzureSqlTargetType { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSqlPurchaseModel.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSqlPurchaseModel.cs new file mode 100644 index 000000000000..ae3ef7670c15 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSqlPurchaseModel.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AzureSqlPurchaseModel. + public readonly partial struct AzureSqlPurchaseModel : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureSqlPurchaseModel(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string VCoreValue = "VCore"; + private const string DtuValue = "DTU"; + + /// Unknown. + public static AzureSqlPurchaseModel Unknown { get; } = new AzureSqlPurchaseModel(UnknownValue); + /// VCore. + public static AzureSqlPurchaseModel VCore { get; } = new AzureSqlPurchaseModel(VCoreValue); + /// DTU. + public static AzureSqlPurchaseModel Dtu { get; } = new AzureSqlPurchaseModel(DtuValue); + /// Determines if two values are the same. + public static bool operator ==(AzureSqlPurchaseModel left, AzureSqlPurchaseModel right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureSqlPurchaseModel left, AzureSqlPurchaseModel right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureSqlPurchaseModel(string value) => new AzureSqlPurchaseModel(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureSqlPurchaseModel other && Equals(other); + /// + public bool Equals(AzureSqlPurchaseModel other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSqlServiceTier.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSqlServiceTier.cs new file mode 100644 index 000000000000..a37c798b319c --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureSqlServiceTier.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AzureSqlServiceTier. + public readonly partial struct AzureSqlServiceTier : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureSqlServiceTier(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string AutomaticValue = "Automatic"; + private const string GeneralPurposeValue = "GeneralPurpose"; + private const string BusinessCriticalValue = "BusinessCritical"; + private const string HyperScaleValue = "HyperScale"; + + /// Unknown. + public static AzureSqlServiceTier Unknown { get; } = new AzureSqlServiceTier(UnknownValue); + /// Automatic. + public static AzureSqlServiceTier Automatic { get; } = new AzureSqlServiceTier(AutomaticValue); + /// GeneralPurpose. + public static AzureSqlServiceTier GeneralPurpose { get; } = new AzureSqlServiceTier(GeneralPurposeValue); + /// BusinessCritical. + public static AzureSqlServiceTier BusinessCritical { get; } = new AzureSqlServiceTier(BusinessCriticalValue); + /// HyperScale. + public static AzureSqlServiceTier HyperScale { get; } = new AzureSqlServiceTier(HyperScaleValue); + /// Determines if two values are the same. + public static bool operator ==(AzureSqlServiceTier left, AzureSqlServiceTier right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureSqlServiceTier left, AzureSqlServiceTier right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureSqlServiceTier(string value) => new AzureSqlServiceTier(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureSqlServiceTier other && Equals(other); + /// + public bool Equals(AzureSqlServiceTier other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureStorageRedundancy.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureStorageRedundancy.cs new file mode 100644 index 000000000000..e5723a4e38fe --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureStorageRedundancy.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AzureStorageRedundancy. + public readonly partial struct AzureStorageRedundancy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureStorageRedundancy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string LocallyRedundantValue = "LocallyRedundant"; + private const string ZoneRedundantValue = "ZoneRedundant"; + private const string GeoRedundantValue = "GeoRedundant"; + private const string ReadAccessGeoRedundantValue = "ReadAccessGeoRedundant"; + + /// Unknown. + public static AzureStorageRedundancy Unknown { get; } = new AzureStorageRedundancy(UnknownValue); + /// LocallyRedundant. + public static AzureStorageRedundancy LocallyRedundant { get; } = new AzureStorageRedundancy(LocallyRedundantValue); + /// ZoneRedundant. + public static AzureStorageRedundancy ZoneRedundant { get; } = new AzureStorageRedundancy(ZoneRedundantValue); + /// GeoRedundant. + public static AzureStorageRedundancy GeoRedundant { get; } = new AzureStorageRedundancy(GeoRedundantValue); + /// ReadAccessGeoRedundant. + public static AzureStorageRedundancy ReadAccessGeoRedundant { get; } = new AzureStorageRedundancy(ReadAccessGeoRedundantValue); + /// Determines if two values are the same. + public static bool operator ==(AzureStorageRedundancy left, AzureStorageRedundancy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureStorageRedundancy left, AzureStorageRedundancy right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureStorageRedundancy(string value) => new AzureStorageRedundancy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureStorageRedundancy other && Equals(other); + /// + public bool Equals(AzureStorageRedundancy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureVmFamily.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureVmFamily.cs new file mode 100644 index 000000000000..fcfe4d98e28e --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureVmFamily.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AzureVmFamily. + public readonly partial struct AzureVmFamily : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureVmFamily(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string BasicA0A4Value = "Basic_A0_A4"; + private const string StandardA0A7Value = "Standard_A0_A7"; + private const string StandardA8A11Value = "Standard_A8_A11"; + private const string Av2SeriesValue = "Av2_series"; + private const string DSeriesValue = "D_series"; + private const string Dv2SeriesValue = "Dv2_series"; + private const string DSSeriesValue = "DS_series"; + private const string DSv2SeriesValue = "DSv2_series"; + private const string FSeriesValue = "F_series"; + private const string FsSeriesValue = "Fs_series"; + private const string GSeriesValue = "G_series"; + private const string GSSeriesValue = "GS_series"; + private const string HSeriesValue = "H_series"; + private const string LsSeriesValue = "Ls_series"; + private const string Dsv3SeriesValue = "Dsv3_series"; + private const string Dv3SeriesValue = "Dv3_series"; + private const string Fsv2SeriesValue = "Fsv2_series"; + private const string Ev3SeriesValue = "Ev3_series"; + private const string Esv3SeriesValue = "Esv3_series"; + private const string MSeriesValue = "M_series"; + private const string DCSeriesValue = "DC_Series"; + private const string Lsv2SeriesValue = "Lsv2_series"; + private const string Ev4SeriesValue = "Ev4_series"; + private const string Esv4SeriesValue = "Esv4_series"; + private const string Edv4SeriesValue = "Edv4_series"; + private const string Edsv4SeriesValue = "Edsv4_series"; + private const string Dv4SeriesValue = "Dv4_series"; + private const string Dsv4SeriesValue = "Dsv4_series"; + private const string Ddv4SeriesValue = "Ddv4_series"; + private const string Ddsv4SeriesValue = "Ddsv4_series"; + private const string Easv4SeriesValue = "Easv4_series"; + private const string Dasv4SeriesValue = "Dasv4_series"; + private const string Mv2SeriesValue = "Mv2_series"; + private const string Eav4SeriesValue = "Eav4_series"; + private const string Dav4SeriesValue = "Dav4_series"; + private const string Msv2SeriesValue = "Msv2_series"; + private const string Mdsv2SeriesValue = "Mdsv2_series"; + private const string Dv5SeriesValue = "Dv5_series"; + private const string Dsv5SeriesValue = "Dsv5_series"; + private const string Ddv5SeriesValue = "Ddv5_series"; + private const string Ddsv5SeriesValue = "Ddsv5_series"; + private const string Dasv5SeriesValue = "Dasv5_series"; + private const string Dadsv5SeriesValue = "Dadsv5_series"; + private const string Ev5SeriesValue = "Ev5_series"; + private const string Esv5SeriesValue = "Esv5_series"; + private const string Edv5SeriesValue = "Edv5_series"; + private const string Edsv5SeriesValue = "Edsv5_series"; + private const string Easv5SeriesValue = "Easv5_series"; + private const string Eadsv5SeriesValue = "Eadsv5_series"; + private const string Ebsv5SeriesValue = "Ebsv5_series"; + private const string Ebdsv5SeriesValue = "Ebdsv5_series"; + + /// Unknown. + public static AzureVmFamily Unknown { get; } = new AzureVmFamily(UnknownValue); + /// Basic_A0_A4. + public static AzureVmFamily BasicA0A4 { get; } = new AzureVmFamily(BasicA0A4Value); + /// Standard_A0_A7. + public static AzureVmFamily StandardA0A7 { get; } = new AzureVmFamily(StandardA0A7Value); + /// Standard_A8_A11. + public static AzureVmFamily StandardA8A11 { get; } = new AzureVmFamily(StandardA8A11Value); + /// Av2_series. + public static AzureVmFamily Av2Series { get; } = new AzureVmFamily(Av2SeriesValue); + /// D_series. + public static AzureVmFamily DSeries { get; } = new AzureVmFamily(DSeriesValue); + /// Dv2_series. + public static AzureVmFamily Dv2Series { get; } = new AzureVmFamily(Dv2SeriesValue); + /// DS_series. + public static AzureVmFamily DSSeries { get; } = new AzureVmFamily(DSSeriesValue); + /// DSv2_series. + public static AzureVmFamily DSv2Series { get; } = new AzureVmFamily(DSv2SeriesValue); + /// F_series. + public static AzureVmFamily FSeries { get; } = new AzureVmFamily(FSeriesValue); + /// Fs_series. + public static AzureVmFamily FsSeries { get; } = new AzureVmFamily(FsSeriesValue); + /// G_series. + public static AzureVmFamily GSeries { get; } = new AzureVmFamily(GSeriesValue); + /// GS_series. + public static AzureVmFamily GSSeries { get; } = new AzureVmFamily(GSSeriesValue); + /// H_series. + public static AzureVmFamily HSeries { get; } = new AzureVmFamily(HSeriesValue); + /// Ls_series. + public static AzureVmFamily LsSeries { get; } = new AzureVmFamily(LsSeriesValue); + /// Dsv3_series. + public static AzureVmFamily Dsv3Series { get; } = new AzureVmFamily(Dsv3SeriesValue); + /// Dv3_series. + public static AzureVmFamily Dv3Series { get; } = new AzureVmFamily(Dv3SeriesValue); + /// Fsv2_series. + public static AzureVmFamily Fsv2Series { get; } = new AzureVmFamily(Fsv2SeriesValue); + /// Ev3_series. + public static AzureVmFamily Ev3Series { get; } = new AzureVmFamily(Ev3SeriesValue); + /// Esv3_series. + public static AzureVmFamily Esv3Series { get; } = new AzureVmFamily(Esv3SeriesValue); + /// M_series. + public static AzureVmFamily MSeries { get; } = new AzureVmFamily(MSeriesValue); + /// DC_Series. + public static AzureVmFamily DCSeries { get; } = new AzureVmFamily(DCSeriesValue); + /// Lsv2_series. + public static AzureVmFamily Lsv2Series { get; } = new AzureVmFamily(Lsv2SeriesValue); + /// Ev4_series. + public static AzureVmFamily Ev4Series { get; } = new AzureVmFamily(Ev4SeriesValue); + /// Esv4_series. + public static AzureVmFamily Esv4Series { get; } = new AzureVmFamily(Esv4SeriesValue); + /// Edv4_series. + public static AzureVmFamily Edv4Series { get; } = new AzureVmFamily(Edv4SeriesValue); + /// Edsv4_series. + public static AzureVmFamily Edsv4Series { get; } = new AzureVmFamily(Edsv4SeriesValue); + /// Dv4_series. + public static AzureVmFamily Dv4Series { get; } = new AzureVmFamily(Dv4SeriesValue); + /// Dsv4_series. + public static AzureVmFamily Dsv4Series { get; } = new AzureVmFamily(Dsv4SeriesValue); + /// Ddv4_series. + public static AzureVmFamily Ddv4Series { get; } = new AzureVmFamily(Ddv4SeriesValue); + /// Ddsv4_series. + public static AzureVmFamily Ddsv4Series { get; } = new AzureVmFamily(Ddsv4SeriesValue); + /// Easv4_series. + public static AzureVmFamily Easv4Series { get; } = new AzureVmFamily(Easv4SeriesValue); + /// Dasv4_series. + public static AzureVmFamily Dasv4Series { get; } = new AzureVmFamily(Dasv4SeriesValue); + /// Mv2_series. + public static AzureVmFamily Mv2Series { get; } = new AzureVmFamily(Mv2SeriesValue); + /// Eav4_series. + public static AzureVmFamily Eav4Series { get; } = new AzureVmFamily(Eav4SeriesValue); + /// Dav4_series. + public static AzureVmFamily Dav4Series { get; } = new AzureVmFamily(Dav4SeriesValue); + /// Msv2_series. + public static AzureVmFamily Msv2Series { get; } = new AzureVmFamily(Msv2SeriesValue); + /// Mdsv2_series. + public static AzureVmFamily Mdsv2Series { get; } = new AzureVmFamily(Mdsv2SeriesValue); + /// Dv5_series. + public static AzureVmFamily Dv5Series { get; } = new AzureVmFamily(Dv5SeriesValue); + /// Dsv5_series. + public static AzureVmFamily Dsv5Series { get; } = new AzureVmFamily(Dsv5SeriesValue); + /// Ddv5_series. + public static AzureVmFamily Ddv5Series { get; } = new AzureVmFamily(Ddv5SeriesValue); + /// Ddsv5_series. + public static AzureVmFamily Ddsv5Series { get; } = new AzureVmFamily(Ddsv5SeriesValue); + /// Dasv5_series. + public static AzureVmFamily Dasv5Series { get; } = new AzureVmFamily(Dasv5SeriesValue); + /// Dadsv5_series. + public static AzureVmFamily Dadsv5Series { get; } = new AzureVmFamily(Dadsv5SeriesValue); + /// Ev5_series. + public static AzureVmFamily Ev5Series { get; } = new AzureVmFamily(Ev5SeriesValue); + /// Esv5_series. + public static AzureVmFamily Esv5Series { get; } = new AzureVmFamily(Esv5SeriesValue); + /// Edv5_series. + public static AzureVmFamily Edv5Series { get; } = new AzureVmFamily(Edv5SeriesValue); + /// Edsv5_series. + public static AzureVmFamily Edsv5Series { get; } = new AzureVmFamily(Edsv5SeriesValue); + /// Easv5_series. + public static AzureVmFamily Easv5Series { get; } = new AzureVmFamily(Easv5SeriesValue); + /// Eadsv5_series. + public static AzureVmFamily Eadsv5Series { get; } = new AzureVmFamily(Eadsv5SeriesValue); + /// Ebsv5_series. + public static AzureVmFamily Ebsv5Series { get; } = new AzureVmFamily(Ebsv5SeriesValue); + /// Ebdsv5_series. + public static AzureVmFamily Ebdsv5Series { get; } = new AzureVmFamily(Ebdsv5SeriesValue); + /// Determines if two values are the same. + public static bool operator ==(AzureVmFamily left, AzureVmFamily right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureVmFamily left, AzureVmFamily right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureVmFamily(string value) => new AzureVmFamily(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureVmFamily other && Equals(other); + /// + public bool Equals(AzureVmFamily other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureVmSize.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureVmSize.cs new file mode 100644 index 000000000000..da8fdb634624 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureVmSize.cs @@ -0,0 +1,1515 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AzureVmSize. + public readonly partial struct AzureVmSize : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureVmSize(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string BasicA0Value = "Basic_A0"; + private const string BasicA1Value = "Basic_A1"; + private const string BasicA2Value = "Basic_A2"; + private const string BasicA3Value = "Basic_A3"; + private const string BasicA4Value = "Basic_A4"; + private const string StandardA0Value = "Standard_A0"; + private const string StandardA1Value = "Standard_A1"; + private const string StandardA2Value = "Standard_A2"; + private const string StandardA3Value = "Standard_A3"; + private const string StandardA4Value = "Standard_A4"; + private const string StandardA5Value = "Standard_A5"; + private const string StandardA6Value = "Standard_A6"; + private const string StandardA7Value = "Standard_A7"; + private const string StandardA8Value = "Standard_A8"; + private const string StandardA9Value = "Standard_A9"; + private const string StandardA10Value = "Standard_A10"; + private const string StandardA11Value = "Standard_A11"; + private const string StandardA1V2Value = "Standard_A1_v2"; + private const string StandardA2V2Value = "Standard_A2_v2"; + private const string StandardA4V2Value = "Standard_A4_v2"; + private const string StandardA8V2Value = "Standard_A8_v2"; + private const string StandardA2MV2Value = "Standard_A2m_v2"; + private const string StandardA4MV2Value = "Standard_A4m_v2"; + private const string StandardA8MV2Value = "Standard_A8m_v2"; + private const string StandardD1Value = "Standard_D1"; + private const string StandardD2Value = "Standard_D2"; + private const string StandardD3Value = "Standard_D3"; + private const string StandardD4Value = "Standard_D4"; + private const string StandardD11Value = "Standard_D11"; + private const string StandardD12Value = "Standard_D12"; + private const string StandardD13Value = "Standard_D13"; + private const string StandardD14Value = "Standard_D14"; + private const string StandardD1V2Value = "Standard_D1_v2"; + private const string StandardD2V2Value = "Standard_D2_v2"; + private const string StandardD3V2Value = "Standard_D3_v2"; + private const string StandardD4V2Value = "Standard_D4_v2"; + private const string StandardD5V2Value = "Standard_D5_v2"; + private const string StandardD11V2Value = "Standard_D11_v2"; + private const string StandardD12V2Value = "Standard_D12_v2"; + private const string StandardD13V2Value = "Standard_D13_v2"; + private const string StandardD14V2Value = "Standard_D14_v2"; + private const string StandardD15V2Value = "Standard_D15_v2"; + private const string StandardDS1Value = "Standard_DS1"; + private const string StandardDS2Value = "Standard_DS2"; + private const string StandardDS3Value = "Standard_DS3"; + private const string StandardDS4Value = "Standard_DS4"; + private const string StandardDS11Value = "Standard_DS11"; + private const string StandardDS12Value = "Standard_DS12"; + private const string StandardDS13Value = "Standard_DS13"; + private const string StandardDS14Value = "Standard_DS14"; + private const string StandardDS1V2Value = "Standard_DS1_v2"; + private const string StandardDS2V2Value = "Standard_DS2_v2"; + private const string StandardDS3V2Value = "Standard_DS3_v2"; + private const string StandardDS4V2Value = "Standard_DS4_v2"; + private const string StandardDS5V2Value = "Standard_DS5_v2"; + private const string StandardDS11V2Value = "Standard_DS11_v2"; + private const string StandardDS12V2Value = "Standard_DS12_v2"; + private const string StandardDS13V2Value = "Standard_DS13_v2"; + private const string StandardDS14V2Value = "Standard_DS14_v2"; + private const string StandardDS15V2Value = "Standard_DS15_v2"; + private const string StandardF1Value = "Standard_F1"; + private const string StandardF2Value = "Standard_F2"; + private const string StandardF4Value = "Standard_F4"; + private const string StandardF8Value = "Standard_F8"; + private const string StandardF16Value = "Standard_F16"; + private const string StandardF1SValue = "Standard_F1s"; + private const string StandardF2SValue = "Standard_F2s"; + private const string StandardF4SValue = "Standard_F4s"; + private const string StandardF8SValue = "Standard_F8s"; + private const string StandardF16SValue = "Standard_F16s"; + private const string StandardG1Value = "Standard_G1"; + private const string StandardG2Value = "Standard_G2"; + private const string StandardG3Value = "Standard_G3"; + private const string StandardG4Value = "Standard_G4"; + private const string StandardG5Value = "Standard_G5"; + private const string StandardGS1Value = "Standard_GS1"; + private const string StandardGS2Value = "Standard_GS2"; + private const string StandardGS3Value = "Standard_GS3"; + private const string StandardGS4Value = "Standard_GS4"; + private const string StandardGS5Value = "Standard_GS5"; + private const string StandardH8Value = "Standard_H8"; + private const string StandardH16Value = "Standard_H16"; + private const string StandardH8MValue = "Standard_H8m"; + private const string StandardH16MValue = "Standard_H16m"; + private const string StandardH16RValue = "Standard_H16r"; + private const string StandardH16MrValue = "Standard_H16mr"; + private const string StandardL4SValue = "Standard_L4s"; + private const string StandardL8SValue = "Standard_L8s"; + private const string StandardL16SValue = "Standard_L16s"; + private const string StandardL32SValue = "Standard_L32s"; + private const string StandardD2SV3Value = "Standard_D2s_v3"; + private const string StandardD4SV3Value = "Standard_D4s_v3"; + private const string StandardD8SV3Value = "Standard_D8s_v3"; + private const string StandardD16SV3Value = "Standard_D16s_v3"; + private const string StandardD32SV3Value = "Standard_D32s_v3"; + private const string StandardD64SV3Value = "Standard_D64s_v3"; + private const string StandardD2V3Value = "Standard_D2_v3"; + private const string StandardD4V3Value = "Standard_D4_v3"; + private const string StandardD8V3Value = "Standard_D8_v3"; + private const string StandardD16V3Value = "Standard_D16_v3"; + private const string StandardD32V3Value = "Standard_D32_v3"; + private const string StandardD64V3Value = "Standard_D64_v3"; + private const string StandardF2SV2Value = "Standard_F2s_v2"; + private const string StandardF4SV2Value = "Standard_F4s_v2"; + private const string StandardF8SV2Value = "Standard_F8s_v2"; + private const string StandardF16SV2Value = "Standard_F16s_v2"; + private const string StandardF32SV2Value = "Standard_F32s_v2"; + private const string StandardF64SV2Value = "Standard_F64s_v2"; + private const string StandardF72SV2Value = "Standard_F72s_v2"; + private const string StandardE2V3Value = "Standard_E2_v3"; + private const string StandardE4V3Value = "Standard_E4_v3"; + private const string StandardE8V3Value = "Standard_E8_v3"; + private const string StandardE16V3Value = "Standard_E16_v3"; + private const string StandardE32V3Value = "Standard_E32_v3"; + private const string StandardE64V3Value = "Standard_E64_v3"; + private const string StandardE2SV3Value = "Standard_E2s_v3"; + private const string StandardE4SV3Value = "Standard_E4s_v3"; + private const string StandardE8SV3Value = "Standard_E8s_v3"; + private const string StandardE16SV3Value = "Standard_E16s_v3"; + private const string StandardE32SV3Value = "Standard_E32s_v3"; + private const string StandardE64SV3Value = "Standard_E64s_v3"; + private const string StandardM64SValue = "Standard_M64s"; + private const string StandardM64MsValue = "Standard_M64ms"; + private const string StandardM128SValue = "Standard_M128s"; + private const string StandardM128MsValue = "Standard_M128ms"; + private const string StandardDC2SValue = "Standard_DC2s"; + private const string StandardDC4SValue = "Standard_DC4s"; + private const string StandardE20V3Value = "Standard_E20_v3"; + private const string StandardE20SV3Value = "Standard_E20s_v3"; + private const string StandardE64IV3Value = "Standard_E64i_v3"; + private const string StandardE64IsV3Value = "Standard_E64is_v3"; + private const string StandardM8MsValue = "Standard_M8ms"; + private const string StandardM16MsValue = "Standard_M16ms"; + private const string StandardM32LsValue = "Standard_M32ls"; + private const string StandardM32MsValue = "Standard_M32ms"; + private const string StandardM32TsValue = "Standard_M32ts"; + private const string StandardM64Value = "Standard_M64"; + private const string StandardM64LsValue = "Standard_M64ls"; + private const string StandardM64MValue = "Standard_M64m"; + private const string StandardM128Value = "Standard_M128"; + private const string StandardM128MValue = "Standard_M128m"; + private const string StandardL8SV2Value = "Standard_L8s_v2"; + private const string StandardL16SV2Value = "Standard_L16s_v2"; + private const string StandardL32SV2Value = "Standard_L32s_v2"; + private const string StandardL48SV2Value = "Standard_L48s_v2"; + private const string StandardL64SV2Value = "Standard_L64s_v2"; + private const string StandardL80SV2Value = "Standard_L80s_v2"; + private const string StandardD2V4Value = "Standard_D2_v4"; + private const string StandardD4V4Value = "Standard_D4_v4"; + private const string StandardD8V4Value = "Standard_D8_v4"; + private const string StandardD16V4Value = "Standard_D16_v4"; + private const string StandardD32V4Value = "Standard_D32_v4"; + private const string StandardD48V4Value = "Standard_D48_v4"; + private const string StandardD64V4Value = "Standard_D64_v4"; + private const string StandardD2SV4Value = "Standard_D2s_v4"; + private const string StandardD4SV4Value = "Standard_D4s_v4"; + private const string StandardD8SV4Value = "Standard_D8s_v4"; + private const string StandardD16SV4Value = "Standard_D16s_v4"; + private const string StandardD32SV4Value = "Standard_D32s_v4"; + private const string StandardD48SV4Value = "Standard_D48s_v4"; + private const string StandardD64SV4Value = "Standard_D64s_v4"; + private const string StandardD2DV4Value = "Standard_D2d_v4"; + private const string StandardD4DV4Value = "Standard_D4d_v4"; + private const string StandardD8DV4Value = "Standard_D8d_v4"; + private const string StandardD16DV4Value = "Standard_D16d_v4"; + private const string StandardD32DV4Value = "Standard_D32d_v4"; + private const string StandardD48DV4Value = "Standard_D48d_v4"; + private const string StandardD64DV4Value = "Standard_D64d_v4"; + private const string StandardD2DsV4Value = "Standard_D2ds_v4"; + private const string StandardD4DsV4Value = "Standard_D4ds_v4"; + private const string StandardD8DsV4Value = "Standard_D8ds_v4"; + private const string StandardD16DsV4Value = "Standard_D16ds_v4"; + private const string StandardD32DsV4Value = "Standard_D32ds_v4"; + private const string StandardD48DsV4Value = "Standard_D48ds_v4"; + private const string StandardD64DsV4Value = "Standard_D64ds_v4"; + private const string StandardE2V4Value = "Standard_E2_v4"; + private const string StandardE4V4Value = "Standard_E4_v4"; + private const string StandardE8V4Value = "Standard_E8_v4"; + private const string StandardE16V4Value = "Standard_E16_v4"; + private const string StandardE20V4Value = "Standard_E20_v4"; + private const string StandardE32V4Value = "Standard_E32_v4"; + private const string StandardE48V4Value = "Standard_E48_v4"; + private const string StandardE64V4Value = "Standard_E64_v4"; + private const string StandardE2SV4Value = "Standard_E2s_v4"; + private const string StandardE4SV4Value = "Standard_E4s_v4"; + private const string StandardE8SV4Value = "Standard_E8s_v4"; + private const string StandardE16SV4Value = "Standard_E16s_v4"; + private const string StandardE20SV4Value = "Standard_E20s_v4"; + private const string StandardE32SV4Value = "Standard_E32s_v4"; + private const string StandardE48SV4Value = "Standard_E48s_v4"; + private const string StandardE64SV4Value = "Standard_E64s_v4"; + private const string StandardE2DV4Value = "Standard_E2d_v4"; + private const string StandardE4DV4Value = "Standard_E4d_v4"; + private const string StandardE8DV4Value = "Standard_E8d_v4"; + private const string StandardE16DV4Value = "Standard_E16d_v4"; + private const string StandardE20DV4Value = "Standard_E20d_v4"; + private const string StandardE32DV4Value = "Standard_E32d_v4"; + private const string StandardE48DV4Value = "Standard_E48d_v4"; + private const string StandardE64DV4Value = "Standard_E64d_v4"; + private const string StandardE2DsV4Value = "Standard_E2ds_v4"; + private const string StandardE4DsV4Value = "Standard_E4ds_v4"; + private const string StandardE8DsV4Value = "Standard_E8ds_v4"; + private const string StandardE16DsV4Value = "Standard_E16ds_v4"; + private const string StandardE20DsV4Value = "Standard_E20ds_v4"; + private const string StandardE32DsV4Value = "Standard_E32ds_v4"; + private const string StandardE48DsV4Value = "Standard_E48ds_v4"; + private const string StandardE64DsV4Value = "Standard_E64ds_v4"; + private const string StandardE2AsV4Value = "Standard_E2as_v4"; + private const string StandardE4AsV4Value = "Standard_E4as_v4"; + private const string StandardE8AsV4Value = "Standard_E8as_v4"; + private const string StandardE16AsV4Value = "Standard_E16as_v4"; + private const string StandardE20AsV4Value = "Standard_E20as_v4"; + private const string StandardE32AsV4Value = "Standard_E32as_v4"; + private const string StandardE48AsV4Value = "Standard_E48as_v4"; + private const string StandardE64AsV4Value = "Standard_E64as_v4"; + private const string StandardE96AsV4Value = "Standard_E96as_v4"; + private const string StandardD2AsV4Value = "Standard_D2as_v4"; + private const string StandardD4AsV4Value = "Standard_D4as_v4"; + private const string StandardD8AsV4Value = "Standard_D8as_v4"; + private const string StandardD16AsV4Value = "Standard_D16as_v4"; + private const string StandardD32AsV4Value = "Standard_D32as_v4"; + private const string StandardD48AsV4Value = "Standard_D48as_v4"; + private const string StandardD64AsV4Value = "Standard_D64as_v4"; + private const string StandardD96AsV4Value = "Standard_D96as_v4"; + private const string StandardM208MsV2Value = "Standard_M208ms_v2"; + private const string StandardM208SV2Value = "Standard_M208s_v2"; + private const string StandardM416MsV2Value = "Standard_M416ms_v2"; + private const string StandardM416SV2Value = "Standard_M416s_v2"; + private const string StandardF48SV2Value = "Standard_F48s_v2"; + private const string StandardE48V3Value = "Standard_E48_v3"; + private const string StandardE48SV3Value = "Standard_E48s_v3"; + private const string StandardE80IsV4Value = "Standard_E80is_v4"; + private const string StandardE80IdsV4Value = "Standard_E80ids_v4"; + private const string StandardE2AV4Value = "Standard_E2a_v4"; + private const string StandardE4AV4Value = "Standard_E4a_v4"; + private const string StandardE8AV4Value = "Standard_E8a_v4"; + private const string StandardE16AV4Value = "Standard_E16a_v4"; + private const string StandardE20AV4Value = "Standard_E20a_v4"; + private const string StandardE32AV4Value = "Standard_E32a_v4"; + private const string StandardE48AV4Value = "Standard_E48a_v4"; + private const string StandardE64AV4Value = "Standard_E64a_v4"; + private const string StandardE96AV4Value = "Standard_E96a_v4"; + private const string StandardD2AV4Value = "Standard_D2a_v4"; + private const string StandardD4AV4Value = "Standard_D4a_v4"; + private const string StandardD8AV4Value = "Standard_D8a_v4"; + private const string StandardD16AV4Value = "Standard_D16a_v4"; + private const string StandardD32AV4Value = "Standard_D32a_v4"; + private const string StandardD48AV4Value = "Standard_D48a_v4"; + private const string StandardD64AV4Value = "Standard_D64a_v4"; + private const string StandardD96AV4Value = "Standard_D96a_v4"; + private const string StandardM32MsV2Value = "Standard_M32ms_v2"; + private const string StandardM64SV2Value = "Standard_M64s_v2"; + private const string StandardM64MsV2Value = "Standard_M64ms_v2"; + private const string StandardM128SV2Value = "Standard_M128s_v2"; + private const string StandardM128MsV2Value = "Standard_M128ms_v2"; + private const string StandardM192IsV2Value = "Standard_M192is_v2"; + private const string StandardM192ImsV2Value = "Standard_M192ims_v2"; + private const string StandardM32DmsV2Value = "Standard_M32dms_v2"; + private const string StandardM64DsV2Value = "Standard_M64ds_v2"; + private const string StandardM64DmsV2Value = "Standard_M64dms_v2"; + private const string StandardM128DsV2Value = "Standard_M128ds_v2"; + private const string StandardM128DmsV2Value = "Standard_M128dms_v2"; + private const string StandardM192IdsV2Value = "Standard_M192ids_v2"; + private const string StandardM192IdmsV2Value = "Standard_M192idms_v2"; + private const string StandardD2V5Value = "Standard_D2_v5"; + private const string StandardD4V5Value = "Standard_D4_v5"; + private const string StandardD8V5Value = "Standard_D8_v5"; + private const string StandardD16V5Value = "Standard_D16_v5"; + private const string StandardD32V5Value = "Standard_D32_v5"; + private const string StandardD48V5Value = "Standard_D48_v5"; + private const string StandardD64V5Value = "Standard_D64_v5"; + private const string StandardD96V5Value = "Standard_D96_v5"; + private const string StandardD2SV5Value = "Standard_D2s_v5"; + private const string StandardD4SV5Value = "Standard_D4s_v5"; + private const string StandardD8SV5Value = "Standard_D8s_v5"; + private const string StandardD16SV5Value = "Standard_D16s_v5"; + private const string StandardD32SV5Value = "Standard_D32s_v5"; + private const string StandardD48SV5Value = "Standard_D48s_v5"; + private const string StandardD64SV5Value = "Standard_D64s_v5"; + private const string StandardD96SV5Value = "Standard_D96s_v5"; + private const string StandardD2DV5Value = "Standard_D2d_v5"; + private const string StandardD4DV5Value = "Standard_D4d_v5"; + private const string StandardD8DV5Value = "Standard_D8d_v5"; + private const string StandardD16DV5Value = "Standard_D16d_v5"; + private const string StandardD32DV5Value = "Standard_D32d_v5"; + private const string StandardD48DV5Value = "Standard_D48d_v5"; + private const string StandardD64DV5Value = "Standard_D64d_v5"; + private const string StandardD96DV5Value = "Standard_D96d_v5"; + private const string StandardD2DsV5Value = "Standard_D2ds_v5"; + private const string StandardD4DsV5Value = "Standard_D4ds_v5"; + private const string StandardD8DsV5Value = "Standard_D8ds_v5"; + private const string StandardD16DsV5Value = "Standard_D16ds_v5"; + private const string StandardD32DsV5Value = "Standard_D32ds_v5"; + private const string StandardD48DsV5Value = "Standard_D48ds_v5"; + private const string StandardD64DsV5Value = "Standard_D64ds_v5"; + private const string StandardD96DsV5Value = "Standard_D96ds_v5"; + private const string StandardD2AsV5Value = "Standard_D2as_v5"; + private const string StandardD4AsV5Value = "Standard_D4as_v5"; + private const string StandardD8AsV5Value = "Standard_D8as_v5"; + private const string StandardD16AsV5Value = "Standard_D16as_v5"; + private const string StandardD32AsV5Value = "Standard_D32as_v5"; + private const string StandardD48AsV5Value = "Standard_D48as_v5"; + private const string StandardD64AsV5Value = "Standard_D64as_v5"; + private const string StandardD96AsV5Value = "Standard_D96as_v5"; + private const string StandardD2AdsV5Value = "Standard_D2ads_v5"; + private const string StandardD4AdsV5Value = "Standard_D4ads_v5"; + private const string StandardD8AdsV5Value = "Standard_D8ads_v5"; + private const string StandardD16AdsV5Value = "Standard_D16ads_v5"; + private const string StandardD32AdsV5Value = "Standard_D32ads_v5"; + private const string StandardD48AdsV5Value = "Standard_D48ads_v5"; + private const string StandardD64AdsV5Value = "Standard_D64ads_v5"; + private const string StandardD96AdsV5Value = "Standard_D96ads_v5"; + private const string StandardE2V5Value = "Standard_E2_v5"; + private const string StandardE4V5Value = "Standard_E4_v5"; + private const string StandardE8V5Value = "Standard_E8_v5"; + private const string StandardE16V5Value = "Standard_E16_v5"; + private const string StandardE20V5Value = "Standard_E20_v5"; + private const string StandardE32V5Value = "Standard_E32_v5"; + private const string StandardE48V5Value = "Standard_E48_v5"; + private const string StandardE64V5Value = "Standard_E64_v5"; + private const string StandardE96V5Value = "Standard_E96_v5"; + private const string StandardE104IV5Value = "Standard_E104i_v5"; + private const string StandardE2SV5Value = "Standard_E2s_v5"; + private const string StandardE4SV5Value = "Standard_E4s_v5"; + private const string StandardE8SV5Value = "Standard_E8s_v5"; + private const string StandardE16SV5Value = "Standard_E16s_v5"; + private const string StandardE20SV5Value = "Standard_E20s_v5"; + private const string StandardE32SV5Value = "Standard_E32s_v5"; + private const string StandardE48SV5Value = "Standard_E48s_v5"; + private const string StandardE64SV5Value = "Standard_E64s_v5"; + private const string StandardE96SV5Value = "Standard_E96s_v5"; + private const string StandardE104IsV5Value = "Standard_E104is_v5"; + private const string StandardE2DV5Value = "Standard_E2d_v5"; + private const string StandardE4DV5Value = "Standard_E4d_v5"; + private const string StandardE8DV5Value = "Standard_E8d_v5"; + private const string StandardE16DV5Value = "Standard_E16d_v5"; + private const string StandardE20DV5Value = "Standard_E20d_v5"; + private const string StandardE32DV5Value = "Standard_E32d_v5"; + private const string StandardE48DV5Value = "Standard_E48d_v5"; + private const string StandardE64DV5Value = "Standard_E64d_v5"; + private const string StandardE96DV5Value = "Standard_E96d_v5"; + private const string StandardE104IdV5Value = "Standard_E104id_v5"; + private const string StandardE2DsV5Value = "Standard_E2ds_v5"; + private const string StandardE4DsV5Value = "Standard_E4ds_v5"; + private const string StandardE8DsV5Value = "Standard_E8ds_v5"; + private const string StandardE16DsV5Value = "Standard_E16ds_v5"; + private const string StandardE20DsV5Value = "Standard_E20ds_v5"; + private const string StandardE32DsV5Value = "Standard_E32ds_v5"; + private const string StandardE48DsV5Value = "Standard_E48ds_v5"; + private const string StandardE64DsV5Value = "Standard_E64ds_v5"; + private const string StandardE96DsV5Value = "Standard_E96ds_v5"; + private const string StandardE104IdsV5Value = "Standard_E104ids_v5"; + private const string StandardE2AsV5Value = "Standard_E2as_v5"; + private const string StandardE4AsV5Value = "Standard_E4as_v5"; + private const string StandardE8AsV5Value = "Standard_E8as_v5"; + private const string StandardE16AsV5Value = "Standard_E16as_v5"; + private const string StandardE20AsV5Value = "Standard_E20as_v5"; + private const string StandardE32AsV5Value = "Standard_E32as_v5"; + private const string StandardE48AsV5Value = "Standard_E48as_v5"; + private const string StandardE64AsV5Value = "Standard_E64as_v5"; + private const string StandardE96AsV5Value = "Standard_E96as_v5"; + private const string StandardE2AdsV5Value = "Standard_E2ads_v5"; + private const string StandardE4AdsV5Value = "Standard_E4ads_v5"; + private const string StandardE8AdsV5Value = "Standard_E8ads_v5"; + private const string StandardE16AdsV5Value = "Standard_E16ads_v5"; + private const string StandardE20AdsV5Value = "Standard_E20ads_v5"; + private const string StandardE32AdsV5Value = "Standard_E32ads_v5"; + private const string StandardE48AdsV5Value = "Standard_E48ads_v5"; + private const string StandardE64AdsV5Value = "Standard_E64ads_v5"; + private const string StandardE96AdsV5Value = "Standard_E96ads_v5"; + private const string StandardM82MsValue = "Standard_M8_2ms"; + private const string StandardM84MsValue = "Standard_M8_4ms"; + private const string StandardM164MsValue = "Standard_M16_4ms"; + private const string StandardM168MsValue = "Standard_M16_8ms"; + private const string StandardM328MsValue = "Standard_M32_8ms"; + private const string StandardM3216MsValue = "Standard_M32_16ms"; + private const string StandardM6432MsValue = "Standard_M64_32ms"; + private const string StandardM6416MsValue = "Standard_M64_16ms"; + private const string StandardM12864MsValue = "Standard_M128_64ms"; + private const string StandardM12832MsValue = "Standard_M128_32ms"; + private const string StandardE42SV3Value = "Standard_E4_2s_v3"; + private const string StandardE84SV3Value = "Standard_E8_4s_v3"; + private const string StandardE82SV3Value = "Standard_E8_2s_v3"; + private const string StandardE168SV3Value = "Standard_E16_8s_v3"; + private const string StandardE164SV3Value = "Standard_E16_4s_v3"; + private const string StandardE3216SV3Value = "Standard_E32_16s_v3"; + private const string StandardE328SV3Value = "Standard_E32_8s_v3"; + private const string StandardE6432SV3Value = "Standard_E64_32s_v3"; + private const string StandardE6416SV3Value = "Standard_E64_16s_v3"; + private const string StandardE42SV4Value = "Standard_E4_2s_v4"; + private const string StandardE84SV4Value = "Standard_E8_4s_v4"; + private const string StandardE82SV4Value = "Standard_E8_2s_v4"; + private const string StandardE168SV4Value = "Standard_E16_8s_v4"; + private const string StandardE164SV4Value = "Standard_E16_4s_v4"; + private const string StandardE3216SV4Value = "Standard_E32_16s_v4"; + private const string StandardE328SV4Value = "Standard_E32_8s_v4"; + private const string StandardE6432SV4Value = "Standard_E64_32s_v4"; + private const string StandardE6416SV4Value = "Standard_E64_16s_v4"; + private const string StandardE42DsV4Value = "Standard_E4_2ds_v4"; + private const string StandardE84DsV4Value = "Standard_E8_4ds_v4"; + private const string StandardE82DsV4Value = "Standard_E8_2ds_v4"; + private const string StandardE168DsV4Value = "Standard_E16_8ds_v4"; + private const string StandardE164DsV4Value = "Standard_E16_4ds_v4"; + private const string StandardE3216DsV4Value = "Standard_E32_16ds_v4"; + private const string StandardE328DsV4Value = "Standard_E32_8ds_v4"; + private const string StandardE6432DsV4Value = "Standard_E64_32ds_v4"; + private const string StandardE6416DsV4Value = "Standard_E64_16ds_v4"; + private const string StandardE42AsV4Value = "Standard_E4_2as_v4"; + private const string StandardE84AsV4Value = "Standard_E8_4as_v4"; + private const string StandardE82AsV4Value = "Standard_E8_2as_v4"; + private const string StandardE168AsV4Value = "Standard_E16_8as_v4"; + private const string StandardE164AsV4Value = "Standard_E16_4as_v4"; + private const string StandardE3216AsV4Value = "Standard_E32_16as_v4"; + private const string StandardE328AsV4Value = "Standard_E32_8as_v4"; + private const string StandardE6432AsV4Value = "Standard_E64_32as_v4"; + private const string StandardE6416AsV4Value = "Standard_E64_16as_v4"; + private const string StandardE9648AsV4Value = "Standard_E96_48as_v4"; + private const string StandardE9624AsV4Value = "Standard_E96_24as_v4"; + private const string StandardE42AdsV5Value = "Standard_E4_2ads_v5"; + private const string StandardE84AdsV5Value = "Standard_E8_4ads_v5"; + private const string StandardE82AdsV5Value = "Standard_E8_2ads_v5"; + private const string StandardE168AdsV5Value = "Standard_E16_8ads_v5"; + private const string StandardE164AdsV5Value = "Standard_E16_4ads_v5"; + private const string StandardE3216AdsV5Value = "Standard_E32_16ads_v5"; + private const string StandardE328AdsV5Value = "Standard_E32_8ads_v5"; + private const string StandardE6432AdsV5Value = "Standard_E64_32ads_v5"; + private const string StandardE6416AdsV5Value = "Standard_E64_16ads_v5"; + private const string StandardE9648AdsV5Value = "Standard_E96_48ads_v5"; + private const string StandardE9624AdsV5Value = "Standard_E96_24ads_v5"; + private const string StandardE42SV5Value = "Standard_E4_2s_v5"; + private const string StandardE84SV5Value = "Standard_E8_4s_v5"; + private const string StandardE82SV5Value = "Standard_E8_2s_v5"; + private const string StandardE168SV5Value = "Standard_E16_8s_v5"; + private const string StandardE164SV5Value = "Standard_E16_4s_v5"; + private const string StandardE3216SV5Value = "Standard_E32_16s_v5"; + private const string StandardE328SV5Value = "Standard_E32_8s_v5"; + private const string StandardE6432SV5Value = "Standard_E64_32s_v5"; + private const string StandardE6416SV5Value = "Standard_E64_16s_v5"; + private const string StandardE9648SV5Value = "Standard_E96_48s_v5"; + private const string StandardE9624SV5Value = "Standard_E96_24s_v5"; + private const string StandardE42DsV5Value = "Standard_E4_2ds_v5"; + private const string StandardE84DsV5Value = "Standard_E8_4ds_v5"; + private const string StandardE82DsV5Value = "Standard_E8_2ds_v5"; + private const string StandardE168DsV5Value = "Standard_E16_8ds_v5"; + private const string StandardE164DsV5Value = "Standard_E16_4ds_v5"; + private const string StandardE3216DsV5Value = "Standard_E32_16ds_v5"; + private const string StandardE328DsV5Value = "Standard_E32_8ds_v5"; + private const string StandardE6432DsV5Value = "Standard_E64_32ds_v5"; + private const string StandardE6416DsV5Value = "Standard_E64_16ds_v5"; + private const string StandardE9648DsV5Value = "Standard_E96_48ds_v5"; + private const string StandardE9624DsV5Value = "Standard_E96_24ds_v5"; + private const string StandardE42AsV5Value = "Standard_E4_2as_v5"; + private const string StandardE84AsV5Value = "Standard_E8_4as_v5"; + private const string StandardE82AsV5Value = "Standard_E8_2as_v5"; + private const string StandardE168AsV5Value = "Standard_E16_8as_v5"; + private const string StandardE164AsV5Value = "Standard_E16_4as_v5"; + private const string StandardE3216AsV5Value = "Standard_E32_16as_v5"; + private const string StandardE328AsV5Value = "Standard_E32_8as_v5"; + private const string StandardE6432AsV5Value = "Standard_E64_32as_v5"; + private const string StandardE6416AsV5Value = "Standard_E64_16as_v5"; + private const string StandardE9648AsV5Value = "Standard_E96_48as_v5"; + private const string StandardE9624AsV5Value = "Standard_E96_24as_v5"; + private const string StandardGS48Value = "Standard_GS4_8"; + private const string StandardGS44Value = "Standard_GS4_4"; + private const string StandardGS516Value = "Standard_GS5_16"; + private const string StandardGS58Value = "Standard_GS5_8"; + private const string StandardDS111V2Value = "Standard_DS11_1_v2"; + private const string StandardDS122V2Value = "Standard_DS12_2_v2"; + private const string StandardDS121V2Value = "Standard_DS12_1_v2"; + private const string StandardDS134V2Value = "Standard_DS13_4_v2"; + private const string StandardDS132V2Value = "Standard_DS13_2_v2"; + private const string StandardDS148V2Value = "Standard_DS14_8_v2"; + private const string StandardDS144V2Value = "Standard_DS14_4_v2"; + private const string StandardM416208SV2Value = "Standard_M416_208s_v2"; + private const string StandardM416208MsV2Value = "Standard_M416_208ms_v2"; + private const string StandardE2BsV5Value = "Standard_E2bs_v5"; + private const string StandardE4BsV5Value = "Standard_E4bs_v5"; + private const string StandardE8BsV5Value = "Standard_E8bs_v5"; + private const string StandardE16BsV5Value = "Standard_E16bs_v5"; + private const string StandardE32BsV5Value = "Standard_E32bs_v5"; + private const string StandardE48BsV5Value = "Standard_E48bs_v5"; + private const string StandardE64BsV5Value = "Standard_E64bs_v5"; + private const string StandardE2BdsV5Value = "Standard_E2bds_v5"; + private const string StandardE4BdsV5Value = "Standard_E4bds_v5"; + private const string StandardE8BdsV5Value = "Standard_E8bds_v5"; + private const string StandardE16BdsV5Value = "Standard_E16bds_v5"; + private const string StandardE32BdsV5Value = "Standard_E32bds_v5"; + private const string StandardE48BdsV5Value = "Standard_E48bds_v5"; + private const string StandardE64BdsV5Value = "Standard_E64bds_v5"; + + /// Unknown. + public static AzureVmSize Unknown { get; } = new AzureVmSize(UnknownValue); + /// Basic_A0. + public static AzureVmSize BasicA0 { get; } = new AzureVmSize(BasicA0Value); + /// Basic_A1. + public static AzureVmSize BasicA1 { get; } = new AzureVmSize(BasicA1Value); + /// Basic_A2. + public static AzureVmSize BasicA2 { get; } = new AzureVmSize(BasicA2Value); + /// Basic_A3. + public static AzureVmSize BasicA3 { get; } = new AzureVmSize(BasicA3Value); + /// Basic_A4. + public static AzureVmSize BasicA4 { get; } = new AzureVmSize(BasicA4Value); + /// Standard_A0. + public static AzureVmSize StandardA0 { get; } = new AzureVmSize(StandardA0Value); + /// Standard_A1. + public static AzureVmSize StandardA1 { get; } = new AzureVmSize(StandardA1Value); + /// Standard_A2. + public static AzureVmSize StandardA2 { get; } = new AzureVmSize(StandardA2Value); + /// Standard_A3. + public static AzureVmSize StandardA3 { get; } = new AzureVmSize(StandardA3Value); + /// Standard_A4. + public static AzureVmSize StandardA4 { get; } = new AzureVmSize(StandardA4Value); + /// Standard_A5. + public static AzureVmSize StandardA5 { get; } = new AzureVmSize(StandardA5Value); + /// Standard_A6. + public static AzureVmSize StandardA6 { get; } = new AzureVmSize(StandardA6Value); + /// Standard_A7. + public static AzureVmSize StandardA7 { get; } = new AzureVmSize(StandardA7Value); + /// Standard_A8. + public static AzureVmSize StandardA8 { get; } = new AzureVmSize(StandardA8Value); + /// Standard_A9. + public static AzureVmSize StandardA9 { get; } = new AzureVmSize(StandardA9Value); + /// Standard_A10. + public static AzureVmSize StandardA10 { get; } = new AzureVmSize(StandardA10Value); + /// Standard_A11. + public static AzureVmSize StandardA11 { get; } = new AzureVmSize(StandardA11Value); + /// Standard_A1_v2. + public static AzureVmSize StandardA1V2 { get; } = new AzureVmSize(StandardA1V2Value); + /// Standard_A2_v2. + public static AzureVmSize StandardA2V2 { get; } = new AzureVmSize(StandardA2V2Value); + /// Standard_A4_v2. + public static AzureVmSize StandardA4V2 { get; } = new AzureVmSize(StandardA4V2Value); + /// Standard_A8_v2. + public static AzureVmSize StandardA8V2 { get; } = new AzureVmSize(StandardA8V2Value); + /// Standard_A2m_v2. + public static AzureVmSize StandardA2MV2 { get; } = new AzureVmSize(StandardA2MV2Value); + /// Standard_A4m_v2. + public static AzureVmSize StandardA4MV2 { get; } = new AzureVmSize(StandardA4MV2Value); + /// Standard_A8m_v2. + public static AzureVmSize StandardA8MV2 { get; } = new AzureVmSize(StandardA8MV2Value); + /// Standard_D1. + public static AzureVmSize StandardD1 { get; } = new AzureVmSize(StandardD1Value); + /// Standard_D2. + public static AzureVmSize StandardD2 { get; } = new AzureVmSize(StandardD2Value); + /// Standard_D3. + public static AzureVmSize StandardD3 { get; } = new AzureVmSize(StandardD3Value); + /// Standard_D4. + public static AzureVmSize StandardD4 { get; } = new AzureVmSize(StandardD4Value); + /// Standard_D11. + public static AzureVmSize StandardD11 { get; } = new AzureVmSize(StandardD11Value); + /// Standard_D12. + public static AzureVmSize StandardD12 { get; } = new AzureVmSize(StandardD12Value); + /// Standard_D13. + public static AzureVmSize StandardD13 { get; } = new AzureVmSize(StandardD13Value); + /// Standard_D14. + public static AzureVmSize StandardD14 { get; } = new AzureVmSize(StandardD14Value); + /// Standard_D1_v2. + public static AzureVmSize StandardD1V2 { get; } = new AzureVmSize(StandardD1V2Value); + /// Standard_D2_v2. + public static AzureVmSize StandardD2V2 { get; } = new AzureVmSize(StandardD2V2Value); + /// Standard_D3_v2. + public static AzureVmSize StandardD3V2 { get; } = new AzureVmSize(StandardD3V2Value); + /// Standard_D4_v2. + public static AzureVmSize StandardD4V2 { get; } = new AzureVmSize(StandardD4V2Value); + /// Standard_D5_v2. + public static AzureVmSize StandardD5V2 { get; } = new AzureVmSize(StandardD5V2Value); + /// Standard_D11_v2. + public static AzureVmSize StandardD11V2 { get; } = new AzureVmSize(StandardD11V2Value); + /// Standard_D12_v2. + public static AzureVmSize StandardD12V2 { get; } = new AzureVmSize(StandardD12V2Value); + /// Standard_D13_v2. + public static AzureVmSize StandardD13V2 { get; } = new AzureVmSize(StandardD13V2Value); + /// Standard_D14_v2. + public static AzureVmSize StandardD14V2 { get; } = new AzureVmSize(StandardD14V2Value); + /// Standard_D15_v2. + public static AzureVmSize StandardD15V2 { get; } = new AzureVmSize(StandardD15V2Value); + /// Standard_DS1. + public static AzureVmSize StandardDS1 { get; } = new AzureVmSize(StandardDS1Value); + /// Standard_DS2. + public static AzureVmSize StandardDS2 { get; } = new AzureVmSize(StandardDS2Value); + /// Standard_DS3. + public static AzureVmSize StandardDS3 { get; } = new AzureVmSize(StandardDS3Value); + /// Standard_DS4. + public static AzureVmSize StandardDS4 { get; } = new AzureVmSize(StandardDS4Value); + /// Standard_DS11. + public static AzureVmSize StandardDS11 { get; } = new AzureVmSize(StandardDS11Value); + /// Standard_DS12. + public static AzureVmSize StandardDS12 { get; } = new AzureVmSize(StandardDS12Value); + /// Standard_DS13. + public static AzureVmSize StandardDS13 { get; } = new AzureVmSize(StandardDS13Value); + /// Standard_DS14. + public static AzureVmSize StandardDS14 { get; } = new AzureVmSize(StandardDS14Value); + /// Standard_DS1_v2. + public static AzureVmSize StandardDS1V2 { get; } = new AzureVmSize(StandardDS1V2Value); + /// Standard_DS2_v2. + public static AzureVmSize StandardDS2V2 { get; } = new AzureVmSize(StandardDS2V2Value); + /// Standard_DS3_v2. + public static AzureVmSize StandardDS3V2 { get; } = new AzureVmSize(StandardDS3V2Value); + /// Standard_DS4_v2. + public static AzureVmSize StandardDS4V2 { get; } = new AzureVmSize(StandardDS4V2Value); + /// Standard_DS5_v2. + public static AzureVmSize StandardDS5V2 { get; } = new AzureVmSize(StandardDS5V2Value); + /// Standard_DS11_v2. + public static AzureVmSize StandardDS11V2 { get; } = new AzureVmSize(StandardDS11V2Value); + /// Standard_DS12_v2. + public static AzureVmSize StandardDS12V2 { get; } = new AzureVmSize(StandardDS12V2Value); + /// Standard_DS13_v2. + public static AzureVmSize StandardDS13V2 { get; } = new AzureVmSize(StandardDS13V2Value); + /// Standard_DS14_v2. + public static AzureVmSize StandardDS14V2 { get; } = new AzureVmSize(StandardDS14V2Value); + /// Standard_DS15_v2. + public static AzureVmSize StandardDS15V2 { get; } = new AzureVmSize(StandardDS15V2Value); + /// Standard_F1. + public static AzureVmSize StandardF1 { get; } = new AzureVmSize(StandardF1Value); + /// Standard_F2. + public static AzureVmSize StandardF2 { get; } = new AzureVmSize(StandardF2Value); + /// Standard_F4. + public static AzureVmSize StandardF4 { get; } = new AzureVmSize(StandardF4Value); + /// Standard_F8. + public static AzureVmSize StandardF8 { get; } = new AzureVmSize(StandardF8Value); + /// Standard_F16. + public static AzureVmSize StandardF16 { get; } = new AzureVmSize(StandardF16Value); + /// Standard_F1s. + public static AzureVmSize StandardF1S { get; } = new AzureVmSize(StandardF1SValue); + /// Standard_F2s. + public static AzureVmSize StandardF2S { get; } = new AzureVmSize(StandardF2SValue); + /// Standard_F4s. + public static AzureVmSize StandardF4S { get; } = new AzureVmSize(StandardF4SValue); + /// Standard_F8s. + public static AzureVmSize StandardF8S { get; } = new AzureVmSize(StandardF8SValue); + /// Standard_F16s. + public static AzureVmSize StandardF16S { get; } = new AzureVmSize(StandardF16SValue); + /// Standard_G1. + public static AzureVmSize StandardG1 { get; } = new AzureVmSize(StandardG1Value); + /// Standard_G2. + public static AzureVmSize StandardG2 { get; } = new AzureVmSize(StandardG2Value); + /// Standard_G3. + public static AzureVmSize StandardG3 { get; } = new AzureVmSize(StandardG3Value); + /// Standard_G4. + public static AzureVmSize StandardG4 { get; } = new AzureVmSize(StandardG4Value); + /// Standard_G5. + public static AzureVmSize StandardG5 { get; } = new AzureVmSize(StandardG5Value); + /// Standard_GS1. + public static AzureVmSize StandardGS1 { get; } = new AzureVmSize(StandardGS1Value); + /// Standard_GS2. + public static AzureVmSize StandardGS2 { get; } = new AzureVmSize(StandardGS2Value); + /// Standard_GS3. + public static AzureVmSize StandardGS3 { get; } = new AzureVmSize(StandardGS3Value); + /// Standard_GS4. + public static AzureVmSize StandardGS4 { get; } = new AzureVmSize(StandardGS4Value); + /// Standard_GS5. + public static AzureVmSize StandardGS5 { get; } = new AzureVmSize(StandardGS5Value); + /// Standard_H8. + public static AzureVmSize StandardH8 { get; } = new AzureVmSize(StandardH8Value); + /// Standard_H16. + public static AzureVmSize StandardH16 { get; } = new AzureVmSize(StandardH16Value); + /// Standard_H8m. + public static AzureVmSize StandardH8M { get; } = new AzureVmSize(StandardH8MValue); + /// Standard_H16m. + public static AzureVmSize StandardH16M { get; } = new AzureVmSize(StandardH16MValue); + /// Standard_H16r. + public static AzureVmSize StandardH16R { get; } = new AzureVmSize(StandardH16RValue); + /// Standard_H16mr. + public static AzureVmSize StandardH16Mr { get; } = new AzureVmSize(StandardH16MrValue); + /// Standard_L4s. + public static AzureVmSize StandardL4S { get; } = new AzureVmSize(StandardL4SValue); + /// Standard_L8s. + public static AzureVmSize StandardL8S { get; } = new AzureVmSize(StandardL8SValue); + /// Standard_L16s. + public static AzureVmSize StandardL16S { get; } = new AzureVmSize(StandardL16SValue); + /// Standard_L32s. + public static AzureVmSize StandardL32S { get; } = new AzureVmSize(StandardL32SValue); + /// Standard_D2s_v3. + public static AzureVmSize StandardD2SV3 { get; } = new AzureVmSize(StandardD2SV3Value); + /// Standard_D4s_v3. + public static AzureVmSize StandardD4SV3 { get; } = new AzureVmSize(StandardD4SV3Value); + /// Standard_D8s_v3. + public static AzureVmSize StandardD8SV3 { get; } = new AzureVmSize(StandardD8SV3Value); + /// Standard_D16s_v3. + public static AzureVmSize StandardD16SV3 { get; } = new AzureVmSize(StandardD16SV3Value); + /// Standard_D32s_v3. + public static AzureVmSize StandardD32SV3 { get; } = new AzureVmSize(StandardD32SV3Value); + /// Standard_D64s_v3. + public static AzureVmSize StandardD64SV3 { get; } = new AzureVmSize(StandardD64SV3Value); + /// Standard_D2_v3. + public static AzureVmSize StandardD2V3 { get; } = new AzureVmSize(StandardD2V3Value); + /// Standard_D4_v3. + public static AzureVmSize StandardD4V3 { get; } = new AzureVmSize(StandardD4V3Value); + /// Standard_D8_v3. + public static AzureVmSize StandardD8V3 { get; } = new AzureVmSize(StandardD8V3Value); + /// Standard_D16_v3. + public static AzureVmSize StandardD16V3 { get; } = new AzureVmSize(StandardD16V3Value); + /// Standard_D32_v3. + public static AzureVmSize StandardD32V3 { get; } = new AzureVmSize(StandardD32V3Value); + /// Standard_D64_v3. + public static AzureVmSize StandardD64V3 { get; } = new AzureVmSize(StandardD64V3Value); + /// Standard_F2s_v2. + public static AzureVmSize StandardF2SV2 { get; } = new AzureVmSize(StandardF2SV2Value); + /// Standard_F4s_v2. + public static AzureVmSize StandardF4SV2 { get; } = new AzureVmSize(StandardF4SV2Value); + /// Standard_F8s_v2. + public static AzureVmSize StandardF8SV2 { get; } = new AzureVmSize(StandardF8SV2Value); + /// Standard_F16s_v2. + public static AzureVmSize StandardF16SV2 { get; } = new AzureVmSize(StandardF16SV2Value); + /// Standard_F32s_v2. + public static AzureVmSize StandardF32SV2 { get; } = new AzureVmSize(StandardF32SV2Value); + /// Standard_F64s_v2. + public static AzureVmSize StandardF64SV2 { get; } = new AzureVmSize(StandardF64SV2Value); + /// Standard_F72s_v2. + public static AzureVmSize StandardF72SV2 { get; } = new AzureVmSize(StandardF72SV2Value); + /// Standard_E2_v3. + public static AzureVmSize StandardE2V3 { get; } = new AzureVmSize(StandardE2V3Value); + /// Standard_E4_v3. + public static AzureVmSize StandardE4V3 { get; } = new AzureVmSize(StandardE4V3Value); + /// Standard_E8_v3. + public static AzureVmSize StandardE8V3 { get; } = new AzureVmSize(StandardE8V3Value); + /// Standard_E16_v3. + public static AzureVmSize StandardE16V3 { get; } = new AzureVmSize(StandardE16V3Value); + /// Standard_E32_v3. + public static AzureVmSize StandardE32V3 { get; } = new AzureVmSize(StandardE32V3Value); + /// Standard_E64_v3. + public static AzureVmSize StandardE64V3 { get; } = new AzureVmSize(StandardE64V3Value); + /// Standard_E2s_v3. + public static AzureVmSize StandardE2SV3 { get; } = new AzureVmSize(StandardE2SV3Value); + /// Standard_E4s_v3. + public static AzureVmSize StandardE4SV3 { get; } = new AzureVmSize(StandardE4SV3Value); + /// Standard_E8s_v3. + public static AzureVmSize StandardE8SV3 { get; } = new AzureVmSize(StandardE8SV3Value); + /// Standard_E16s_v3. + public static AzureVmSize StandardE16SV3 { get; } = new AzureVmSize(StandardE16SV3Value); + /// Standard_E32s_v3. + public static AzureVmSize StandardE32SV3 { get; } = new AzureVmSize(StandardE32SV3Value); + /// Standard_E64s_v3. + public static AzureVmSize StandardE64SV3 { get; } = new AzureVmSize(StandardE64SV3Value); + /// Standard_M64s. + public static AzureVmSize StandardM64S { get; } = new AzureVmSize(StandardM64SValue); + /// Standard_M64ms. + public static AzureVmSize StandardM64Ms { get; } = new AzureVmSize(StandardM64MsValue); + /// Standard_M128s. + public static AzureVmSize StandardM128S { get; } = new AzureVmSize(StandardM128SValue); + /// Standard_M128ms. + public static AzureVmSize StandardM128Ms { get; } = new AzureVmSize(StandardM128MsValue); + /// Standard_DC2s. + public static AzureVmSize StandardDC2S { get; } = new AzureVmSize(StandardDC2SValue); + /// Standard_DC4s. + public static AzureVmSize StandardDC4S { get; } = new AzureVmSize(StandardDC4SValue); + /// Standard_E20_v3. + public static AzureVmSize StandardE20V3 { get; } = new AzureVmSize(StandardE20V3Value); + /// Standard_E20s_v3. + public static AzureVmSize StandardE20SV3 { get; } = new AzureVmSize(StandardE20SV3Value); + /// Standard_E64i_v3. + public static AzureVmSize StandardE64IV3 { get; } = new AzureVmSize(StandardE64IV3Value); + /// Standard_E64is_v3. + public static AzureVmSize StandardE64IsV3 { get; } = new AzureVmSize(StandardE64IsV3Value); + /// Standard_M8ms. + public static AzureVmSize StandardM8Ms { get; } = new AzureVmSize(StandardM8MsValue); + /// Standard_M16ms. + public static AzureVmSize StandardM16Ms { get; } = new AzureVmSize(StandardM16MsValue); + /// Standard_M32ls. + public static AzureVmSize StandardM32Ls { get; } = new AzureVmSize(StandardM32LsValue); + /// Standard_M32ms. + public static AzureVmSize StandardM32Ms { get; } = new AzureVmSize(StandardM32MsValue); + /// Standard_M32ts. + public static AzureVmSize StandardM32Ts { get; } = new AzureVmSize(StandardM32TsValue); + /// Standard_M64. + public static AzureVmSize StandardM64 { get; } = new AzureVmSize(StandardM64Value); + /// Standard_M64ls. + public static AzureVmSize StandardM64Ls { get; } = new AzureVmSize(StandardM64LsValue); + /// Standard_M64m. + public static AzureVmSize StandardM64M { get; } = new AzureVmSize(StandardM64MValue); + /// Standard_M128. + public static AzureVmSize StandardM128 { get; } = new AzureVmSize(StandardM128Value); + /// Standard_M128m. + public static AzureVmSize StandardM128M { get; } = new AzureVmSize(StandardM128MValue); + /// Standard_L8s_v2. + public static AzureVmSize StandardL8SV2 { get; } = new AzureVmSize(StandardL8SV2Value); + /// Standard_L16s_v2. + public static AzureVmSize StandardL16SV2 { get; } = new AzureVmSize(StandardL16SV2Value); + /// Standard_L32s_v2. + public static AzureVmSize StandardL32SV2 { get; } = new AzureVmSize(StandardL32SV2Value); + /// Standard_L48s_v2. + public static AzureVmSize StandardL48SV2 { get; } = new AzureVmSize(StandardL48SV2Value); + /// Standard_L64s_v2. + public static AzureVmSize StandardL64SV2 { get; } = new AzureVmSize(StandardL64SV2Value); + /// Standard_L80s_v2. + public static AzureVmSize StandardL80SV2 { get; } = new AzureVmSize(StandardL80SV2Value); + /// Standard_D2_v4. + public static AzureVmSize StandardD2V4 { get; } = new AzureVmSize(StandardD2V4Value); + /// Standard_D4_v4. + public static AzureVmSize StandardD4V4 { get; } = new AzureVmSize(StandardD4V4Value); + /// Standard_D8_v4. + public static AzureVmSize StandardD8V4 { get; } = new AzureVmSize(StandardD8V4Value); + /// Standard_D16_v4. + public static AzureVmSize StandardD16V4 { get; } = new AzureVmSize(StandardD16V4Value); + /// Standard_D32_v4. + public static AzureVmSize StandardD32V4 { get; } = new AzureVmSize(StandardD32V4Value); + /// Standard_D48_v4. + public static AzureVmSize StandardD48V4 { get; } = new AzureVmSize(StandardD48V4Value); + /// Standard_D64_v4. + public static AzureVmSize StandardD64V4 { get; } = new AzureVmSize(StandardD64V4Value); + /// Standard_D2s_v4. + public static AzureVmSize StandardD2SV4 { get; } = new AzureVmSize(StandardD2SV4Value); + /// Standard_D4s_v4. + public static AzureVmSize StandardD4SV4 { get; } = new AzureVmSize(StandardD4SV4Value); + /// Standard_D8s_v4. + public static AzureVmSize StandardD8SV4 { get; } = new AzureVmSize(StandardD8SV4Value); + /// Standard_D16s_v4. + public static AzureVmSize StandardD16SV4 { get; } = new AzureVmSize(StandardD16SV4Value); + /// Standard_D32s_v4. + public static AzureVmSize StandardD32SV4 { get; } = new AzureVmSize(StandardD32SV4Value); + /// Standard_D48s_v4. + public static AzureVmSize StandardD48SV4 { get; } = new AzureVmSize(StandardD48SV4Value); + /// Standard_D64s_v4. + public static AzureVmSize StandardD64SV4 { get; } = new AzureVmSize(StandardD64SV4Value); + /// Standard_D2d_v4. + public static AzureVmSize StandardD2DV4 { get; } = new AzureVmSize(StandardD2DV4Value); + /// Standard_D4d_v4. + public static AzureVmSize StandardD4DV4 { get; } = new AzureVmSize(StandardD4DV4Value); + /// Standard_D8d_v4. + public static AzureVmSize StandardD8DV4 { get; } = new AzureVmSize(StandardD8DV4Value); + /// Standard_D16d_v4. + public static AzureVmSize StandardD16DV4 { get; } = new AzureVmSize(StandardD16DV4Value); + /// Standard_D32d_v4. + public static AzureVmSize StandardD32DV4 { get; } = new AzureVmSize(StandardD32DV4Value); + /// Standard_D48d_v4. + public static AzureVmSize StandardD48DV4 { get; } = new AzureVmSize(StandardD48DV4Value); + /// Standard_D64d_v4. + public static AzureVmSize StandardD64DV4 { get; } = new AzureVmSize(StandardD64DV4Value); + /// Standard_D2ds_v4. + public static AzureVmSize StandardD2DsV4 { get; } = new AzureVmSize(StandardD2DsV4Value); + /// Standard_D4ds_v4. + public static AzureVmSize StandardD4DsV4 { get; } = new AzureVmSize(StandardD4DsV4Value); + /// Standard_D8ds_v4. + public static AzureVmSize StandardD8DsV4 { get; } = new AzureVmSize(StandardD8DsV4Value); + /// Standard_D16ds_v4. + public static AzureVmSize StandardD16DsV4 { get; } = new AzureVmSize(StandardD16DsV4Value); + /// Standard_D32ds_v4. + public static AzureVmSize StandardD32DsV4 { get; } = new AzureVmSize(StandardD32DsV4Value); + /// Standard_D48ds_v4. + public static AzureVmSize StandardD48DsV4 { get; } = new AzureVmSize(StandardD48DsV4Value); + /// Standard_D64ds_v4. + public static AzureVmSize StandardD64DsV4 { get; } = new AzureVmSize(StandardD64DsV4Value); + /// Standard_E2_v4. + public static AzureVmSize StandardE2V4 { get; } = new AzureVmSize(StandardE2V4Value); + /// Standard_E4_v4. + public static AzureVmSize StandardE4V4 { get; } = new AzureVmSize(StandardE4V4Value); + /// Standard_E8_v4. + public static AzureVmSize StandardE8V4 { get; } = new AzureVmSize(StandardE8V4Value); + /// Standard_E16_v4. + public static AzureVmSize StandardE16V4 { get; } = new AzureVmSize(StandardE16V4Value); + /// Standard_E20_v4. + public static AzureVmSize StandardE20V4 { get; } = new AzureVmSize(StandardE20V4Value); + /// Standard_E32_v4. + public static AzureVmSize StandardE32V4 { get; } = new AzureVmSize(StandardE32V4Value); + /// Standard_E48_v4. + public static AzureVmSize StandardE48V4 { get; } = new AzureVmSize(StandardE48V4Value); + /// Standard_E64_v4. + public static AzureVmSize StandardE64V4 { get; } = new AzureVmSize(StandardE64V4Value); + /// Standard_E2s_v4. + public static AzureVmSize StandardE2SV4 { get; } = new AzureVmSize(StandardE2SV4Value); + /// Standard_E4s_v4. + public static AzureVmSize StandardE4SV4 { get; } = new AzureVmSize(StandardE4SV4Value); + /// Standard_E8s_v4. + public static AzureVmSize StandardE8SV4 { get; } = new AzureVmSize(StandardE8SV4Value); + /// Standard_E16s_v4. + public static AzureVmSize StandardE16SV4 { get; } = new AzureVmSize(StandardE16SV4Value); + /// Standard_E20s_v4. + public static AzureVmSize StandardE20SV4 { get; } = new AzureVmSize(StandardE20SV4Value); + /// Standard_E32s_v4. + public static AzureVmSize StandardE32SV4 { get; } = new AzureVmSize(StandardE32SV4Value); + /// Standard_E48s_v4. + public static AzureVmSize StandardE48SV4 { get; } = new AzureVmSize(StandardE48SV4Value); + /// Standard_E64s_v4. + public static AzureVmSize StandardE64SV4 { get; } = new AzureVmSize(StandardE64SV4Value); + /// Standard_E2d_v4. + public static AzureVmSize StandardE2DV4 { get; } = new AzureVmSize(StandardE2DV4Value); + /// Standard_E4d_v4. + public static AzureVmSize StandardE4DV4 { get; } = new AzureVmSize(StandardE4DV4Value); + /// Standard_E8d_v4. + public static AzureVmSize StandardE8DV4 { get; } = new AzureVmSize(StandardE8DV4Value); + /// Standard_E16d_v4. + public static AzureVmSize StandardE16DV4 { get; } = new AzureVmSize(StandardE16DV4Value); + /// Standard_E20d_v4. + public static AzureVmSize StandardE20DV4 { get; } = new AzureVmSize(StandardE20DV4Value); + /// Standard_E32d_v4. + public static AzureVmSize StandardE32DV4 { get; } = new AzureVmSize(StandardE32DV4Value); + /// Standard_E48d_v4. + public static AzureVmSize StandardE48DV4 { get; } = new AzureVmSize(StandardE48DV4Value); + /// Standard_E64d_v4. + public static AzureVmSize StandardE64DV4 { get; } = new AzureVmSize(StandardE64DV4Value); + /// Standard_E2ds_v4. + public static AzureVmSize StandardE2DsV4 { get; } = new AzureVmSize(StandardE2DsV4Value); + /// Standard_E4ds_v4. + public static AzureVmSize StandardE4DsV4 { get; } = new AzureVmSize(StandardE4DsV4Value); + /// Standard_E8ds_v4. + public static AzureVmSize StandardE8DsV4 { get; } = new AzureVmSize(StandardE8DsV4Value); + /// Standard_E16ds_v4. + public static AzureVmSize StandardE16DsV4 { get; } = new AzureVmSize(StandardE16DsV4Value); + /// Standard_E20ds_v4. + public static AzureVmSize StandardE20DsV4 { get; } = new AzureVmSize(StandardE20DsV4Value); + /// Standard_E32ds_v4. + public static AzureVmSize StandardE32DsV4 { get; } = new AzureVmSize(StandardE32DsV4Value); + /// Standard_E48ds_v4. + public static AzureVmSize StandardE48DsV4 { get; } = new AzureVmSize(StandardE48DsV4Value); + /// Standard_E64ds_v4. + public static AzureVmSize StandardE64DsV4 { get; } = new AzureVmSize(StandardE64DsV4Value); + /// Standard_E2as_v4. + public static AzureVmSize StandardE2AsV4 { get; } = new AzureVmSize(StandardE2AsV4Value); + /// Standard_E4as_v4. + public static AzureVmSize StandardE4AsV4 { get; } = new AzureVmSize(StandardE4AsV4Value); + /// Standard_E8as_v4. + public static AzureVmSize StandardE8AsV4 { get; } = new AzureVmSize(StandardE8AsV4Value); + /// Standard_E16as_v4. + public static AzureVmSize StandardE16AsV4 { get; } = new AzureVmSize(StandardE16AsV4Value); + /// Standard_E20as_v4. + public static AzureVmSize StandardE20AsV4 { get; } = new AzureVmSize(StandardE20AsV4Value); + /// Standard_E32as_v4. + public static AzureVmSize StandardE32AsV4 { get; } = new AzureVmSize(StandardE32AsV4Value); + /// Standard_E48as_v4. + public static AzureVmSize StandardE48AsV4 { get; } = new AzureVmSize(StandardE48AsV4Value); + /// Standard_E64as_v4. + public static AzureVmSize StandardE64AsV4 { get; } = new AzureVmSize(StandardE64AsV4Value); + /// Standard_E96as_v4. + public static AzureVmSize StandardE96AsV4 { get; } = new AzureVmSize(StandardE96AsV4Value); + /// Standard_D2as_v4. + public static AzureVmSize StandardD2AsV4 { get; } = new AzureVmSize(StandardD2AsV4Value); + /// Standard_D4as_v4. + public static AzureVmSize StandardD4AsV4 { get; } = new AzureVmSize(StandardD4AsV4Value); + /// Standard_D8as_v4. + public static AzureVmSize StandardD8AsV4 { get; } = new AzureVmSize(StandardD8AsV4Value); + /// Standard_D16as_v4. + public static AzureVmSize StandardD16AsV4 { get; } = new AzureVmSize(StandardD16AsV4Value); + /// Standard_D32as_v4. + public static AzureVmSize StandardD32AsV4 { get; } = new AzureVmSize(StandardD32AsV4Value); + /// Standard_D48as_v4. + public static AzureVmSize StandardD48AsV4 { get; } = new AzureVmSize(StandardD48AsV4Value); + /// Standard_D64as_v4. + public static AzureVmSize StandardD64AsV4 { get; } = new AzureVmSize(StandardD64AsV4Value); + /// Standard_D96as_v4. + public static AzureVmSize StandardD96AsV4 { get; } = new AzureVmSize(StandardD96AsV4Value); + /// Standard_M208ms_v2. + public static AzureVmSize StandardM208MsV2 { get; } = new AzureVmSize(StandardM208MsV2Value); + /// Standard_M208s_v2. + public static AzureVmSize StandardM208SV2 { get; } = new AzureVmSize(StandardM208SV2Value); + /// Standard_M416ms_v2. + public static AzureVmSize StandardM416MsV2 { get; } = new AzureVmSize(StandardM416MsV2Value); + /// Standard_M416s_v2. + public static AzureVmSize StandardM416SV2 { get; } = new AzureVmSize(StandardM416SV2Value); + /// Standard_F48s_v2. + public static AzureVmSize StandardF48SV2 { get; } = new AzureVmSize(StandardF48SV2Value); + /// Standard_E48_v3. + public static AzureVmSize StandardE48V3 { get; } = new AzureVmSize(StandardE48V3Value); + /// Standard_E48s_v3. + public static AzureVmSize StandardE48SV3 { get; } = new AzureVmSize(StandardE48SV3Value); + /// Standard_E80is_v4. + public static AzureVmSize StandardE80IsV4 { get; } = new AzureVmSize(StandardE80IsV4Value); + /// Standard_E80ids_v4. + public static AzureVmSize StandardE80IdsV4 { get; } = new AzureVmSize(StandardE80IdsV4Value); + /// Standard_E2a_v4. + public static AzureVmSize StandardE2AV4 { get; } = new AzureVmSize(StandardE2AV4Value); + /// Standard_E4a_v4. + public static AzureVmSize StandardE4AV4 { get; } = new AzureVmSize(StandardE4AV4Value); + /// Standard_E8a_v4. + public static AzureVmSize StandardE8AV4 { get; } = new AzureVmSize(StandardE8AV4Value); + /// Standard_E16a_v4. + public static AzureVmSize StandardE16AV4 { get; } = new AzureVmSize(StandardE16AV4Value); + /// Standard_E20a_v4. + public static AzureVmSize StandardE20AV4 { get; } = new AzureVmSize(StandardE20AV4Value); + /// Standard_E32a_v4. + public static AzureVmSize StandardE32AV4 { get; } = new AzureVmSize(StandardE32AV4Value); + /// Standard_E48a_v4. + public static AzureVmSize StandardE48AV4 { get; } = new AzureVmSize(StandardE48AV4Value); + /// Standard_E64a_v4. + public static AzureVmSize StandardE64AV4 { get; } = new AzureVmSize(StandardE64AV4Value); + /// Standard_E96a_v4. + public static AzureVmSize StandardE96AV4 { get; } = new AzureVmSize(StandardE96AV4Value); + /// Standard_D2a_v4. + public static AzureVmSize StandardD2AV4 { get; } = new AzureVmSize(StandardD2AV4Value); + /// Standard_D4a_v4. + public static AzureVmSize StandardD4AV4 { get; } = new AzureVmSize(StandardD4AV4Value); + /// Standard_D8a_v4. + public static AzureVmSize StandardD8AV4 { get; } = new AzureVmSize(StandardD8AV4Value); + /// Standard_D16a_v4. + public static AzureVmSize StandardD16AV4 { get; } = new AzureVmSize(StandardD16AV4Value); + /// Standard_D32a_v4. + public static AzureVmSize StandardD32AV4 { get; } = new AzureVmSize(StandardD32AV4Value); + /// Standard_D48a_v4. + public static AzureVmSize StandardD48AV4 { get; } = new AzureVmSize(StandardD48AV4Value); + /// Standard_D64a_v4. + public static AzureVmSize StandardD64AV4 { get; } = new AzureVmSize(StandardD64AV4Value); + /// Standard_D96a_v4. + public static AzureVmSize StandardD96AV4 { get; } = new AzureVmSize(StandardD96AV4Value); + /// Standard_M32ms_v2. + public static AzureVmSize StandardM32MsV2 { get; } = new AzureVmSize(StandardM32MsV2Value); + /// Standard_M64s_v2. + public static AzureVmSize StandardM64SV2 { get; } = new AzureVmSize(StandardM64SV2Value); + /// Standard_M64ms_v2. + public static AzureVmSize StandardM64MsV2 { get; } = new AzureVmSize(StandardM64MsV2Value); + /// Standard_M128s_v2. + public static AzureVmSize StandardM128SV2 { get; } = new AzureVmSize(StandardM128SV2Value); + /// Standard_M128ms_v2. + public static AzureVmSize StandardM128MsV2 { get; } = new AzureVmSize(StandardM128MsV2Value); + /// Standard_M192is_v2. + public static AzureVmSize StandardM192IsV2 { get; } = new AzureVmSize(StandardM192IsV2Value); + /// Standard_M192ims_v2. + public static AzureVmSize StandardM192ImsV2 { get; } = new AzureVmSize(StandardM192ImsV2Value); + /// Standard_M32dms_v2. + public static AzureVmSize StandardM32DmsV2 { get; } = new AzureVmSize(StandardM32DmsV2Value); + /// Standard_M64ds_v2. + public static AzureVmSize StandardM64DsV2 { get; } = new AzureVmSize(StandardM64DsV2Value); + /// Standard_M64dms_v2. + public static AzureVmSize StandardM64DmsV2 { get; } = new AzureVmSize(StandardM64DmsV2Value); + /// Standard_M128ds_v2. + public static AzureVmSize StandardM128DsV2 { get; } = new AzureVmSize(StandardM128DsV2Value); + /// Standard_M128dms_v2. + public static AzureVmSize StandardM128DmsV2 { get; } = new AzureVmSize(StandardM128DmsV2Value); + /// Standard_M192ids_v2. + public static AzureVmSize StandardM192IdsV2 { get; } = new AzureVmSize(StandardM192IdsV2Value); + /// Standard_M192idms_v2. + public static AzureVmSize StandardM192IdmsV2 { get; } = new AzureVmSize(StandardM192IdmsV2Value); + /// Standard_D2_v5. + public static AzureVmSize StandardD2V5 { get; } = new AzureVmSize(StandardD2V5Value); + /// Standard_D4_v5. + public static AzureVmSize StandardD4V5 { get; } = new AzureVmSize(StandardD4V5Value); + /// Standard_D8_v5. + public static AzureVmSize StandardD8V5 { get; } = new AzureVmSize(StandardD8V5Value); + /// Standard_D16_v5. + public static AzureVmSize StandardD16V5 { get; } = new AzureVmSize(StandardD16V5Value); + /// Standard_D32_v5. + public static AzureVmSize StandardD32V5 { get; } = new AzureVmSize(StandardD32V5Value); + /// Standard_D48_v5. + public static AzureVmSize StandardD48V5 { get; } = new AzureVmSize(StandardD48V5Value); + /// Standard_D64_v5. + public static AzureVmSize StandardD64V5 { get; } = new AzureVmSize(StandardD64V5Value); + /// Standard_D96_v5. + public static AzureVmSize StandardD96V5 { get; } = new AzureVmSize(StandardD96V5Value); + /// Standard_D2s_v5. + public static AzureVmSize StandardD2SV5 { get; } = new AzureVmSize(StandardD2SV5Value); + /// Standard_D4s_v5. + public static AzureVmSize StandardD4SV5 { get; } = new AzureVmSize(StandardD4SV5Value); + /// Standard_D8s_v5. + public static AzureVmSize StandardD8SV5 { get; } = new AzureVmSize(StandardD8SV5Value); + /// Standard_D16s_v5. + public static AzureVmSize StandardD16SV5 { get; } = new AzureVmSize(StandardD16SV5Value); + /// Standard_D32s_v5. + public static AzureVmSize StandardD32SV5 { get; } = new AzureVmSize(StandardD32SV5Value); + /// Standard_D48s_v5. + public static AzureVmSize StandardD48SV5 { get; } = new AzureVmSize(StandardD48SV5Value); + /// Standard_D64s_v5. + public static AzureVmSize StandardD64SV5 { get; } = new AzureVmSize(StandardD64SV5Value); + /// Standard_D96s_v5. + public static AzureVmSize StandardD96SV5 { get; } = new AzureVmSize(StandardD96SV5Value); + /// Standard_D2d_v5. + public static AzureVmSize StandardD2DV5 { get; } = new AzureVmSize(StandardD2DV5Value); + /// Standard_D4d_v5. + public static AzureVmSize StandardD4DV5 { get; } = new AzureVmSize(StandardD4DV5Value); + /// Standard_D8d_v5. + public static AzureVmSize StandardD8DV5 { get; } = new AzureVmSize(StandardD8DV5Value); + /// Standard_D16d_v5. + public static AzureVmSize StandardD16DV5 { get; } = new AzureVmSize(StandardD16DV5Value); + /// Standard_D32d_v5. + public static AzureVmSize StandardD32DV5 { get; } = new AzureVmSize(StandardD32DV5Value); + /// Standard_D48d_v5. + public static AzureVmSize StandardD48DV5 { get; } = new AzureVmSize(StandardD48DV5Value); + /// Standard_D64d_v5. + public static AzureVmSize StandardD64DV5 { get; } = new AzureVmSize(StandardD64DV5Value); + /// Standard_D96d_v5. + public static AzureVmSize StandardD96DV5 { get; } = new AzureVmSize(StandardD96DV5Value); + /// Standard_D2ds_v5. + public static AzureVmSize StandardD2DsV5 { get; } = new AzureVmSize(StandardD2DsV5Value); + /// Standard_D4ds_v5. + public static AzureVmSize StandardD4DsV5 { get; } = new AzureVmSize(StandardD4DsV5Value); + /// Standard_D8ds_v5. + public static AzureVmSize StandardD8DsV5 { get; } = new AzureVmSize(StandardD8DsV5Value); + /// Standard_D16ds_v5. + public static AzureVmSize StandardD16DsV5 { get; } = new AzureVmSize(StandardD16DsV5Value); + /// Standard_D32ds_v5. + public static AzureVmSize StandardD32DsV5 { get; } = new AzureVmSize(StandardD32DsV5Value); + /// Standard_D48ds_v5. + public static AzureVmSize StandardD48DsV5 { get; } = new AzureVmSize(StandardD48DsV5Value); + /// Standard_D64ds_v5. + public static AzureVmSize StandardD64DsV5 { get; } = new AzureVmSize(StandardD64DsV5Value); + /// Standard_D96ds_v5. + public static AzureVmSize StandardD96DsV5 { get; } = new AzureVmSize(StandardD96DsV5Value); + /// Standard_D2as_v5. + public static AzureVmSize StandardD2AsV5 { get; } = new AzureVmSize(StandardD2AsV5Value); + /// Standard_D4as_v5. + public static AzureVmSize StandardD4AsV5 { get; } = new AzureVmSize(StandardD4AsV5Value); + /// Standard_D8as_v5. + public static AzureVmSize StandardD8AsV5 { get; } = new AzureVmSize(StandardD8AsV5Value); + /// Standard_D16as_v5. + public static AzureVmSize StandardD16AsV5 { get; } = new AzureVmSize(StandardD16AsV5Value); + /// Standard_D32as_v5. + public static AzureVmSize StandardD32AsV5 { get; } = new AzureVmSize(StandardD32AsV5Value); + /// Standard_D48as_v5. + public static AzureVmSize StandardD48AsV5 { get; } = new AzureVmSize(StandardD48AsV5Value); + /// Standard_D64as_v5. + public static AzureVmSize StandardD64AsV5 { get; } = new AzureVmSize(StandardD64AsV5Value); + /// Standard_D96as_v5. + public static AzureVmSize StandardD96AsV5 { get; } = new AzureVmSize(StandardD96AsV5Value); + /// Standard_D2ads_v5. + public static AzureVmSize StandardD2AdsV5 { get; } = new AzureVmSize(StandardD2AdsV5Value); + /// Standard_D4ads_v5. + public static AzureVmSize StandardD4AdsV5 { get; } = new AzureVmSize(StandardD4AdsV5Value); + /// Standard_D8ads_v5. + public static AzureVmSize StandardD8AdsV5 { get; } = new AzureVmSize(StandardD8AdsV5Value); + /// Standard_D16ads_v5. + public static AzureVmSize StandardD16AdsV5 { get; } = new AzureVmSize(StandardD16AdsV5Value); + /// Standard_D32ads_v5. + public static AzureVmSize StandardD32AdsV5 { get; } = new AzureVmSize(StandardD32AdsV5Value); + /// Standard_D48ads_v5. + public static AzureVmSize StandardD48AdsV5 { get; } = new AzureVmSize(StandardD48AdsV5Value); + /// Standard_D64ads_v5. + public static AzureVmSize StandardD64AdsV5 { get; } = new AzureVmSize(StandardD64AdsV5Value); + /// Standard_D96ads_v5. + public static AzureVmSize StandardD96AdsV5 { get; } = new AzureVmSize(StandardD96AdsV5Value); + /// Standard_E2_v5. + public static AzureVmSize StandardE2V5 { get; } = new AzureVmSize(StandardE2V5Value); + /// Standard_E4_v5. + public static AzureVmSize StandardE4V5 { get; } = new AzureVmSize(StandardE4V5Value); + /// Standard_E8_v5. + public static AzureVmSize StandardE8V5 { get; } = new AzureVmSize(StandardE8V5Value); + /// Standard_E16_v5. + public static AzureVmSize StandardE16V5 { get; } = new AzureVmSize(StandardE16V5Value); + /// Standard_E20_v5. + public static AzureVmSize StandardE20V5 { get; } = new AzureVmSize(StandardE20V5Value); + /// Standard_E32_v5. + public static AzureVmSize StandardE32V5 { get; } = new AzureVmSize(StandardE32V5Value); + /// Standard_E48_v5. + public static AzureVmSize StandardE48V5 { get; } = new AzureVmSize(StandardE48V5Value); + /// Standard_E64_v5. + public static AzureVmSize StandardE64V5 { get; } = new AzureVmSize(StandardE64V5Value); + /// Standard_E96_v5. + public static AzureVmSize StandardE96V5 { get; } = new AzureVmSize(StandardE96V5Value); + /// Standard_E104i_v5. + public static AzureVmSize StandardE104IV5 { get; } = new AzureVmSize(StandardE104IV5Value); + /// Standard_E2s_v5. + public static AzureVmSize StandardE2SV5 { get; } = new AzureVmSize(StandardE2SV5Value); + /// Standard_E4s_v5. + public static AzureVmSize StandardE4SV5 { get; } = new AzureVmSize(StandardE4SV5Value); + /// Standard_E8s_v5. + public static AzureVmSize StandardE8SV5 { get; } = new AzureVmSize(StandardE8SV5Value); + /// Standard_E16s_v5. + public static AzureVmSize StandardE16SV5 { get; } = new AzureVmSize(StandardE16SV5Value); + /// Standard_E20s_v5. + public static AzureVmSize StandardE20SV5 { get; } = new AzureVmSize(StandardE20SV5Value); + /// Standard_E32s_v5. + public static AzureVmSize StandardE32SV5 { get; } = new AzureVmSize(StandardE32SV5Value); + /// Standard_E48s_v5. + public static AzureVmSize StandardE48SV5 { get; } = new AzureVmSize(StandardE48SV5Value); + /// Standard_E64s_v5. + public static AzureVmSize StandardE64SV5 { get; } = new AzureVmSize(StandardE64SV5Value); + /// Standard_E96s_v5. + public static AzureVmSize StandardE96SV5 { get; } = new AzureVmSize(StandardE96SV5Value); + /// Standard_E104is_v5. + public static AzureVmSize StandardE104IsV5 { get; } = new AzureVmSize(StandardE104IsV5Value); + /// Standard_E2d_v5. + public static AzureVmSize StandardE2DV5 { get; } = new AzureVmSize(StandardE2DV5Value); + /// Standard_E4d_v5. + public static AzureVmSize StandardE4DV5 { get; } = new AzureVmSize(StandardE4DV5Value); + /// Standard_E8d_v5. + public static AzureVmSize StandardE8DV5 { get; } = new AzureVmSize(StandardE8DV5Value); + /// Standard_E16d_v5. + public static AzureVmSize StandardE16DV5 { get; } = new AzureVmSize(StandardE16DV5Value); + /// Standard_E20d_v5. + public static AzureVmSize StandardE20DV5 { get; } = new AzureVmSize(StandardE20DV5Value); + /// Standard_E32d_v5. + public static AzureVmSize StandardE32DV5 { get; } = new AzureVmSize(StandardE32DV5Value); + /// Standard_E48d_v5. + public static AzureVmSize StandardE48DV5 { get; } = new AzureVmSize(StandardE48DV5Value); + /// Standard_E64d_v5. + public static AzureVmSize StandardE64DV5 { get; } = new AzureVmSize(StandardE64DV5Value); + /// Standard_E96d_v5. + public static AzureVmSize StandardE96DV5 { get; } = new AzureVmSize(StandardE96DV5Value); + /// Standard_E104id_v5. + public static AzureVmSize StandardE104IdV5 { get; } = new AzureVmSize(StandardE104IdV5Value); + /// Standard_E2ds_v5. + public static AzureVmSize StandardE2DsV5 { get; } = new AzureVmSize(StandardE2DsV5Value); + /// Standard_E4ds_v5. + public static AzureVmSize StandardE4DsV5 { get; } = new AzureVmSize(StandardE4DsV5Value); + /// Standard_E8ds_v5. + public static AzureVmSize StandardE8DsV5 { get; } = new AzureVmSize(StandardE8DsV5Value); + /// Standard_E16ds_v5. + public static AzureVmSize StandardE16DsV5 { get; } = new AzureVmSize(StandardE16DsV5Value); + /// Standard_E20ds_v5. + public static AzureVmSize StandardE20DsV5 { get; } = new AzureVmSize(StandardE20DsV5Value); + /// Standard_E32ds_v5. + public static AzureVmSize StandardE32DsV5 { get; } = new AzureVmSize(StandardE32DsV5Value); + /// Standard_E48ds_v5. + public static AzureVmSize StandardE48DsV5 { get; } = new AzureVmSize(StandardE48DsV5Value); + /// Standard_E64ds_v5. + public static AzureVmSize StandardE64DsV5 { get; } = new AzureVmSize(StandardE64DsV5Value); + /// Standard_E96ds_v5. + public static AzureVmSize StandardE96DsV5 { get; } = new AzureVmSize(StandardE96DsV5Value); + /// Standard_E104ids_v5. + public static AzureVmSize StandardE104IdsV5 { get; } = new AzureVmSize(StandardE104IdsV5Value); + /// Standard_E2as_v5. + public static AzureVmSize StandardE2AsV5 { get; } = new AzureVmSize(StandardE2AsV5Value); + /// Standard_E4as_v5. + public static AzureVmSize StandardE4AsV5 { get; } = new AzureVmSize(StandardE4AsV5Value); + /// Standard_E8as_v5. + public static AzureVmSize StandardE8AsV5 { get; } = new AzureVmSize(StandardE8AsV5Value); + /// Standard_E16as_v5. + public static AzureVmSize StandardE16AsV5 { get; } = new AzureVmSize(StandardE16AsV5Value); + /// Standard_E20as_v5. + public static AzureVmSize StandardE20AsV5 { get; } = new AzureVmSize(StandardE20AsV5Value); + /// Standard_E32as_v5. + public static AzureVmSize StandardE32AsV5 { get; } = new AzureVmSize(StandardE32AsV5Value); + /// Standard_E48as_v5. + public static AzureVmSize StandardE48AsV5 { get; } = new AzureVmSize(StandardE48AsV5Value); + /// Standard_E64as_v5. + public static AzureVmSize StandardE64AsV5 { get; } = new AzureVmSize(StandardE64AsV5Value); + /// Standard_E96as_v5. + public static AzureVmSize StandardE96AsV5 { get; } = new AzureVmSize(StandardE96AsV5Value); + /// Standard_E2ads_v5. + public static AzureVmSize StandardE2AdsV5 { get; } = new AzureVmSize(StandardE2AdsV5Value); + /// Standard_E4ads_v5. + public static AzureVmSize StandardE4AdsV5 { get; } = new AzureVmSize(StandardE4AdsV5Value); + /// Standard_E8ads_v5. + public static AzureVmSize StandardE8AdsV5 { get; } = new AzureVmSize(StandardE8AdsV5Value); + /// Standard_E16ads_v5. + public static AzureVmSize StandardE16AdsV5 { get; } = new AzureVmSize(StandardE16AdsV5Value); + /// Standard_E20ads_v5. + public static AzureVmSize StandardE20AdsV5 { get; } = new AzureVmSize(StandardE20AdsV5Value); + /// Standard_E32ads_v5. + public static AzureVmSize StandardE32AdsV5 { get; } = new AzureVmSize(StandardE32AdsV5Value); + /// Standard_E48ads_v5. + public static AzureVmSize StandardE48AdsV5 { get; } = new AzureVmSize(StandardE48AdsV5Value); + /// Standard_E64ads_v5. + public static AzureVmSize StandardE64AdsV5 { get; } = new AzureVmSize(StandardE64AdsV5Value); + /// Standard_E96ads_v5. + public static AzureVmSize StandardE96AdsV5 { get; } = new AzureVmSize(StandardE96AdsV5Value); + /// Standard_M8_2ms. + public static AzureVmSize StandardM82Ms { get; } = new AzureVmSize(StandardM82MsValue); + /// Standard_M8_4ms. + public static AzureVmSize StandardM84Ms { get; } = new AzureVmSize(StandardM84MsValue); + /// Standard_M16_4ms. + public static AzureVmSize StandardM164Ms { get; } = new AzureVmSize(StandardM164MsValue); + /// Standard_M16_8ms. + public static AzureVmSize StandardM168Ms { get; } = new AzureVmSize(StandardM168MsValue); + /// Standard_M32_8ms. + public static AzureVmSize StandardM328Ms { get; } = new AzureVmSize(StandardM328MsValue); + /// Standard_M32_16ms. + public static AzureVmSize StandardM3216Ms { get; } = new AzureVmSize(StandardM3216MsValue); + /// Standard_M64_32ms. + public static AzureVmSize StandardM6432Ms { get; } = new AzureVmSize(StandardM6432MsValue); + /// Standard_M64_16ms. + public static AzureVmSize StandardM6416Ms { get; } = new AzureVmSize(StandardM6416MsValue); + /// Standard_M128_64ms. + public static AzureVmSize StandardM12864Ms { get; } = new AzureVmSize(StandardM12864MsValue); + /// Standard_M128_32ms. + public static AzureVmSize StandardM12832Ms { get; } = new AzureVmSize(StandardM12832MsValue); + /// Standard_E4_2s_v3. + public static AzureVmSize StandardE42SV3 { get; } = new AzureVmSize(StandardE42SV3Value); + /// Standard_E8_4s_v3. + public static AzureVmSize StandardE84SV3 { get; } = new AzureVmSize(StandardE84SV3Value); + /// Standard_E8_2s_v3. + public static AzureVmSize StandardE82SV3 { get; } = new AzureVmSize(StandardE82SV3Value); + /// Standard_E16_8s_v3. + public static AzureVmSize StandardE168SV3 { get; } = new AzureVmSize(StandardE168SV3Value); + /// Standard_E16_4s_v3. + public static AzureVmSize StandardE164SV3 { get; } = new AzureVmSize(StandardE164SV3Value); + /// Standard_E32_16s_v3. + public static AzureVmSize StandardE3216SV3 { get; } = new AzureVmSize(StandardE3216SV3Value); + /// Standard_E32_8s_v3. + public static AzureVmSize StandardE328SV3 { get; } = new AzureVmSize(StandardE328SV3Value); + /// Standard_E64_32s_v3. + public static AzureVmSize StandardE6432SV3 { get; } = new AzureVmSize(StandardE6432SV3Value); + /// Standard_E64_16s_v3. + public static AzureVmSize StandardE6416SV3 { get; } = new AzureVmSize(StandardE6416SV3Value); + /// Standard_E4_2s_v4. + public static AzureVmSize StandardE42SV4 { get; } = new AzureVmSize(StandardE42SV4Value); + /// Standard_E8_4s_v4. + public static AzureVmSize StandardE84SV4 { get; } = new AzureVmSize(StandardE84SV4Value); + /// Standard_E8_2s_v4. + public static AzureVmSize StandardE82SV4 { get; } = new AzureVmSize(StandardE82SV4Value); + /// Standard_E16_8s_v4. + public static AzureVmSize StandardE168SV4 { get; } = new AzureVmSize(StandardE168SV4Value); + /// Standard_E16_4s_v4. + public static AzureVmSize StandardE164SV4 { get; } = new AzureVmSize(StandardE164SV4Value); + /// Standard_E32_16s_v4. + public static AzureVmSize StandardE3216SV4 { get; } = new AzureVmSize(StandardE3216SV4Value); + /// Standard_E32_8s_v4. + public static AzureVmSize StandardE328SV4 { get; } = new AzureVmSize(StandardE328SV4Value); + /// Standard_E64_32s_v4. + public static AzureVmSize StandardE6432SV4 { get; } = new AzureVmSize(StandardE6432SV4Value); + /// Standard_E64_16s_v4. + public static AzureVmSize StandardE6416SV4 { get; } = new AzureVmSize(StandardE6416SV4Value); + /// Standard_E4_2ds_v4. + public static AzureVmSize StandardE42DsV4 { get; } = new AzureVmSize(StandardE42DsV4Value); + /// Standard_E8_4ds_v4. + public static AzureVmSize StandardE84DsV4 { get; } = new AzureVmSize(StandardE84DsV4Value); + /// Standard_E8_2ds_v4. + public static AzureVmSize StandardE82DsV4 { get; } = new AzureVmSize(StandardE82DsV4Value); + /// Standard_E16_8ds_v4. + public static AzureVmSize StandardE168DsV4 { get; } = new AzureVmSize(StandardE168DsV4Value); + /// Standard_E16_4ds_v4. + public static AzureVmSize StandardE164DsV4 { get; } = new AzureVmSize(StandardE164DsV4Value); + /// Standard_E32_16ds_v4. + public static AzureVmSize StandardE3216DsV4 { get; } = new AzureVmSize(StandardE3216DsV4Value); + /// Standard_E32_8ds_v4. + public static AzureVmSize StandardE328DsV4 { get; } = new AzureVmSize(StandardE328DsV4Value); + /// Standard_E64_32ds_v4. + public static AzureVmSize StandardE6432DsV4 { get; } = new AzureVmSize(StandardE6432DsV4Value); + /// Standard_E64_16ds_v4. + public static AzureVmSize StandardE6416DsV4 { get; } = new AzureVmSize(StandardE6416DsV4Value); + /// Standard_E4_2as_v4. + public static AzureVmSize StandardE42AsV4 { get; } = new AzureVmSize(StandardE42AsV4Value); + /// Standard_E8_4as_v4. + public static AzureVmSize StandardE84AsV4 { get; } = new AzureVmSize(StandardE84AsV4Value); + /// Standard_E8_2as_v4. + public static AzureVmSize StandardE82AsV4 { get; } = new AzureVmSize(StandardE82AsV4Value); + /// Standard_E16_8as_v4. + public static AzureVmSize StandardE168AsV4 { get; } = new AzureVmSize(StandardE168AsV4Value); + /// Standard_E16_4as_v4. + public static AzureVmSize StandardE164AsV4 { get; } = new AzureVmSize(StandardE164AsV4Value); + /// Standard_E32_16as_v4. + public static AzureVmSize StandardE3216AsV4 { get; } = new AzureVmSize(StandardE3216AsV4Value); + /// Standard_E32_8as_v4. + public static AzureVmSize StandardE328AsV4 { get; } = new AzureVmSize(StandardE328AsV4Value); + /// Standard_E64_32as_v4. + public static AzureVmSize StandardE6432AsV4 { get; } = new AzureVmSize(StandardE6432AsV4Value); + /// Standard_E64_16as_v4. + public static AzureVmSize StandardE6416AsV4 { get; } = new AzureVmSize(StandardE6416AsV4Value); + /// Standard_E96_48as_v4. + public static AzureVmSize StandardE9648AsV4 { get; } = new AzureVmSize(StandardE9648AsV4Value); + /// Standard_E96_24as_v4. + public static AzureVmSize StandardE9624AsV4 { get; } = new AzureVmSize(StandardE9624AsV4Value); + /// Standard_E4_2ads_v5. + public static AzureVmSize StandardE42AdsV5 { get; } = new AzureVmSize(StandardE42AdsV5Value); + /// Standard_E8_4ads_v5. + public static AzureVmSize StandardE84AdsV5 { get; } = new AzureVmSize(StandardE84AdsV5Value); + /// Standard_E8_2ads_v5. + public static AzureVmSize StandardE82AdsV5 { get; } = new AzureVmSize(StandardE82AdsV5Value); + /// Standard_E16_8ads_v5. + public static AzureVmSize StandardE168AdsV5 { get; } = new AzureVmSize(StandardE168AdsV5Value); + /// Standard_E16_4ads_v5. + public static AzureVmSize StandardE164AdsV5 { get; } = new AzureVmSize(StandardE164AdsV5Value); + /// Standard_E32_16ads_v5. + public static AzureVmSize StandardE3216AdsV5 { get; } = new AzureVmSize(StandardE3216AdsV5Value); + /// Standard_E32_8ads_v5. + public static AzureVmSize StandardE328AdsV5 { get; } = new AzureVmSize(StandardE328AdsV5Value); + /// Standard_E64_32ads_v5. + public static AzureVmSize StandardE6432AdsV5 { get; } = new AzureVmSize(StandardE6432AdsV5Value); + /// Standard_E64_16ads_v5. + public static AzureVmSize StandardE6416AdsV5 { get; } = new AzureVmSize(StandardE6416AdsV5Value); + /// Standard_E96_48ads_v5. + public static AzureVmSize StandardE9648AdsV5 { get; } = new AzureVmSize(StandardE9648AdsV5Value); + /// Standard_E96_24ads_v5. + public static AzureVmSize StandardE9624AdsV5 { get; } = new AzureVmSize(StandardE9624AdsV5Value); + /// Standard_E4_2s_v5. + public static AzureVmSize StandardE42SV5 { get; } = new AzureVmSize(StandardE42SV5Value); + /// Standard_E8_4s_v5. + public static AzureVmSize StandardE84SV5 { get; } = new AzureVmSize(StandardE84SV5Value); + /// Standard_E8_2s_v5. + public static AzureVmSize StandardE82SV5 { get; } = new AzureVmSize(StandardE82SV5Value); + /// Standard_E16_8s_v5. + public static AzureVmSize StandardE168SV5 { get; } = new AzureVmSize(StandardE168SV5Value); + /// Standard_E16_4s_v5. + public static AzureVmSize StandardE164SV5 { get; } = new AzureVmSize(StandardE164SV5Value); + /// Standard_E32_16s_v5. + public static AzureVmSize StandardE3216SV5 { get; } = new AzureVmSize(StandardE3216SV5Value); + /// Standard_E32_8s_v5. + public static AzureVmSize StandardE328SV5 { get; } = new AzureVmSize(StandardE328SV5Value); + /// Standard_E64_32s_v5. + public static AzureVmSize StandardE6432SV5 { get; } = new AzureVmSize(StandardE6432SV5Value); + /// Standard_E64_16s_v5. + public static AzureVmSize StandardE6416SV5 { get; } = new AzureVmSize(StandardE6416SV5Value); + /// Standard_E96_48s_v5. + public static AzureVmSize StandardE9648SV5 { get; } = new AzureVmSize(StandardE9648SV5Value); + /// Standard_E96_24s_v5. + public static AzureVmSize StandardE9624SV5 { get; } = new AzureVmSize(StandardE9624SV5Value); + /// Standard_E4_2ds_v5. + public static AzureVmSize StandardE42DsV5 { get; } = new AzureVmSize(StandardE42DsV5Value); + /// Standard_E8_4ds_v5. + public static AzureVmSize StandardE84DsV5 { get; } = new AzureVmSize(StandardE84DsV5Value); + /// Standard_E8_2ds_v5. + public static AzureVmSize StandardE82DsV5 { get; } = new AzureVmSize(StandardE82DsV5Value); + /// Standard_E16_8ds_v5. + public static AzureVmSize StandardE168DsV5 { get; } = new AzureVmSize(StandardE168DsV5Value); + /// Standard_E16_4ds_v5. + public static AzureVmSize StandardE164DsV5 { get; } = new AzureVmSize(StandardE164DsV5Value); + /// Standard_E32_16ds_v5. + public static AzureVmSize StandardE3216DsV5 { get; } = new AzureVmSize(StandardE3216DsV5Value); + /// Standard_E32_8ds_v5. + public static AzureVmSize StandardE328DsV5 { get; } = new AzureVmSize(StandardE328DsV5Value); + /// Standard_E64_32ds_v5. + public static AzureVmSize StandardE6432DsV5 { get; } = new AzureVmSize(StandardE6432DsV5Value); + /// Standard_E64_16ds_v5. + public static AzureVmSize StandardE6416DsV5 { get; } = new AzureVmSize(StandardE6416DsV5Value); + /// Standard_E96_48ds_v5. + public static AzureVmSize StandardE9648DsV5 { get; } = new AzureVmSize(StandardE9648DsV5Value); + /// Standard_E96_24ds_v5. + public static AzureVmSize StandardE9624DsV5 { get; } = new AzureVmSize(StandardE9624DsV5Value); + /// Standard_E4_2as_v5. + public static AzureVmSize StandardE42AsV5 { get; } = new AzureVmSize(StandardE42AsV5Value); + /// Standard_E8_4as_v5. + public static AzureVmSize StandardE84AsV5 { get; } = new AzureVmSize(StandardE84AsV5Value); + /// Standard_E8_2as_v5. + public static AzureVmSize StandardE82AsV5 { get; } = new AzureVmSize(StandardE82AsV5Value); + /// Standard_E16_8as_v5. + public static AzureVmSize StandardE168AsV5 { get; } = new AzureVmSize(StandardE168AsV5Value); + /// Standard_E16_4as_v5. + public static AzureVmSize StandardE164AsV5 { get; } = new AzureVmSize(StandardE164AsV5Value); + /// Standard_E32_16as_v5. + public static AzureVmSize StandardE3216AsV5 { get; } = new AzureVmSize(StandardE3216AsV5Value); + /// Standard_E32_8as_v5. + public static AzureVmSize StandardE328AsV5 { get; } = new AzureVmSize(StandardE328AsV5Value); + /// Standard_E64_32as_v5. + public static AzureVmSize StandardE6432AsV5 { get; } = new AzureVmSize(StandardE6432AsV5Value); + /// Standard_E64_16as_v5. + public static AzureVmSize StandardE6416AsV5 { get; } = new AzureVmSize(StandardE6416AsV5Value); + /// Standard_E96_48as_v5. + public static AzureVmSize StandardE9648AsV5 { get; } = new AzureVmSize(StandardE9648AsV5Value); + /// Standard_E96_24as_v5. + public static AzureVmSize StandardE9624AsV5 { get; } = new AzureVmSize(StandardE9624AsV5Value); + /// Standard_GS4_8. + public static AzureVmSize StandardGS48 { get; } = new AzureVmSize(StandardGS48Value); + /// Standard_GS4_4. + public static AzureVmSize StandardGS44 { get; } = new AzureVmSize(StandardGS44Value); + /// Standard_GS5_16. + public static AzureVmSize StandardGS516 { get; } = new AzureVmSize(StandardGS516Value); + /// Standard_GS5_8. + public static AzureVmSize StandardGS58 { get; } = new AzureVmSize(StandardGS58Value); + /// Standard_DS11_1_v2. + public static AzureVmSize StandardDS111V2 { get; } = new AzureVmSize(StandardDS111V2Value); + /// Standard_DS12_2_v2. + public static AzureVmSize StandardDS122V2 { get; } = new AzureVmSize(StandardDS122V2Value); + /// Standard_DS12_1_v2. + public static AzureVmSize StandardDS121V2 { get; } = new AzureVmSize(StandardDS121V2Value); + /// Standard_DS13_4_v2. + public static AzureVmSize StandardDS134V2 { get; } = new AzureVmSize(StandardDS134V2Value); + /// Standard_DS13_2_v2. + public static AzureVmSize StandardDS132V2 { get; } = new AzureVmSize(StandardDS132V2Value); + /// Standard_DS14_8_v2. + public static AzureVmSize StandardDS148V2 { get; } = new AzureVmSize(StandardDS148V2Value); + /// Standard_DS14_4_v2. + public static AzureVmSize StandardDS144V2 { get; } = new AzureVmSize(StandardDS144V2Value); + /// Standard_M416_208s_v2. + public static AzureVmSize StandardM416208SV2 { get; } = new AzureVmSize(StandardM416208SV2Value); + /// Standard_M416_208ms_v2. + public static AzureVmSize StandardM416208MsV2 { get; } = new AzureVmSize(StandardM416208MsV2Value); + /// Standard_E2bs_v5. + public static AzureVmSize StandardE2BsV5 { get; } = new AzureVmSize(StandardE2BsV5Value); + /// Standard_E4bs_v5. + public static AzureVmSize StandardE4BsV5 { get; } = new AzureVmSize(StandardE4BsV5Value); + /// Standard_E8bs_v5. + public static AzureVmSize StandardE8BsV5 { get; } = new AzureVmSize(StandardE8BsV5Value); + /// Standard_E16bs_v5. + public static AzureVmSize StandardE16BsV5 { get; } = new AzureVmSize(StandardE16BsV5Value); + /// Standard_E32bs_v5. + public static AzureVmSize StandardE32BsV5 { get; } = new AzureVmSize(StandardE32BsV5Value); + /// Standard_E48bs_v5. + public static AzureVmSize StandardE48BsV5 { get; } = new AzureVmSize(StandardE48BsV5Value); + /// Standard_E64bs_v5. + public static AzureVmSize StandardE64BsV5 { get; } = new AzureVmSize(StandardE64BsV5Value); + /// Standard_E2bds_v5. + public static AzureVmSize StandardE2BdsV5 { get; } = new AzureVmSize(StandardE2BdsV5Value); + /// Standard_E4bds_v5. + public static AzureVmSize StandardE4BdsV5 { get; } = new AzureVmSize(StandardE4BdsV5Value); + /// Standard_E8bds_v5. + public static AzureVmSize StandardE8BdsV5 { get; } = new AzureVmSize(StandardE8BdsV5Value); + /// Standard_E16bds_v5. + public static AzureVmSize StandardE16BdsV5 { get; } = new AzureVmSize(StandardE16BdsV5Value); + /// Standard_E32bds_v5. + public static AzureVmSize StandardE32BdsV5 { get; } = new AzureVmSize(StandardE32BdsV5Value); + /// Standard_E48bds_v5. + public static AzureVmSize StandardE48BdsV5 { get; } = new AzureVmSize(StandardE48BdsV5Value); + /// Standard_E64bds_v5. + public static AzureVmSize StandardE64BdsV5 { get; } = new AzureVmSize(StandardE64BdsV5Value); + /// Determines if two values are the same. + public static bool operator ==(AzureVmSize left, AzureVmSize right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureVmSize left, AzureVmSize right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureVmSize(string value) => new AzureVmSize(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureVmSize other && Equals(other); + /// + public bool Equals(AzureVmSize other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureVmSkuDto.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureVmSkuDto.Serialization.cs new file mode 100644 index 000000000000..456673c522a0 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureVmSkuDto.Serialization.cs @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class AzureVmSkuDto : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureVmSkuDto)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(AzureVmFamily)) + { + writer.WritePropertyName("azureVmFamily"u8); + writer.WriteStringValue(AzureVmFamily.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Cores)) + { + writer.WritePropertyName("cores"u8); + writer.WriteNumberValue(Cores.Value); + } + if (options.Format != "W" && Optional.IsDefined(AzureSkuName)) + { + writer.WritePropertyName("azureSkuName"u8); + writer.WriteStringValue(AzureSkuName.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(AvailableCores)) + { + writer.WritePropertyName("availableCores"u8); + writer.WriteNumberValue(AvailableCores.Value); + } + if (options.Format != "W" && Optional.IsDefined(MaxNetworkInterfaces)) + { + writer.WritePropertyName("maxNetworkInterfaces"u8); + writer.WriteNumberValue(MaxNetworkInterfaces.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureVmSkuDto IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureVmSkuDto)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureVmSkuDto(document.RootElement, options); + } + + internal static AzureVmSkuDto DeserializeAzureVmSkuDto(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureVmFamily? azureVmFamily = default; + int? cores = default; + AzureVmSize? azureSkuName = default; + int? availableCores = default; + int? maxNetworkInterfaces = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azureVmFamily"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureVmFamily = new AzureVmFamily(property.Value.GetString()); + continue; + } + if (property.NameEquals("cores"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cores = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("azureSkuName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSkuName = new AzureVmSize(property.Value.GetString()); + continue; + } + if (property.NameEquals("availableCores"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + availableCores = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxNetworkInterfaces"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxNetworkInterfaces = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureVmSkuDto( + azureVmFamily, + cores, + azureSkuName, + availableCores, + maxNetworkInterfaces, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureVmSkuDto)} does not support writing '{options.Format}' format."); + } + } + + AzureVmSkuDto IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureVmSkuDto(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureVmSkuDto)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureVmSkuDto.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureVmSkuDto.cs new file mode 100644 index 000000000000..e3434f6bc814 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureVmSkuDto.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Azure Virtual Machine SKU. + public partial class AzureVmSkuDto + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal AzureVmSkuDto() + { + } + + /// Initializes a new instance of . + /// Gets the Virtual Machine Family, for example : standardMSFamily. + /// Gets the Compute Size in vCores. + /// Gets the Virtual Machine SKU name,: E.g. : Standard_F16s. + /// + /// Gets the Available vCores. This can be less than the vCores in the Constrained + /// vCPU VM Sizes. + /// + /// Gets the Max network interfaces. + /// Keeps track of any properties unknown to the library. + internal AzureVmSkuDto(AzureVmFamily? azureVmFamily, int? cores, AzureVmSize? azureSkuName, int? availableCores, int? maxNetworkInterfaces, IDictionary serializedAdditionalRawData) + { + AzureVmFamily = azureVmFamily; + Cores = cores; + AzureSkuName = azureSkuName; + AvailableCores = availableCores; + MaxNetworkInterfaces = maxNetworkInterfaces; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the Virtual Machine Family, for example : standardMSFamily. + public AzureVmFamily? AzureVmFamily { get; } + /// Gets the Compute Size in vCores. + public int? Cores { get; } + /// Gets the Virtual Machine SKU name,: E.g. : Standard_F16s. + public AzureVmSize? AzureSkuName { get; } + /// + /// Gets the Available vCores. This can be less than the vCores in the Constrained + /// vCPU VM Sizes. + /// + public int? AvailableCores { get; } + /// Gets the Max network interfaces. + public int? MaxNetworkInterfaces { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureVmSuitabilityDetail.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureVmSuitabilityDetail.cs new file mode 100644 index 000000000000..05e28ea969bf --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureVmSuitabilityDetail.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AzureVmSuitabilityDetail. + public readonly partial struct AzureVmSuitabilityDetail : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureVmSuitabilityDetail(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string RecommendedSizeHasLessNetworkAdaptersValue = "RecommendedSizeHasLessNetworkAdapters"; + private const string CannotReportComputeCostValue = "CannotReportComputeCost"; + private const string CannotReportStorageCostValue = "CannotReportStorageCost"; + private const string CannotReportBandwidthCostsValue = "CannotReportBandwidthCosts"; + private const string PercentageOfCoresUtilizedMissingValue = "PercentageOfCoresUtilizedMissing"; + private const string PercentageOfMemoryUtilizedMissingValue = "PercentageOfMemoryUtilizedMissing"; + private const string PercentageOfCoresUtilizedOutOfRangeValue = "PercentageOfCoresUtilizedOutOfRange"; + private const string PercentageOfMemoryUtilizedOutOfRangeValue = "PercentageOfMemoryUtilizedOutOfRange"; + + /// None. + public static AzureVmSuitabilityDetail None { get; } = new AzureVmSuitabilityDetail(NoneValue); + /// RecommendedSizeHasLessNetworkAdapters. + public static AzureVmSuitabilityDetail RecommendedSizeHasLessNetworkAdapters { get; } = new AzureVmSuitabilityDetail(RecommendedSizeHasLessNetworkAdaptersValue); + /// CannotReportComputeCost. + public static AzureVmSuitabilityDetail CannotReportComputeCost { get; } = new AzureVmSuitabilityDetail(CannotReportComputeCostValue); + /// CannotReportStorageCost. + public static AzureVmSuitabilityDetail CannotReportStorageCost { get; } = new AzureVmSuitabilityDetail(CannotReportStorageCostValue); + /// CannotReportBandwidthCosts. + public static AzureVmSuitabilityDetail CannotReportBandwidthCosts { get; } = new AzureVmSuitabilityDetail(CannotReportBandwidthCostsValue); + /// PercentageOfCoresUtilizedMissing. + public static AzureVmSuitabilityDetail PercentageOfCoresUtilizedMissing { get; } = new AzureVmSuitabilityDetail(PercentageOfCoresUtilizedMissingValue); + /// PercentageOfMemoryUtilizedMissing. + public static AzureVmSuitabilityDetail PercentageOfMemoryUtilizedMissing { get; } = new AzureVmSuitabilityDetail(PercentageOfMemoryUtilizedMissingValue); + /// PercentageOfCoresUtilizedOutOfRange. + public static AzureVmSuitabilityDetail PercentageOfCoresUtilizedOutOfRange { get; } = new AzureVmSuitabilityDetail(PercentageOfCoresUtilizedOutOfRangeValue); + /// PercentageOfMemoryUtilizedOutOfRange. + public static AzureVmSuitabilityDetail PercentageOfMemoryUtilizedOutOfRange { get; } = new AzureVmSuitabilityDetail(PercentageOfMemoryUtilizedOutOfRangeValue); + /// Determines if two values are the same. + public static bool operator ==(AzureVmSuitabilityDetail left, AzureVmSuitabilityDetail right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureVmSuitabilityDetail left, AzureVmSuitabilityDetail right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureVmSuitabilityDetail(string value) => new AzureVmSuitabilityDetail(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureVmSuitabilityDetail other && Equals(other); + /// + public bool Equals(AzureVmSuitabilityDetail other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureVmSuitabilityExplanation.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureVmSuitabilityExplanation.cs new file mode 100644 index 000000000000..9a9e856d5fe4 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/AzureVmSuitabilityExplanation.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The AzureVmSuitabilityExplanation. + public readonly partial struct AzureVmSuitabilityExplanation : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureVmSuitabilityExplanation(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string NotApplicableValue = "NotApplicable"; + private const string GuestOperatingSystemArchitectureNotSupportedValue = "GuestOperatingSystemArchitectureNotSupported"; + private const string GuestOperatingSystemNotSupportedValue = "GuestOperatingSystemNotSupported"; + private const string BootTypeNotSupportedValue = "BootTypeNotSupported"; + private const string MoreDisksThanSupportedValue = "MoreDisksThanSupported"; + private const string NoSuitableVmSizeFoundValue = "NoSuitableVmSizeFound"; + private const string OneOrMoreDisksNotSuitableValue = "OneOrMoreDisksNotSuitable"; + private const string OneOrMoreAdaptersNotSuitableValue = "OneOrMoreAdaptersNotSuitable"; + private const string InternalErrorOccurredDuringComputeEvaluationValue = "InternalErrorOccurredDuringComputeEvaluation"; + private const string InternalErrorOccurredDuringStorageEvaluationValue = "InternalErrorOccurredDuringStorageEvaluation"; + private const string InternalErrorOccurredDuringNetworkEvaluationValue = "InternalErrorOccurredDuringNetworkEvaluation"; + private const string NoVmSizeSupportsStoragePerformanceValue = "NoVmSizeSupportsStoragePerformance"; + private const string NoVmSizeSupportsNetworkPerformanceValue = "NoVmSizeSupportsNetworkPerformance"; + private const string NoVmSizeForSelectedPricingTierValue = "NoVmSizeForSelectedPricingTier"; + private const string NoVmSizeForSelectedAzureLocationValue = "NoVmSizeForSelectedAzureLocation"; + private const string CheckRedHatLinuxVersionValue = "CheckRedHatLinuxVersion"; + private const string CheckOpenSuseLinuxVersionValue = "CheckOpenSuseLinuxVersion"; + private const string CheckWindowsServer2008R2VersionValue = "CheckWindowsServer2008R2Version"; + private const string CheckCentOSVersionValue = "CheckCentOsVersion"; + private const string CheckDebianLinuxVersionValue = "CheckDebianLinuxVersion"; + private const string CheckSuseLinuxVersionValue = "CheckSuseLinuxVersion"; + private const string CheckOracleLinuxVersionValue = "CheckOracleLinuxVersion"; + private const string CheckUbuntuLinuxVersionValue = "CheckUbuntuLinuxVersion"; + private const string CheckCoreOSLinuxVersionValue = "CheckCoreOsLinuxVersion"; + private const string WindowsServerVersionConditionallySupportedValue = "WindowsServerVersionConditionallySupported"; + private const string NoGuestOperatingSystemConditionallySupportedValue = "NoGuestOperatingSystemConditionallySupported"; + private const string WindowsClientVersionsConditionallySupportedValue = "WindowsClientVersionsConditionallySupported"; + private const string BootTypeUnknownValue = "BootTypeUnknown"; + private const string GuestOperatingSystemUnknownValue = "GuestOperatingSystemUnknown"; + private const string WindowsServerVersionsSupportedWithCaveatValue = "WindowsServerVersionsSupportedWithCaveat"; + private const string WindowsOSNoLongerUnderMSSupportValue = "WindowsOSNoLongerUnderMSSupport"; + private const string EndorsedWithConditionsLinuxDistributionsValue = "EndorsedWithConditionsLinuxDistributions"; + private const string UnendorsedLinuxDistributionsValue = "UnendorsedLinuxDistributions"; + private const string NoVmSizeForStandardPricingTierValue = "NoVmSizeForStandardPricingTier"; + private const string NoVmSizeForBasicPricingTierValue = "NoVmSizeForBasicPricingTier"; + private const string NoVmSizeInSelectedFamilyFoundValue = "NoVmSizeInSelectedFamilyFound"; + private const string NoEAPriceFoundForVmSizeValue = "NoEaPriceFoundForVmSize"; + private const string NoVmSizeFoundForOfferCurrencyReservedInstanceValue = "NoVmSizeFoundForOfferCurrencyReservedInstance"; + + /// Unknown. + public static AzureVmSuitabilityExplanation Unknown { get; } = new AzureVmSuitabilityExplanation(UnknownValue); + /// NotApplicable. + public static AzureVmSuitabilityExplanation NotApplicable { get; } = new AzureVmSuitabilityExplanation(NotApplicableValue); + /// GuestOperatingSystemArchitectureNotSupported. + public static AzureVmSuitabilityExplanation GuestOperatingSystemArchitectureNotSupported { get; } = new AzureVmSuitabilityExplanation(GuestOperatingSystemArchitectureNotSupportedValue); + /// GuestOperatingSystemNotSupported. + public static AzureVmSuitabilityExplanation GuestOperatingSystemNotSupported { get; } = new AzureVmSuitabilityExplanation(GuestOperatingSystemNotSupportedValue); + /// BootTypeNotSupported. + public static AzureVmSuitabilityExplanation BootTypeNotSupported { get; } = new AzureVmSuitabilityExplanation(BootTypeNotSupportedValue); + /// MoreDisksThanSupported. + public static AzureVmSuitabilityExplanation MoreDisksThanSupported { get; } = new AzureVmSuitabilityExplanation(MoreDisksThanSupportedValue); + /// NoSuitableVmSizeFound. + public static AzureVmSuitabilityExplanation NoSuitableVmSizeFound { get; } = new AzureVmSuitabilityExplanation(NoSuitableVmSizeFoundValue); + /// OneOrMoreDisksNotSuitable. + public static AzureVmSuitabilityExplanation OneOrMoreDisksNotSuitable { get; } = new AzureVmSuitabilityExplanation(OneOrMoreDisksNotSuitableValue); + /// OneOrMoreAdaptersNotSuitable. + public static AzureVmSuitabilityExplanation OneOrMoreAdaptersNotSuitable { get; } = new AzureVmSuitabilityExplanation(OneOrMoreAdaptersNotSuitableValue); + /// InternalErrorOccurredDuringComputeEvaluation. + public static AzureVmSuitabilityExplanation InternalErrorOccurredDuringComputeEvaluation { get; } = new AzureVmSuitabilityExplanation(InternalErrorOccurredDuringComputeEvaluationValue); + /// InternalErrorOccurredDuringStorageEvaluation. + public static AzureVmSuitabilityExplanation InternalErrorOccurredDuringStorageEvaluation { get; } = new AzureVmSuitabilityExplanation(InternalErrorOccurredDuringStorageEvaluationValue); + /// InternalErrorOccurredDuringNetworkEvaluation. + public static AzureVmSuitabilityExplanation InternalErrorOccurredDuringNetworkEvaluation { get; } = new AzureVmSuitabilityExplanation(InternalErrorOccurredDuringNetworkEvaluationValue); + /// NoVmSizeSupportsStoragePerformance. + public static AzureVmSuitabilityExplanation NoVmSizeSupportsStoragePerformance { get; } = new AzureVmSuitabilityExplanation(NoVmSizeSupportsStoragePerformanceValue); + /// NoVmSizeSupportsNetworkPerformance. + public static AzureVmSuitabilityExplanation NoVmSizeSupportsNetworkPerformance { get; } = new AzureVmSuitabilityExplanation(NoVmSizeSupportsNetworkPerformanceValue); + /// NoVmSizeForSelectedPricingTier. + public static AzureVmSuitabilityExplanation NoVmSizeForSelectedPricingTier { get; } = new AzureVmSuitabilityExplanation(NoVmSizeForSelectedPricingTierValue); + /// NoVmSizeForSelectedAzureLocation. + public static AzureVmSuitabilityExplanation NoVmSizeForSelectedAzureLocation { get; } = new AzureVmSuitabilityExplanation(NoVmSizeForSelectedAzureLocationValue); + /// CheckRedHatLinuxVersion. + public static AzureVmSuitabilityExplanation CheckRedHatLinuxVersion { get; } = new AzureVmSuitabilityExplanation(CheckRedHatLinuxVersionValue); + /// CheckOpenSuseLinuxVersion. + public static AzureVmSuitabilityExplanation CheckOpenSuseLinuxVersion { get; } = new AzureVmSuitabilityExplanation(CheckOpenSuseLinuxVersionValue); + /// CheckWindowsServer2008R2Version. + public static AzureVmSuitabilityExplanation CheckWindowsServer2008R2Version { get; } = new AzureVmSuitabilityExplanation(CheckWindowsServer2008R2VersionValue); + /// CheckCentOsVersion. + public static AzureVmSuitabilityExplanation CheckCentOSVersion { get; } = new AzureVmSuitabilityExplanation(CheckCentOSVersionValue); + /// CheckDebianLinuxVersion. + public static AzureVmSuitabilityExplanation CheckDebianLinuxVersion { get; } = new AzureVmSuitabilityExplanation(CheckDebianLinuxVersionValue); + /// CheckSuseLinuxVersion. + public static AzureVmSuitabilityExplanation CheckSuseLinuxVersion { get; } = new AzureVmSuitabilityExplanation(CheckSuseLinuxVersionValue); + /// CheckOracleLinuxVersion. + public static AzureVmSuitabilityExplanation CheckOracleLinuxVersion { get; } = new AzureVmSuitabilityExplanation(CheckOracleLinuxVersionValue); + /// CheckUbuntuLinuxVersion. + public static AzureVmSuitabilityExplanation CheckUbuntuLinuxVersion { get; } = new AzureVmSuitabilityExplanation(CheckUbuntuLinuxVersionValue); + /// CheckCoreOsLinuxVersion. + public static AzureVmSuitabilityExplanation CheckCoreOSLinuxVersion { get; } = new AzureVmSuitabilityExplanation(CheckCoreOSLinuxVersionValue); + /// WindowsServerVersionConditionallySupported. + public static AzureVmSuitabilityExplanation WindowsServerVersionConditionallySupported { get; } = new AzureVmSuitabilityExplanation(WindowsServerVersionConditionallySupportedValue); + /// NoGuestOperatingSystemConditionallySupported. + public static AzureVmSuitabilityExplanation NoGuestOperatingSystemConditionallySupported { get; } = new AzureVmSuitabilityExplanation(NoGuestOperatingSystemConditionallySupportedValue); + /// WindowsClientVersionsConditionallySupported. + public static AzureVmSuitabilityExplanation WindowsClientVersionsConditionallySupported { get; } = new AzureVmSuitabilityExplanation(WindowsClientVersionsConditionallySupportedValue); + /// BootTypeUnknown. + public static AzureVmSuitabilityExplanation BootTypeUnknown { get; } = new AzureVmSuitabilityExplanation(BootTypeUnknownValue); + /// GuestOperatingSystemUnknown. + public static AzureVmSuitabilityExplanation GuestOperatingSystemUnknown { get; } = new AzureVmSuitabilityExplanation(GuestOperatingSystemUnknownValue); + /// WindowsServerVersionsSupportedWithCaveat. + public static AzureVmSuitabilityExplanation WindowsServerVersionsSupportedWithCaveat { get; } = new AzureVmSuitabilityExplanation(WindowsServerVersionsSupportedWithCaveatValue); + /// WindowsOSNoLongerUnderMSSupport. + public static AzureVmSuitabilityExplanation WindowsOSNoLongerUnderMSSupport { get; } = new AzureVmSuitabilityExplanation(WindowsOSNoLongerUnderMSSupportValue); + /// EndorsedWithConditionsLinuxDistributions. + public static AzureVmSuitabilityExplanation EndorsedWithConditionsLinuxDistributions { get; } = new AzureVmSuitabilityExplanation(EndorsedWithConditionsLinuxDistributionsValue); + /// UnendorsedLinuxDistributions. + public static AzureVmSuitabilityExplanation UnendorsedLinuxDistributions { get; } = new AzureVmSuitabilityExplanation(UnendorsedLinuxDistributionsValue); + /// NoVmSizeForStandardPricingTier. + public static AzureVmSuitabilityExplanation NoVmSizeForStandardPricingTier { get; } = new AzureVmSuitabilityExplanation(NoVmSizeForStandardPricingTierValue); + /// NoVmSizeForBasicPricingTier. + public static AzureVmSuitabilityExplanation NoVmSizeForBasicPricingTier { get; } = new AzureVmSuitabilityExplanation(NoVmSizeForBasicPricingTierValue); + /// NoVmSizeInSelectedFamilyFound. + public static AzureVmSuitabilityExplanation NoVmSizeInSelectedFamilyFound { get; } = new AzureVmSuitabilityExplanation(NoVmSizeInSelectedFamilyFoundValue); + /// NoEaPriceFoundForVmSize. + public static AzureVmSuitabilityExplanation NoEAPriceFoundForVmSize { get; } = new AzureVmSuitabilityExplanation(NoEAPriceFoundForVmSizeValue); + /// NoVmSizeFoundForOfferCurrencyReservedInstance. + public static AzureVmSuitabilityExplanation NoVmSizeFoundForOfferCurrencyReservedInstance { get; } = new AzureVmSuitabilityExplanation(NoVmSizeFoundForOfferCurrencyReservedInstanceValue); + /// Determines if two values are the same. + public static bool operator ==(AzureVmSuitabilityExplanation left, AzureVmSuitabilityExplanation right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureVmSuitabilityExplanation left, AzureVmSuitabilityExplanation right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureVmSuitabilityExplanation(string value) => new AzureVmSuitabilityExplanation(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureVmSuitabilityExplanation other && Equals(other); + /// + public bool Equals(AzureVmSuitabilityExplanation other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/CollectorAgentPropertiesBase.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/CollectorAgentPropertiesBase.Serialization.cs new file mode 100644 index 000000000000..f8f3cf705b7c --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/CollectorAgentPropertiesBase.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class CollectorAgentPropertiesBase : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CollectorAgentPropertiesBase)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + if (Optional.IsDefined(LastHeartbeatOn)) + { + writer.WritePropertyName("lastHeartbeatUtc"u8); + writer.WriteStringValue(LastHeartbeatOn.Value, "O"); + } + if (Optional.IsDefined(SpnDetails)) + { + writer.WritePropertyName("spnDetails"u8); + writer.WriteObjectValue(SpnDetails, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CollectorAgentPropertiesBase IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CollectorAgentPropertiesBase)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCollectorAgentPropertiesBase(document.RootElement, options); + } + + internal static CollectorAgentPropertiesBase DeserializeCollectorAgentPropertiesBase(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string version = default; + DateTimeOffset? lastHeartbeatUtc = default; + CollectorAgentSpnPropertiesBase spnDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastHeartbeatUtc"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastHeartbeatUtc = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("spnDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + spnDetails = CollectorAgentSpnPropertiesBase.DeserializeCollectorAgentSpnPropertiesBase(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CollectorAgentPropertiesBase(id, version, lastHeartbeatUtc, spnDetails, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CollectorAgentPropertiesBase)} does not support writing '{options.Format}' format."); + } + } + + CollectorAgentPropertiesBase IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCollectorAgentPropertiesBase(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CollectorAgentPropertiesBase)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/CollectorAgentPropertiesBase.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/CollectorAgentPropertiesBase.cs new file mode 100644 index 000000000000..ef5c89e9f5e5 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/CollectorAgentPropertiesBase.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Collector agent property class. + public partial class CollectorAgentPropertiesBase + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public CollectorAgentPropertiesBase() + { + } + + /// Initializes a new instance of . + /// Gets the collector agent id. + /// Gets the collector agent version. + /// Gets the collector last heartbeat time. + /// Gets or sets the SPN details. + /// Keeps track of any properties unknown to the library. + internal CollectorAgentPropertiesBase(string id, string version, DateTimeOffset? lastHeartbeatOn, CollectorAgentSpnPropertiesBase spnDetails, IDictionary serializedAdditionalRawData) + { + Id = id; + Version = version; + LastHeartbeatOn = lastHeartbeatOn; + SpnDetails = spnDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the collector agent id. + public string Id { get; set; } + /// Gets the collector agent version. + public string Version { get; set; } + /// Gets the collector last heartbeat time. + public DateTimeOffset? LastHeartbeatOn { get; set; } + /// Gets or sets the SPN details. + public CollectorAgentSpnPropertiesBase SpnDetails { get; set; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/CollectorAgentSpnPropertiesBase.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/CollectorAgentSpnPropertiesBase.Serialization.cs new file mode 100644 index 000000000000..58700448492f --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/CollectorAgentSpnPropertiesBase.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class CollectorAgentSpnPropertiesBase : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CollectorAgentSpnPropertiesBase)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Authority)) + { + writer.WritePropertyName("authority"u8); + writer.WriteStringValue(Authority); + } + if (Optional.IsDefined(ApplicationId)) + { + writer.WritePropertyName("applicationId"u8); + writer.WriteStringValue(ApplicationId); + } + if (Optional.IsDefined(Audience)) + { + writer.WritePropertyName("audience"u8); + writer.WriteStringValue(Audience); + } + if (Optional.IsDefined(ObjectId)) + { + writer.WritePropertyName("objectId"u8); + writer.WriteStringValue(ObjectId); + } + if (Optional.IsDefined(TenantId)) + { + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CollectorAgentSpnPropertiesBase IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CollectorAgentSpnPropertiesBase)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCollectorAgentSpnPropertiesBase(document.RootElement, options); + } + + internal static CollectorAgentSpnPropertiesBase DeserializeCollectorAgentSpnPropertiesBase(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string authority = default; + string applicationId = default; + string audience = default; + string objectId = default; + Guid? tenantId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authority"u8)) + { + authority = property.Value.GetString(); + continue; + } + if (property.NameEquals("applicationId"u8)) + { + applicationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("audience"u8)) + { + audience = property.Value.GetString(); + continue; + } + if (property.NameEquals("objectId"u8)) + { + objectId = property.Value.GetString(); + continue; + } + if (property.NameEquals("tenantId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tenantId = property.Value.GetGuid(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CollectorAgentSpnPropertiesBase( + authority, + applicationId, + audience, + objectId, + tenantId, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CollectorAgentSpnPropertiesBase)} does not support writing '{options.Format}' format."); + } + } + + CollectorAgentSpnPropertiesBase IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCollectorAgentSpnPropertiesBase(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CollectorAgentSpnPropertiesBase)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/CollectorAgentSpnPropertiesBase.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/CollectorAgentSpnPropertiesBase.cs new file mode 100644 index 000000000000..d1f51dccb74a --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/CollectorAgentSpnPropertiesBase.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Collector agent SPN details class. + public partial class CollectorAgentSpnPropertiesBase + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public CollectorAgentSpnPropertiesBase() + { + } + + /// Initializes a new instance of . + /// Gets the AAD authority endpoint. + /// Gets the AAD application id. + /// Gets the AAD audience url. + /// Gets the object id of the AAD application. + /// Gets the tenant id of the AAD application. + /// Keeps track of any properties unknown to the library. + internal CollectorAgentSpnPropertiesBase(string authority, string applicationId, string audience, string objectId, Guid? tenantId, IDictionary serializedAdditionalRawData) + { + Authority = authority; + ApplicationId = applicationId; + Audience = audience; + ObjectId = objectId; + TenantId = tenantId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the AAD authority endpoint. + public string Authority { get; set; } + /// Gets the AAD application id. + public string ApplicationId { get; set; } + /// Gets the AAD audience url. + public string Audience { get; set; } + /// Gets the object id of the AAD application. + public string ObjectId { get; set; } + /// Gets the tenant id of the AAD application. + public Guid? TenantId { get; set; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/CompatibilityLevel.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/CompatibilityLevel.cs new file mode 100644 index 000000000000..46ddfa6c76d0 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/CompatibilityLevel.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The CompatibilityLevel. + public readonly partial struct CompatibilityLevel : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CompatibilityLevel(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string CompatLevel80Value = "CompatLevel80"; + private const string CompatLevel90Value = "CompatLevel90"; + private const string CompatLevel100Value = "CompatLevel100"; + private const string CompatLevel110Value = "CompatLevel110"; + private const string CompatLevel120Value = "CompatLevel120"; + private const string CompatLevel130Value = "CompatLevel130"; + private const string CompatLevel140Value = "CompatLevel140"; + private const string CompatLevel150Value = "CompatLevel150"; + + /// Unknown. + public static CompatibilityLevel Unknown { get; } = new CompatibilityLevel(UnknownValue); + /// CompatLevel80. + public static CompatibilityLevel CompatLevel80 { get; } = new CompatibilityLevel(CompatLevel80Value); + /// CompatLevel90. + public static CompatibilityLevel CompatLevel90 { get; } = new CompatibilityLevel(CompatLevel90Value); + /// CompatLevel100. + public static CompatibilityLevel CompatLevel100 { get; } = new CompatibilityLevel(CompatLevel100Value); + /// CompatLevel110. + public static CompatibilityLevel CompatLevel110 { get; } = new CompatibilityLevel(CompatLevel110Value); + /// CompatLevel120. + public static CompatibilityLevel CompatLevel120 { get; } = new CompatibilityLevel(CompatLevel120Value); + /// CompatLevel130. + public static CompatibilityLevel CompatLevel130 { get; } = new CompatibilityLevel(CompatLevel130Value); + /// CompatLevel140. + public static CompatibilityLevel CompatLevel140 { get; } = new CompatibilityLevel(CompatLevel140Value); + /// CompatLevel150. + public static CompatibilityLevel CompatLevel150 { get; } = new CompatibilityLevel(CompatLevel150Value); + /// Determines if two values are the same. + public static bool operator ==(CompatibilityLevel left, CompatibilityLevel right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CompatibilityLevel left, CompatibilityLevel right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CompatibilityLevel(string value) => new CompatibilityLevel(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CompatibilityLevel other && Equals(other); + /// + public bool Equals(CompatibilityLevel other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/CostComponent.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/CostComponent.Serialization.cs new file mode 100644 index 000000000000..adb19fe3f28f --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/CostComponent.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class CostComponent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CostComponent)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name.Value.ToString()); + } + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteNumberValue(Value.Value); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CostComponent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CostComponent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCostComponent(document.RootElement, options); + } + + internal static CostComponent DeserializeCostComponent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CostComponentName? name = default; + double? value = default; + string description = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + name = new CostComponentName(property.Value.GetString()); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + value = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CostComponent(name, value, description, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CostComponent)} does not support writing '{options.Format}' format."); + } + } + + CostComponent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCostComponent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CostComponent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/CostComponent.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/CostComponent.cs new file mode 100644 index 000000000000..ebe4bc29b430 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/CostComponent.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Class to represent the component of the cost. + public partial class CostComponent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public CostComponent() + { + } + + /// Initializes a new instance of . + /// Gets the name of the component. + /// The value of the component. + /// The textual description of the component. + /// Keeps track of any properties unknown to the library. + internal CostComponent(CostComponentName? name, double? value, string description, IDictionary serializedAdditionalRawData) + { + Name = name; + Value = value; + Description = description; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the name of the component. + public CostComponentName? Name { get; } + /// The value of the component. + public double? Value { get; set; } + /// The textual description of the component. + public string Description { get; set; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/CostComponentName.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/CostComponentName.cs new file mode 100644 index 000000000000..60096f2aed43 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/CostComponentName.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Enum to represent component name. + public readonly partial struct CostComponentName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CostComponentName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string MonthlyAzureHybridCostSavingsValue = "MonthlyAzureHybridCostSavings"; + private const string MonthlySecurityCostValue = "MonthlySecurityCost"; + private const string MonthlyPremiumV2StorageCostValue = "MonthlyPremiumV2StorageCost"; + + /// Unknown. + public static CostComponentName Unknown { get; } = new CostComponentName(UnknownValue); + /// MonthlyAzureHybridCostSavings. + public static CostComponentName MonthlyAzureHybridCostSavings { get; } = new CostComponentName(MonthlyAzureHybridCostSavingsValue); + /// MonthlySecurityCost. + public static CostComponentName MonthlySecurityCost { get; } = new CostComponentName(MonthlySecurityCostValue); + /// MonthlyPremiumV2StorageCost. + public static CostComponentName MonthlyPremiumV2StorageCost { get; } = new CostComponentName(MonthlyPremiumV2StorageCostValue); + /// Determines if two values are the same. + public static bool operator ==(CostComponentName left, CostComponentName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CostComponentName left, CostComponentName right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CostComponentName(string value) => new CostComponentName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CostComponentName other && Equals(other); + /// + public bool Equals(CostComponentName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/EntityUptime.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/EntityUptime.Serialization.cs new file mode 100644 index 000000000000..3c27b8cb3f08 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/EntityUptime.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class EntityUptime : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntityUptime)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DaysPerMonth)) + { + writer.WritePropertyName("daysPerMonth"u8); + writer.WriteNumberValue(DaysPerMonth.Value); + } + if (Optional.IsDefined(HoursPerDay)) + { + writer.WritePropertyName("hoursPerDay"u8); + writer.WriteNumberValue(HoursPerDay.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EntityUptime IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntityUptime)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEntityUptime(document.RootElement, options); + } + + internal static EntityUptime DeserializeEntityUptime(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? daysPerMonth = default; + int? hoursPerDay = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("daysPerMonth"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + daysPerMonth = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("hoursPerDay"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hoursPerDay = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EntityUptime(daysPerMonth, hoursPerDay, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EntityUptime)} does not support writing '{options.Format}' format."); + } + } + + EntityUptime IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEntityUptime(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EntityUptime)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/EntityUptime.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/EntityUptime.cs new file mode 100644 index 000000000000..aab61ed5b510 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/EntityUptime.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Entity Uptime. + public partial class EntityUptime + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public EntityUptime() + { + } + + /// Initializes a new instance of . + /// Gets the days per month. + /// Gets the hours per day. + /// Keeps track of any properties unknown to the library. + internal EntityUptime(int? daysPerMonth, int? hoursPerDay, IDictionary serializedAdditionalRawData) + { + DaysPerMonth = daysPerMonth; + HoursPerDay = hoursPerDay; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the days per month. + public int? DaysPerMonth { get; set; } + /// Gets the hours per day. + public int? HoursPerDay { get; set; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/FttAndRaidLevel.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/FttAndRaidLevel.cs new file mode 100644 index 000000000000..10e2f3c95ac4 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/FttAndRaidLevel.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The FttAndRaidLevel. + public readonly partial struct FttAndRaidLevel : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FttAndRaidLevel(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string Ftt1Raid1Value = "Ftt1Raid1"; + private const string Ftt1Raid5Value = "Ftt1Raid5"; + private const string Ftt2Raid1Value = "Ftt2Raid1"; + private const string Ftt2Raid6Value = "Ftt2Raid6"; + private const string Ftt3Raid1Value = "Ftt3Raid1"; + + /// Unknown. + public static FttAndRaidLevel Unknown { get; } = new FttAndRaidLevel(UnknownValue); + /// Ftt1Raid1. + public static FttAndRaidLevel Ftt1Raid1 { get; } = new FttAndRaidLevel(Ftt1Raid1Value); + /// Ftt1Raid5. + public static FttAndRaidLevel Ftt1Raid5 { get; } = new FttAndRaidLevel(Ftt1Raid5Value); + /// Ftt2Raid1. + public static FttAndRaidLevel Ftt2Raid1 { get; } = new FttAndRaidLevel(Ftt2Raid1Value); + /// Ftt2Raid6. + public static FttAndRaidLevel Ftt2Raid6 { get; } = new FttAndRaidLevel(Ftt2Raid6Value); + /// Ftt3Raid1. + public static FttAndRaidLevel Ftt3Raid1 { get; } = new FttAndRaidLevel(Ftt3Raid1Value); + /// Determines if two values are the same. + public static bool operator ==(FttAndRaidLevel left, FttAndRaidLevel right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FttAndRaidLevel left, FttAndRaidLevel right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator FttAndRaidLevel(string value) => new FttAndRaidLevel(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FttAndRaidLevel other && Equals(other); + /// + public bool Equals(FttAndRaidLevel other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/GroupListResult.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/GroupListResult.Serialization.cs new file mode 100644 index 000000000000..7107f21b9d92 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/GroupListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class GroupListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GroupListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + GroupListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GroupListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGroupListResult(document.RootElement, options); + } + + internal static GroupListResult DeserializeGroupListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MigrationAssessmentGroupData.DeserializeMigrationAssessmentGroupData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GroupListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GroupListResult)} does not support writing '{options.Format}' format."); + } + } + + GroupListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGroupListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GroupListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/GroupListResult.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/GroupListResult.cs new file mode 100644 index 000000000000..cc76fabda2c9 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/GroupListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The response of a Group list operation. + internal partial class GroupListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The Group items on this page. + /// is null. + internal GroupListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Group items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal GroupListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GroupListResult() + { + } + + /// The Group items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/GuestOperatingSystemArchitecture.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/GuestOperatingSystemArchitecture.cs new file mode 100644 index 000000000000..853d92b38004 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/GuestOperatingSystemArchitecture.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The GuestOperatingSystemArchitecture. + public readonly partial struct GuestOperatingSystemArchitecture : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public GuestOperatingSystemArchitecture(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string X86Value = "X86"; + private const string X64Value = "X64"; + + /// Unknown. + public static GuestOperatingSystemArchitecture Unknown { get; } = new GuestOperatingSystemArchitecture(UnknownValue); + /// X86. + public static GuestOperatingSystemArchitecture X86 { get; } = new GuestOperatingSystemArchitecture(X86Value); + /// X64. + public static GuestOperatingSystemArchitecture X64 { get; } = new GuestOperatingSystemArchitecture(X64Value); + /// Determines if two values are the same. + public static bool operator ==(GuestOperatingSystemArchitecture left, GuestOperatingSystemArchitecture right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(GuestOperatingSystemArchitecture left, GuestOperatingSystemArchitecture right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator GuestOperatingSystemArchitecture(string value) => new GuestOperatingSystemArchitecture(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is GuestOperatingSystemArchitecture other && Equals(other); + /// + public bool Equals(GuestOperatingSystemArchitecture other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/HyperVCollectorListResult.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/HyperVCollectorListResult.Serialization.cs new file mode 100644 index 000000000000..b3df41a5dece --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/HyperVCollectorListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class HyperVCollectorListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVCollectorListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HyperVCollectorListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVCollectorListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVCollectorListResult(document.RootElement, options); + } + + internal static HyperVCollectorListResult DeserializeHyperVCollectorListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MigrationAssessmentHyperVCollectorData.DeserializeMigrationAssessmentHyperVCollectorData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVCollectorListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(HyperVCollectorListResult)} does not support writing '{options.Format}' format."); + } + } + + HyperVCollectorListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHyperVCollectorListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVCollectorListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/HyperVCollectorListResult.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/HyperVCollectorListResult.cs new file mode 100644 index 000000000000..f61a3d30d39b --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/HyperVCollectorListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The response of a HypervCollector list operation. + internal partial class HyperVCollectorListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The HypervCollector items on this page. + /// is null. + internal HyperVCollectorListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The HypervCollector items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal HyperVCollectorListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal HyperVCollectorListResult() + { + } + + /// The HypervCollector items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ImpactedAssessmentObject.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ImpactedAssessmentObject.Serialization.cs new file mode 100644 index 000000000000..fa08b03bd012 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ImpactedAssessmentObject.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class ImpactedAssessmentObject : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImpactedAssessmentObject)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ObjectName)) + { + writer.WritePropertyName("objectName"u8); + writer.WriteStringValue(ObjectName); + } + if (options.Format != "W" && Optional.IsDefined(ObjectType)) + { + writer.WritePropertyName("objectType"u8); + writer.WriteStringValue(ObjectType); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ImpactedAssessmentObject IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImpactedAssessmentObject)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImpactedAssessmentObject(document.RootElement, options); + } + + internal static ImpactedAssessmentObject DeserializeImpactedAssessmentObject(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string objectName = default; + string objectType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("objectName"u8)) + { + objectName = property.Value.GetString(); + continue; + } + if (property.NameEquals("objectType"u8)) + { + objectType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImpactedAssessmentObject(objectName, objectType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ImpactedAssessmentObject)} does not support writing '{options.Format}' format."); + } + } + + ImpactedAssessmentObject IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeImpactedAssessmentObject(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImpactedAssessmentObject)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ImpactedAssessmentObject.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ImpactedAssessmentObject.cs new file mode 100644 index 000000000000..e84f049ea185 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ImpactedAssessmentObject.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Class representing the impacted objects. + public partial class ImpactedAssessmentObject + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ImpactedAssessmentObject() + { + } + + /// Initializes a new instance of . + /// Gets the object name. + /// Gets the object type. + /// Keeps track of any properties unknown to the library. + internal ImpactedAssessmentObject(string objectName, string objectType, IDictionary serializedAdditionalRawData) + { + ObjectName = objectName; + ObjectType = objectType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the object name. + public string ObjectName { get; } + /// Gets the object type. + public string ObjectType { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ImportCollectorListResult.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ImportCollectorListResult.Serialization.cs new file mode 100644 index 000000000000..c85b9b699609 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ImportCollectorListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class ImportCollectorListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImportCollectorListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ImportCollectorListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImportCollectorListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImportCollectorListResult(document.RootElement, options); + } + + internal static ImportCollectorListResult DeserializeImportCollectorListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MigrationAssessmentImportCollectorData.DeserializeMigrationAssessmentImportCollectorData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImportCollectorListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ImportCollectorListResult)} does not support writing '{options.Format}' format."); + } + } + + ImportCollectorListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeImportCollectorListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImportCollectorListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ImportCollectorListResult.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ImportCollectorListResult.cs new file mode 100644 index 000000000000..2bca71af5ade --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ImportCollectorListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The response of a ImportCollector list operation. + internal partial class ImportCollectorListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The ImportCollector items on this page. + /// is null. + internal ImportCollectorListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The ImportCollector items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ImportCollectorListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ImportCollectorListResult() + { + } + + /// The ImportCollector items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MachineBootType.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MachineBootType.cs new file mode 100644 index 000000000000..83463e97e8dd --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MachineBootType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The MachineBootType. + public readonly partial struct MachineBootType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MachineBootType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string EfiValue = "EFI"; + private const string BiosValue = "BIOS"; + private const string NotSpecifiedValue = "NotSpecified"; + + /// Unknown. + public static MachineBootType Unknown { get; } = new MachineBootType(UnknownValue); + /// EFI. + public static MachineBootType Efi { get; } = new MachineBootType(EfiValue); + /// BIOS. + public static MachineBootType Bios { get; } = new MachineBootType(BiosValue); + /// NotSpecified. + public static MachineBootType NotSpecified { get; } = new MachineBootType(NotSpecifiedValue); + /// Determines if two values are the same. + public static bool operator ==(MachineBootType left, MachineBootType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MachineBootType left, MachineBootType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MachineBootType(string value) => new MachineBootType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MachineBootType other && Equals(other); + /// + public bool Equals(MachineBootType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MachineListResult.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MachineListResult.Serialization.cs new file mode 100644 index 000000000000..4f636f17a5b5 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MachineListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class MachineListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MachineListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MachineListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MachineListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMachineListResult(document.RootElement, options); + } + + internal static MachineListResult DeserializeMachineListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MigrationAssessmentMachineData.DeserializeMigrationAssessmentMachineData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MachineListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MachineListResult)} does not support writing '{options.Format}' format."); + } + } + + MachineListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMachineListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MachineListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MachineListResult.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MachineListResult.cs new file mode 100644 index 000000000000..40a509d1a108 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MachineListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The response of a Machine list operation. + internal partial class MachineListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The Machine items on this page. + /// is null. + internal MachineListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Machine items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal MachineListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MachineListResult() + { + } + + /// The Machine items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrateGroupUpdateContent.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrateGroupUpdateContent.Serialization.cs new file mode 100644 index 000000000000..075f201fefd9 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrateGroupUpdateContent.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class MigrateGroupUpdateContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrateGroupUpdateContent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MigrateGroupUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrateGroupUpdateContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrateGroupUpdateContent(document.RootElement, options); + } + + internal static MigrateGroupUpdateContent DeserializeMigrateGroupUpdateContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ETag? etag = default; + MigrateGroupUpdateProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("eTag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + etag = new ETag(property.Value.GetString()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = MigrateGroupUpdateProperties.DeserializeMigrateGroupUpdateProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrateGroupUpdateContent(etag, properties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrateGroupUpdateContent)} does not support writing '{options.Format}' format."); + } + } + + MigrateGroupUpdateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrateGroupUpdateContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrateGroupUpdateContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrateGroupUpdateContent.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrateGroupUpdateContent.cs new file mode 100644 index 000000000000..a6d6c53b8e80 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrateGroupUpdateContent.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Properties of group update. + public partial class MigrateGroupUpdateContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MigrateGroupUpdateContent() + { + } + + /// Initializes a new instance of . + /// For optimistic concurrency control. + /// Properties of the group. + /// Keeps track of any properties unknown to the library. + internal MigrateGroupUpdateContent(ETag? etag, MigrateGroupUpdateProperties properties, IDictionary serializedAdditionalRawData) + { + ETag = etag; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// For optimistic concurrency control. + public ETag? ETag { get; set; } + /// Properties of the group. + public MigrateGroupUpdateProperties Properties { get; set; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrateGroupUpdateOperationType.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrateGroupUpdateOperationType.cs new file mode 100644 index 000000000000..515588f1c2f5 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrateGroupUpdateOperationType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The MigrateGroupUpdateOperationType. + public readonly partial struct MigrateGroupUpdateOperationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MigrateGroupUpdateOperationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AddValue = "Add"; + private const string RemoveValue = "Remove"; + + /// Add. + public static MigrateGroupUpdateOperationType Add { get; } = new MigrateGroupUpdateOperationType(AddValue); + /// Remove. + public static MigrateGroupUpdateOperationType Remove { get; } = new MigrateGroupUpdateOperationType(RemoveValue); + /// Determines if two values are the same. + public static bool operator ==(MigrateGroupUpdateOperationType left, MigrateGroupUpdateOperationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MigrateGroupUpdateOperationType left, MigrateGroupUpdateOperationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MigrateGroupUpdateOperationType(string value) => new MigrateGroupUpdateOperationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MigrateGroupUpdateOperationType other && Equals(other); + /// + public bool Equals(MigrateGroupUpdateOperationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrateGroupUpdateProperties.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrateGroupUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..90c3c7b31ce4 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrateGroupUpdateProperties.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class MigrateGroupUpdateProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrateGroupUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(OperationType)) + { + writer.WritePropertyName("operationType"u8); + writer.WriteStringValue(OperationType.Value.ToString()); + } + if (Optional.IsCollectionDefined(Machines)) + { + writer.WritePropertyName("machines"u8); + writer.WriteStartArray(); + foreach (var item in Machines) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MigrateGroupUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrateGroupUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrateGroupUpdateProperties(document.RootElement, options); + } + + internal static MigrateGroupUpdateProperties DeserializeMigrateGroupUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MigrateGroupUpdateOperationType? operationType = default; + IList machines = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("operationType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + operationType = new MigrateGroupUpdateOperationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("machines"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + machines = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrateGroupUpdateProperties(operationType, machines ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrateGroupUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + MigrateGroupUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrateGroupUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrateGroupUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrateGroupUpdateProperties.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrateGroupUpdateProperties.cs new file mode 100644 index 000000000000..e04f7a61bbd2 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrateGroupUpdateProperties.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Body properties of group update. + public partial class MigrateGroupUpdateProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MigrateGroupUpdateProperties() + { + Machines = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Whether to add or remove the machines. + /// List of machine names that are part of this group. + /// Keeps track of any properties unknown to the library. + internal MigrateGroupUpdateProperties(MigrateGroupUpdateOperationType? operationType, IList machines, IDictionary serializedAdditionalRawData) + { + OperationType = operationType; + Machines = machines; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Whether to add or remove the machines. + public MigrateGroupUpdateOperationType? OperationType { get; set; } + /// List of machine names that are part of this group. + public IList Machines { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentAssessmentProjectPatch.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentAssessmentProjectPatch.Serialization.cs new file mode 100644 index 000000000000..12574b5b8d52 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentAssessmentProjectPatch.Serialization.cs @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class MigrationAssessmentAssessmentProjectPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentAssessmentProjectPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(AssessmentSolutionId)) + { + writer.WritePropertyName("assessmentSolutionId"u8); + writer.WriteStringValue(AssessmentSolutionId); + } + if (Optional.IsDefined(ProjectStatus)) + { + writer.WritePropertyName("projectStatus"u8); + writer.WriteStringValue(ProjectStatus.Value.ToString()); + } + if (Optional.IsDefined(CustomerWorkspaceId)) + { + writer.WritePropertyName("customerWorkspaceId"u8); + writer.WriteStringValue(CustomerWorkspaceId); + } + if (Optional.IsDefined(CustomerWorkspaceLocation)) + { + writer.WritePropertyName("customerWorkspaceLocation"u8); + writer.WriteStringValue(CustomerWorkspaceLocation); + } + if (Optional.IsDefined(PublicNetworkAccess)) + { + writer.WritePropertyName("publicNetworkAccess"u8); + writer.WriteStringValue(PublicNetworkAccess); + } + if (Optional.IsDefined(CustomerStorageAccountArmId)) + { + writer.WritePropertyName("customerStorageAccountArmId"u8); + writer.WriteStringValue(CustomerStorageAccountArmId); + } + if (Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MigrationAssessmentAssessmentProjectPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentAssessmentProjectPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentAssessmentProjectPatch(document.RootElement, options); + } + + internal static MigrationAssessmentAssessmentProjectPatch DeserializeMigrationAssessmentAssessmentProjectPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + string assessmentSolutionId = default; + AssessmentProjectStatus? projectStatus = default; + ResourceIdentifier customerWorkspaceId = default; + string customerWorkspaceLocation = default; + string publicNetworkAccess = default; + ResourceIdentifier customerStorageAccountArmId = default; + MigrationAssessmentProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + 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("assessmentSolutionId"u8)) + { + assessmentSolutionId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("projectStatus"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + projectStatus = new AssessmentProjectStatus(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("customerWorkspaceId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customerWorkspaceId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("customerWorkspaceLocation"u8)) + { + customerWorkspaceLocation = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("publicNetworkAccess"u8)) + { + publicNetworkAccess = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("customerStorageAccountArmId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customerStorageAccountArmId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new MigrationAssessmentProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentAssessmentProjectPatch( + tags ?? new ChangeTrackingDictionary(), + assessmentSolutionId, + projectStatus, + customerWorkspaceId, + customerWorkspaceLocation, + publicNetworkAccess, + customerStorageAccountArmId, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentAssessmentProjectPatch)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentAssessmentProjectPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentAssessmentProjectPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentAssessmentProjectPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentAssessmentProjectPatch.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentAssessmentProjectPatch.cs new file mode 100644 index 000000000000..52bdb1e24ca6 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentAssessmentProjectPatch.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The type used for update operations of the AssessmentProject. + public partial class MigrationAssessmentAssessmentProjectPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MigrationAssessmentAssessmentProjectPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// Assessment solution ARM id tracked by Microsoft.Migrate/migrateProjects. + /// Assessment project status. + /// The ARM id of service map workspace created by customer. + /// Location of service map workspace created by customer. + /// + /// This value can be set to 'enabled' to avoid breaking changes on existing + /// customer resources and templates. If set to 'disabled', traffic over public + /// interface is not allowed, and private endpoint connections would be the + /// exclusive access method. + /// + /// + /// The ARM id of the storage account used for interactions when public access is + /// disabled. + /// + /// The status of the last operation. + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentAssessmentProjectPatch(IDictionary tags, string assessmentSolutionId, AssessmentProjectStatus? projectStatus, ResourceIdentifier customerWorkspaceId, string customerWorkspaceLocation, string publicNetworkAccess, ResourceIdentifier customerStorageAccountArmId, MigrationAssessmentProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + Tags = tags; + AssessmentSolutionId = assessmentSolutionId; + ProjectStatus = projectStatus; + CustomerWorkspaceId = customerWorkspaceId; + CustomerWorkspaceLocation = customerWorkspaceLocation; + PublicNetworkAccess = publicNetworkAccess; + CustomerStorageAccountArmId = customerStorageAccountArmId; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// Assessment solution ARM id tracked by Microsoft.Migrate/migrateProjects. + public string AssessmentSolutionId { get; set; } + /// Assessment project status. + public AssessmentProjectStatus? ProjectStatus { get; set; } + /// The ARM id of service map workspace created by customer. + public ResourceIdentifier CustomerWorkspaceId { get; set; } + /// Location of service map workspace created by customer. + public string CustomerWorkspaceLocation { get; set; } + /// + /// This value can be set to 'enabled' to avoid breaking changes on existing + /// customer resources and templates. If set to 'disabled', traffic over public + /// interface is not allowed, and private endpoint connections would be the + /// exclusive access method. + /// + public string PublicNetworkAccess { get; set; } + /// + /// The ARM id of the storage account used for interactions when public access is + /// disabled. + /// + public ResourceIdentifier CustomerStorageAccountArmId { get; set; } + /// The status of the last operation. + public MigrationAssessmentProvisioningState? ProvisioningState { get; set; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentCloudSuitability.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentCloudSuitability.cs new file mode 100644 index 000000000000..4799a056d616 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentCloudSuitability.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Cloud Suitability for Azure. + public readonly partial struct MigrationAssessmentCloudSuitability : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MigrationAssessmentCloudSuitability(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string NotSuitableValue = "NotSuitable"; + private const string SuitableValue = "Suitable"; + private const string ConditionallySuitableValue = "ConditionallySuitable"; + private const string ReadinessUnknownValue = "ReadinessUnknown"; + + /// Unknown. Indicates missing data. + public static MigrationAssessmentCloudSuitability Unknown { get; } = new MigrationAssessmentCloudSuitability(UnknownValue); + /// Not Suitable for Azure. + public static MigrationAssessmentCloudSuitability NotSuitable { get; } = new MigrationAssessmentCloudSuitability(NotSuitableValue); + /// Suitable for Azure. + public static MigrationAssessmentCloudSuitability Suitable { get; } = new MigrationAssessmentCloudSuitability(SuitableValue); + /// Conditionally Suitable for Azure. + public static MigrationAssessmentCloudSuitability ConditionallySuitable { get; } = new MigrationAssessmentCloudSuitability(ConditionallySuitableValue); + /// Unknown Readiness for Azure. + public static MigrationAssessmentCloudSuitability ReadinessUnknown { get; } = new MigrationAssessmentCloudSuitability(ReadinessUnknownValue); + /// Determines if two values are the same. + public static bool operator ==(MigrationAssessmentCloudSuitability left, MigrationAssessmentCloudSuitability right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MigrationAssessmentCloudSuitability left, MigrationAssessmentCloudSuitability right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MigrationAssessmentCloudSuitability(string value) => new MigrationAssessmentCloudSuitability(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MigrationAssessmentCloudSuitability other && Equals(other); + /// + public bool Equals(MigrationAssessmentCloudSuitability other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentComputeTier.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentComputeTier.cs new file mode 100644 index 000000000000..ff28f3996786 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentComputeTier.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The MigrationAssessmentComputeTier. + public readonly partial struct MigrationAssessmentComputeTier : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MigrationAssessmentComputeTier(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string AutomaticValue = "Automatic"; + private const string ProvisionedValue = "Provisioned"; + private const string ServerlessValue = "Serverless"; + + /// Unknown. + public static MigrationAssessmentComputeTier Unknown { get; } = new MigrationAssessmentComputeTier(UnknownValue); + /// Automatic. + public static MigrationAssessmentComputeTier Automatic { get; } = new MigrationAssessmentComputeTier(AutomaticValue); + /// Provisioned. + public static MigrationAssessmentComputeTier Provisioned { get; } = new MigrationAssessmentComputeTier(ProvisionedValue); + /// Serverless. + public static MigrationAssessmentComputeTier Serverless { get; } = new MigrationAssessmentComputeTier(ServerlessValue); + /// Determines if two values are the same. + public static bool operator ==(MigrationAssessmentComputeTier left, MigrationAssessmentComputeTier right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MigrationAssessmentComputeTier left, MigrationAssessmentComputeTier right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MigrationAssessmentComputeTier(string value) => new MigrationAssessmentComputeTier(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MigrationAssessmentComputeTier other && Equals(other); + /// + public bool Equals(MigrationAssessmentComputeTier other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentDisk.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentDisk.Serialization.cs new file mode 100644 index 000000000000..8a221b541957 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentDisk.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class MigrationAssessmentDisk : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentDisk)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(GigabytesAllocated)) + { + writer.WritePropertyName("gigabytesAllocated"u8); + writer.WriteNumberValue(GigabytesAllocated.Value); + } + if (options.Format != "W" && Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MigrationAssessmentDisk IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentDisk)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentDisk(document.RootElement, options); + } + + internal static MigrationAssessmentDisk DeserializeMigrationAssessmentDisk(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + double? gigabytesAllocated = default; + string displayName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("gigabytesAllocated"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gigabytesAllocated = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentDisk(gigabytesAllocated, displayName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentDisk)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentDisk IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentDisk(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentDisk)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentDisk.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentDisk.cs new file mode 100644 index 000000000000..8bf5c7ed406b --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentDisk.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// A disk discovered on a machine. + public partial class MigrationAssessmentDisk + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal MigrationAssessmentDisk() + { + } + + /// Initializes a new instance of . + /// Gigabytes of storage provisioned for this disk. + /// User friendly name of the disk. + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentDisk(double? gigabytesAllocated, string displayName, IDictionary serializedAdditionalRawData) + { + GigabytesAllocated = gigabytesAllocated; + DisplayName = displayName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gigabytes of storage provisioned for this disk. + public double? GigabytesAllocated { get; } + /// User friendly name of the disk. + public string DisplayName { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentError.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentError.Serialization.cs new file mode 100644 index 000000000000..4ef1bfdac48b --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentError.Serialization.cs @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class MigrationAssessmentError : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentError)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteNumberValue(Id.Value); + } + if (options.Format != "W" && Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (options.Format != "W" && Optional.IsDefined(RunAsAccountId)) + { + writer.WritePropertyName("runAsAccountId"u8); + writer.WriteStringValue(RunAsAccountId); + } + if (options.Format != "W" && Optional.IsDefined(ApplianceName)) + { + writer.WritePropertyName("applianceName"u8); + writer.WriteStringValue(ApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (options.Format != "W" && Optional.IsDefined(SummaryMessage)) + { + writer.WritePropertyName("summaryMessage"u8); + writer.WriteStringValue(SummaryMessage); + } + if (options.Format != "W" && Optional.IsDefined(AgentScenario)) + { + writer.WritePropertyName("agentScenario"u8); + writer.WriteStringValue(AgentScenario); + } + if (options.Format != "W" && Optional.IsDefined(PossibleCauses)) + { + writer.WritePropertyName("possibleCauses"u8); + writer.WriteStringValue(PossibleCauses); + } + if (options.Format != "W" && Optional.IsDefined(RecommendedAction)) + { + writer.WritePropertyName("recommendedAction"u8); + writer.WriteStringValue(RecommendedAction); + } + if (options.Format != "W" && Optional.IsDefined(Severity)) + { + writer.WritePropertyName("severity"u8); + writer.WriteStringValue(Severity); + } + if (options.Format != "W" && Optional.IsCollectionDefined(MessageParameters)) + { + writer.WritePropertyName("messageParameters"u8); + writer.WriteStartObject(); + foreach (var item in MessageParameters) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsDefined(UpdatedOn)) + { + writer.WritePropertyName("updatedTimeStamp"u8); + writer.WriteStringValue(UpdatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(ImpactedAssessmentType)) + { + writer.WritePropertyName("impactedAssessmentType"u8); + writer.WriteStringValue(ImpactedAssessmentType); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MigrationAssessmentError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentError)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentError(document.RootElement, options); + } + + internal static MigrationAssessmentError DeserializeMigrationAssessmentError(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? id = default; + string code = default; + string runAsAccountId = default; + string applianceName = default; + string message = default; + string summaryMessage = default; + string agentScenario = default; + string possibleCauses = default; + string recommendedAction = default; + string severity = default; + IReadOnlyDictionary messageParameters = default; + DateTimeOffset? updatedTimeStamp = default; + string impactedAssessmentType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("runAsAccountId"u8)) + { + runAsAccountId = property.Value.GetString(); + continue; + } + if (property.NameEquals("applianceName"u8)) + { + applianceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("summaryMessage"u8)) + { + summaryMessage = property.Value.GetString(); + continue; + } + if (property.NameEquals("agentScenario"u8)) + { + agentScenario = property.Value.GetString(); + continue; + } + if (property.NameEquals("possibleCauses"u8)) + { + possibleCauses = property.Value.GetString(); + continue; + } + if (property.NameEquals("recommendedAction"u8)) + { + recommendedAction = property.Value.GetString(); + continue; + } + if (property.NameEquals("severity"u8)) + { + severity = property.Value.GetString(); + continue; + } + if (property.NameEquals("messageParameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + messageParameters = dictionary; + continue; + } + if (property.NameEquals("updatedTimeStamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedTimeStamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("impactedAssessmentType"u8)) + { + impactedAssessmentType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentError( + id, + code, + runAsAccountId, + applianceName, + message, + summaryMessage, + agentScenario, + possibleCauses, + recommendedAction, + severity, + messageParameters ?? new ChangeTrackingDictionary(), + updatedTimeStamp, + impactedAssessmentType, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentError)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentError(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentError)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentError.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentError.cs new file mode 100644 index 000000000000..5c9d29161c09 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentError.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Error web model class. + public partial class MigrationAssessmentError + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal MigrationAssessmentError() + { + MessageParameters = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Gets the error ID. + /// Gets the error code. + /// Gets the Run as account ID. + /// Gets the Appliance name. + /// Gets the error message. + /// Gets the error summary message. + /// Gets the agent scenario where this error occurred. + /// Gets the error possible causes. + /// Gets the recommended action for the error. + /// Gets the error severity. + /// Gets the error message parameters. + /// Gets the time stamp when the error was updated. + /// Gets the type of assessment impacted by this error. + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentError(int? id, string code, string runAsAccountId, string applianceName, string message, string summaryMessage, string agentScenario, string possibleCauses, string recommendedAction, string severity, IReadOnlyDictionary messageParameters, DateTimeOffset? updatedOn, string impactedAssessmentType, IDictionary serializedAdditionalRawData) + { + Id = id; + Code = code; + RunAsAccountId = runAsAccountId; + ApplianceName = applianceName; + Message = message; + SummaryMessage = summaryMessage; + AgentScenario = agentScenario; + PossibleCauses = possibleCauses; + RecommendedAction = recommendedAction; + Severity = severity; + MessageParameters = messageParameters; + UpdatedOn = updatedOn; + ImpactedAssessmentType = impactedAssessmentType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the error ID. + public int? Id { get; } + /// Gets the error code. + public string Code { get; } + /// Gets the Run as account ID. + public string RunAsAccountId { get; } + /// Gets the Appliance name. + public string ApplianceName { get; } + /// Gets the error message. + public string Message { get; } + /// Gets the error summary message. + public string SummaryMessage { get; } + /// Gets the agent scenario where this error occurred. + public string AgentScenario { get; } + /// Gets the error possible causes. + public string PossibleCauses { get; } + /// Gets the recommended action for the error. + public string RecommendedAction { get; } + /// Gets the error severity. + public string Severity { get; } + /// Gets the error message parameters. + public IReadOnlyDictionary MessageParameters { get; } + /// Gets the time stamp when the error was updated. + public DateTimeOffset? UpdatedOn { get; } + /// Gets the type of assessment impacted by this error. + public string ImpactedAssessmentType { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentGroupStatus.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentGroupStatus.cs new file mode 100644 index 000000000000..68b8a369b13c --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentGroupStatus.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The MigrationAssessmentGroupStatus. + public readonly partial struct MigrationAssessmentGroupStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MigrationAssessmentGroupStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CreatedValue = "Created"; + private const string UpdatedValue = "Updated"; + private const string RunningValue = "Running"; + private const string CompletedValue = "Completed"; + private const string InvalidValue = "Invalid"; + + /// Created. + public static MigrationAssessmentGroupStatus Created { get; } = new MigrationAssessmentGroupStatus(CreatedValue); + /// Updated. + public static MigrationAssessmentGroupStatus Updated { get; } = new MigrationAssessmentGroupStatus(UpdatedValue); + /// Running. + public static MigrationAssessmentGroupStatus Running { get; } = new MigrationAssessmentGroupStatus(RunningValue); + /// Completed. + public static MigrationAssessmentGroupStatus Completed { get; } = new MigrationAssessmentGroupStatus(CompletedValue); + /// Invalid. + public static MigrationAssessmentGroupStatus Invalid { get; } = new MigrationAssessmentGroupStatus(InvalidValue); + /// Determines if two values are the same. + public static bool operator ==(MigrationAssessmentGroupStatus left, MigrationAssessmentGroupStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MigrationAssessmentGroupStatus left, MigrationAssessmentGroupStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MigrationAssessmentGroupStatus(string value) => new MigrationAssessmentGroupStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MigrationAssessmentGroupStatus other && Equals(other); + /// + public bool Equals(MigrationAssessmentGroupStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentGroupType.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentGroupType.cs new file mode 100644 index 000000000000..b82aa6adf656 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentGroupType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The MigrationAssessmentGroupType. + public readonly partial struct MigrationAssessmentGroupType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MigrationAssessmentGroupType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DefaultValue = "Default"; + private const string ImportValue = "Import"; + + /// Default. + public static MigrationAssessmentGroupType Default { get; } = new MigrationAssessmentGroupType(DefaultValue); + /// Import. + public static MigrationAssessmentGroupType Import { get; } = new MigrationAssessmentGroupType(ImportValue); + /// Determines if two values are the same. + public static bool operator ==(MigrationAssessmentGroupType left, MigrationAssessmentGroupType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MigrationAssessmentGroupType left, MigrationAssessmentGroupType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MigrationAssessmentGroupType(string value) => new MigrationAssessmentGroupType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MigrationAssessmentGroupType other && Equals(other); + /// + public bool Equals(MigrationAssessmentGroupType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentHardwareGeneration.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentHardwareGeneration.cs new file mode 100644 index 000000000000..2d622563659e --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentHardwareGeneration.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The MigrationAssessmentHardwareGeneration. + public readonly partial struct MigrationAssessmentHardwareGeneration : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MigrationAssessmentHardwareGeneration(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string AutomaticValue = "Automatic"; + private const string Gen5Value = "Gen5"; + private const string Fsv2SeriesValue = "Fsv2_series"; + private const string MSeriesValue = "M_series"; + private const string DCSeriesValue = "DC_series"; + + /// Unknown. + public static MigrationAssessmentHardwareGeneration Unknown { get; } = new MigrationAssessmentHardwareGeneration(UnknownValue); + /// Automatic. + public static MigrationAssessmentHardwareGeneration Automatic { get; } = new MigrationAssessmentHardwareGeneration(AutomaticValue); + /// Gen5. + public static MigrationAssessmentHardwareGeneration Gen5 { get; } = new MigrationAssessmentHardwareGeneration(Gen5Value); + /// Fsv2_series. + public static MigrationAssessmentHardwareGeneration Fsv2Series { get; } = new MigrationAssessmentHardwareGeneration(Fsv2SeriesValue); + /// M_series. + public static MigrationAssessmentHardwareGeneration MSeries { get; } = new MigrationAssessmentHardwareGeneration(MSeriesValue); + /// DC_series. + public static MigrationAssessmentHardwareGeneration DCSeries { get; } = new MigrationAssessmentHardwareGeneration(DCSeriesValue); + /// Determines if two values are the same. + public static bool operator ==(MigrationAssessmentHardwareGeneration left, MigrationAssessmentHardwareGeneration right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MigrationAssessmentHardwareGeneration left, MigrationAssessmentHardwareGeneration right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MigrationAssessmentHardwareGeneration(string value) => new MigrationAssessmentHardwareGeneration(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MigrationAssessmentHardwareGeneration other && Equals(other); + /// + public bool Equals(MigrationAssessmentHardwareGeneration other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentNetworkAdapter.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentNetworkAdapter.Serialization.cs new file mode 100644 index 000000000000..cdfa7c430f26 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentNetworkAdapter.Serialization.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class MigrationAssessmentNetworkAdapter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentNetworkAdapter)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(MacAddress)) + { + writer.WritePropertyName("macAddress"u8); + writer.WriteStringValue(MacAddress); + } + if (options.Format != "W" && Optional.IsCollectionDefined(IPAddresses)) + { + writer.WritePropertyName("ipAddresses"u8); + writer.WriteStartArray(); + foreach (var item in IPAddresses) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MigrationAssessmentNetworkAdapter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentNetworkAdapter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentNetworkAdapter(document.RootElement, options); + } + + internal static MigrationAssessmentNetworkAdapter DeserializeMigrationAssessmentNetworkAdapter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string macAddress = default; + IReadOnlyList ipAddresses = default; + string displayName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("macAddress"u8)) + { + macAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipAddresses"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipAddresses = array; + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentNetworkAdapter(macAddress, ipAddresses ?? new ChangeTrackingList(), displayName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentNetworkAdapter)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentNetworkAdapter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentNetworkAdapter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentNetworkAdapter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentNetworkAdapter.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentNetworkAdapter.cs new file mode 100644 index 000000000000..6ba1eb2d12ee --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentNetworkAdapter.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// A network adapter discovered on a machine. + public partial class MigrationAssessmentNetworkAdapter + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal MigrationAssessmentNetworkAdapter() + { + IPAddresses = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// MAC Address of the network adapter. + /// List of IP Addresses on the network adapter. + /// User friendly name of the network adapter. + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentNetworkAdapter(string macAddress, IReadOnlyList ipAddresses, string displayName, IDictionary serializedAdditionalRawData) + { + MacAddress = macAddress; + IPAddresses = ipAddresses; + DisplayName = displayName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// MAC Address of the network adapter. + public string MacAddress { get; } + /// List of IP Addresses on the network adapter. + public IReadOnlyList IPAddresses { get; } + /// User friendly name of the network adapter. + public string DisplayName { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentOSLicense.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentOSLicense.cs new file mode 100644 index 000000000000..caa5aacbd301 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentOSLicense.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The MigrationAssessmentOSLicense. + public readonly partial struct MigrationAssessmentOSLicense : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MigrationAssessmentOSLicense(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string YesValue = "Yes"; + private const string NoValue = "No"; + + /// Unknown. + public static MigrationAssessmentOSLicense Unknown { get; } = new MigrationAssessmentOSLicense(UnknownValue); + /// Yes. + public static MigrationAssessmentOSLicense Yes { get; } = new MigrationAssessmentOSLicense(YesValue); + /// No. + public static MigrationAssessmentOSLicense No { get; } = new MigrationAssessmentOSLicense(NoValue); + /// Determines if two values are the same. + public static bool operator ==(MigrationAssessmentOSLicense left, MigrationAssessmentOSLicense right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MigrationAssessmentOSLicense left, MigrationAssessmentOSLicense right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MigrationAssessmentOSLicense(string value) => new MigrationAssessmentOSLicense(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MigrationAssessmentOSLicense other && Equals(other); + /// + public bool Equals(MigrationAssessmentOSLicense other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentPrivateEndpointConnectionListResult.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentPrivateEndpointConnectionListResult.Serialization.cs new file mode 100644 index 000000000000..e27dd217ae07 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentPrivateEndpointConnectionListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class MigrationAssessmentPrivateEndpointConnectionListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentPrivateEndpointConnectionListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MigrationAssessmentPrivateEndpointConnectionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentPrivateEndpointConnectionListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentPrivateEndpointConnectionListResult(document.RootElement, options); + } + + internal static MigrationAssessmentPrivateEndpointConnectionListResult DeserializeMigrationAssessmentPrivateEndpointConnectionListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MigrationAssessmentPrivateEndpointConnectionData.DeserializeMigrationAssessmentPrivateEndpointConnectionData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentPrivateEndpointConnectionListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentPrivateEndpointConnectionListResult)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentPrivateEndpointConnectionListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentPrivateEndpointConnectionListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentPrivateEndpointConnectionListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentPrivateEndpointConnectionListResult.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentPrivateEndpointConnectionListResult.cs new file mode 100644 index 000000000000..1418172b98d5 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentPrivateEndpointConnectionListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The response of a PrivateEndpointConnection list operation. + internal partial class MigrationAssessmentPrivateEndpointConnectionListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The PrivateEndpointConnection items on this page. + /// is null. + internal MigrationAssessmentPrivateEndpointConnectionListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The PrivateEndpointConnection items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentPrivateEndpointConnectionListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MigrationAssessmentPrivateEndpointConnectionListResult() + { + } + + /// The PrivateEndpointConnection items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentPrivateEndpointConnectionProvisioningState.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentPrivateEndpointConnectionProvisioningState.cs new file mode 100644 index 000000000000..85931efeda8c --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentPrivateEndpointConnectionProvisioningState.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The current provisioning state. + public readonly partial struct MigrationAssessmentPrivateEndpointConnectionProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MigrationAssessmentPrivateEndpointConnectionProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string CreatingValue = "Creating"; + private const string DeletingValue = "Deleting"; + private const string FailedValue = "Failed"; + + /// Succeeded. + public static MigrationAssessmentPrivateEndpointConnectionProvisioningState Succeeded { get; } = new MigrationAssessmentPrivateEndpointConnectionProvisioningState(SucceededValue); + /// Creating. + public static MigrationAssessmentPrivateEndpointConnectionProvisioningState Creating { get; } = new MigrationAssessmentPrivateEndpointConnectionProvisioningState(CreatingValue); + /// Deleting. + public static MigrationAssessmentPrivateEndpointConnectionProvisioningState Deleting { get; } = new MigrationAssessmentPrivateEndpointConnectionProvisioningState(DeletingValue); + /// Failed. + public static MigrationAssessmentPrivateEndpointConnectionProvisioningState Failed { get; } = new MigrationAssessmentPrivateEndpointConnectionProvisioningState(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(MigrationAssessmentPrivateEndpointConnectionProvisioningState left, MigrationAssessmentPrivateEndpointConnectionProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MigrationAssessmentPrivateEndpointConnectionProvisioningState left, MigrationAssessmentPrivateEndpointConnectionProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MigrationAssessmentPrivateEndpointConnectionProvisioningState(string value) => new MigrationAssessmentPrivateEndpointConnectionProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MigrationAssessmentPrivateEndpointConnectionProvisioningState other && Equals(other); + /// + public bool Equals(MigrationAssessmentPrivateEndpointConnectionProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentPrivateEndpointServiceConnectionStatus.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentPrivateEndpointServiceConnectionStatus.cs new file mode 100644 index 000000000000..b04567f1151e --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentPrivateEndpointServiceConnectionStatus.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The private endpoint connection status. + public readonly partial struct MigrationAssessmentPrivateEndpointServiceConnectionStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MigrationAssessmentPrivateEndpointServiceConnectionStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PendingValue = "Pending"; + private const string ApprovedValue = "Approved"; + private const string RejectedValue = "Rejected"; + + /// Pending. + public static MigrationAssessmentPrivateEndpointServiceConnectionStatus Pending { get; } = new MigrationAssessmentPrivateEndpointServiceConnectionStatus(PendingValue); + /// Approved. + public static MigrationAssessmentPrivateEndpointServiceConnectionStatus Approved { get; } = new MigrationAssessmentPrivateEndpointServiceConnectionStatus(ApprovedValue); + /// Rejected. + public static MigrationAssessmentPrivateEndpointServiceConnectionStatus Rejected { get; } = new MigrationAssessmentPrivateEndpointServiceConnectionStatus(RejectedValue); + /// Determines if two values are the same. + public static bool operator ==(MigrationAssessmentPrivateEndpointServiceConnectionStatus left, MigrationAssessmentPrivateEndpointServiceConnectionStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MigrationAssessmentPrivateEndpointServiceConnectionStatus left, MigrationAssessmentPrivateEndpointServiceConnectionStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MigrationAssessmentPrivateEndpointServiceConnectionStatus(string value) => new MigrationAssessmentPrivateEndpointServiceConnectionStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MigrationAssessmentPrivateEndpointServiceConnectionStatus other && Equals(other); + /// + public bool Equals(MigrationAssessmentPrivateEndpointServiceConnectionStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentPrivateLinkResourceListResult.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentPrivateLinkResourceListResult.Serialization.cs new file mode 100644 index 000000000000..1973b8da8baf --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentPrivateLinkResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class MigrationAssessmentPrivateLinkResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentPrivateLinkResourceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MigrationAssessmentPrivateLinkResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentPrivateLinkResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentPrivateLinkResourceListResult(document.RootElement, options); + } + + internal static MigrationAssessmentPrivateLinkResourceListResult DeserializeMigrationAssessmentPrivateLinkResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MigrationAssessmentPrivateLinkResourceData.DeserializeMigrationAssessmentPrivateLinkResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentPrivateLinkResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentPrivateLinkResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentPrivateLinkResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentPrivateLinkResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentPrivateLinkResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentPrivateLinkResourceListResult.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentPrivateLinkResourceListResult.cs new file mode 100644 index 000000000000..d41e8d77c7b8 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentPrivateLinkResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The response of a PrivateLinkResource list operation. + internal partial class MigrationAssessmentPrivateLinkResourceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The PrivateLinkResource items on this page. + /// is null. + internal MigrationAssessmentPrivateLinkResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The PrivateLinkResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentPrivateLinkResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MigrationAssessmentPrivateLinkResourceListResult() + { + } + + /// The PrivateLinkResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentPrivateLinkServiceConnectionState.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentPrivateLinkServiceConnectionState.Serialization.cs new file mode 100644 index 000000000000..f881c6581cc9 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentPrivateLinkServiceConnectionState.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class MigrationAssessmentPrivateLinkServiceConnectionState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentPrivateLinkServiceConnectionState)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(ActionsRequired)) + { + writer.WritePropertyName("actionsRequired"u8); + writer.WriteStringValue(ActionsRequired); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MigrationAssessmentPrivateLinkServiceConnectionState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationAssessmentPrivateLinkServiceConnectionState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationAssessmentPrivateLinkServiceConnectionState(document.RootElement, options); + } + + internal static MigrationAssessmentPrivateLinkServiceConnectionState DeserializeMigrationAssessmentPrivateLinkServiceConnectionState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MigrationAssessmentPrivateEndpointServiceConnectionStatus? status = default; + string description = default; + string actionsRequired = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new MigrationAssessmentPrivateEndpointServiceConnectionStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("actionsRequired"u8)) + { + actionsRequired = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationAssessmentPrivateLinkServiceConnectionState(status, description, actionsRequired, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationAssessmentPrivateLinkServiceConnectionState)} does not support writing '{options.Format}' format."); + } + } + + MigrationAssessmentPrivateLinkServiceConnectionState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationAssessmentPrivateLinkServiceConnectionState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationAssessmentPrivateLinkServiceConnectionState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentPrivateLinkServiceConnectionState.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentPrivateLinkServiceConnectionState.cs new file mode 100644 index 000000000000..c3424279c7d8 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentPrivateLinkServiceConnectionState.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// A collection of information about the state of the connection between service consumer and provider. + public partial class MigrationAssessmentPrivateLinkServiceConnectionState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MigrationAssessmentPrivateLinkServiceConnectionState() + { + } + + /// Initializes a new instance of . + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// The reason for approval/rejection of the connection. + /// A message indicating if changes on the service provider require any updates on the consumer. + /// Keeps track of any properties unknown to the library. + internal MigrationAssessmentPrivateLinkServiceConnectionState(MigrationAssessmentPrivateEndpointServiceConnectionStatus? status, string description, string actionsRequired, IDictionary serializedAdditionalRawData) + { + Status = status; + Description = description; + ActionsRequired = actionsRequired; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + public MigrationAssessmentPrivateEndpointServiceConnectionStatus? Status { get; set; } + /// The reason for approval/rejection of the connection. + public string Description { get; set; } + /// A message indicating if changes on the service provider require any updates on the consumer. + public string ActionsRequired { get; set; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentProvisioningState.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentProvisioningState.cs new file mode 100644 index 000000000000..40fdeb7b66f8 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentProvisioningState.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The status of the current operation. + public readonly partial struct MigrationAssessmentProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MigrationAssessmentProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string ProvisioningValue = "Provisioning"; + private const string UpdatingValue = "Updating"; + private const string DeletingValue = "Deleting"; + private const string AcceptedValue = "Accepted"; + + /// Resource has been created. + public static MigrationAssessmentProvisioningState Succeeded { get; } = new MigrationAssessmentProvisioningState(SucceededValue); + /// Resource creation failed. + public static MigrationAssessmentProvisioningState Failed { get; } = new MigrationAssessmentProvisioningState(FailedValue); + /// Resource creation was canceled. + public static MigrationAssessmentProvisioningState Canceled { get; } = new MigrationAssessmentProvisioningState(CanceledValue); + /// Resource is being Provisioned. + public static MigrationAssessmentProvisioningState Provisioning { get; } = new MigrationAssessmentProvisioningState(ProvisioningValue); + /// Resource is being Updated. + public static MigrationAssessmentProvisioningState Updating { get; } = new MigrationAssessmentProvisioningState(UpdatingValue); + /// Resource is being Deleted. + public static MigrationAssessmentProvisioningState Deleting { get; } = new MigrationAssessmentProvisioningState(DeletingValue); + /// Resource is being Accepted. + public static MigrationAssessmentProvisioningState Accepted { get; } = new MigrationAssessmentProvisioningState(AcceptedValue); + /// Determines if two values are the same. + public static bool operator ==(MigrationAssessmentProvisioningState left, MigrationAssessmentProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MigrationAssessmentProvisioningState left, MigrationAssessmentProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MigrationAssessmentProvisioningState(string value) => new MigrationAssessmentProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MigrationAssessmentProvisioningState other && Equals(other); + /// + public bool Equals(MigrationAssessmentProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentTargetType.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentTargetType.cs new file mode 100644 index 000000000000..220d97ac74ab --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationAssessmentTargetType.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The MigrationAssessmentTargetType. + public readonly partial struct MigrationAssessmentTargetType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MigrationAssessmentTargetType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string RecommendedValue = "Recommended"; + private const string AzureSqlDatabaseValue = "AzureSqlDatabase"; + private const string AzureSqlManagedInstanceValue = "AzureSqlManagedInstance"; + private const string AzureSqlVirtualMachineValue = "AzureSqlVirtualMachine"; + private const string AzureVirtualMachineValue = "AzureVirtualMachine"; + + /// Unknown. + public static MigrationAssessmentTargetType Unknown { get; } = new MigrationAssessmentTargetType(UnknownValue); + /// Recommended. + public static MigrationAssessmentTargetType Recommended { get; } = new MigrationAssessmentTargetType(RecommendedValue); + /// AzureSqlDatabase. + public static MigrationAssessmentTargetType AzureSqlDatabase { get; } = new MigrationAssessmentTargetType(AzureSqlDatabaseValue); + /// AzureSqlManagedInstance. + public static MigrationAssessmentTargetType AzureSqlManagedInstance { get; } = new MigrationAssessmentTargetType(AzureSqlManagedInstanceValue); + /// AzureSqlVirtualMachine. + public static MigrationAssessmentTargetType AzureSqlVirtualMachine { get; } = new MigrationAssessmentTargetType(AzureSqlVirtualMachineValue); + /// AzureVirtualMachine. + public static MigrationAssessmentTargetType AzureVirtualMachine { get; } = new MigrationAssessmentTargetType(AzureVirtualMachineValue); + /// Determines if two values are the same. + public static bool operator ==(MigrationAssessmentTargetType left, MigrationAssessmentTargetType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MigrationAssessmentTargetType left, MigrationAssessmentTargetType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MigrationAssessmentTargetType(string value) => new MigrationAssessmentTargetType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MigrationAssessmentTargetType other && Equals(other); + /// + public bool Equals(MigrationAssessmentTargetType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationGuidelineContext.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationGuidelineContext.Serialization.cs new file mode 100644 index 000000000000..b8d04bef804d --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationGuidelineContext.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class MigrationGuidelineContext : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationGuidelineContext)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ContextKey)) + { + writer.WritePropertyName("contextKey"u8); + writer.WriteStringValue(ContextKey); + } + if (Optional.IsDefined(ContextValue)) + { + writer.WritePropertyName("contextValue"u8); + writer.WriteStringValue(ContextValue); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MigrationGuidelineContext IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationGuidelineContext)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationGuidelineContext(document.RootElement, options); + } + + internal static MigrationGuidelineContext DeserializeMigrationGuidelineContext(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string contextKey = default; + string contextValue = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("contextKey"u8)) + { + contextKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("contextValue"u8)) + { + contextValue = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationGuidelineContext(contextKey, contextValue, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationGuidelineContext)} does not support writing '{options.Format}' format."); + } + } + + MigrationGuidelineContext IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMigrationGuidelineContext(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationGuidelineContext)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationGuidelineContext.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationGuidelineContext.cs new file mode 100644 index 000000000000..718f4968bfed --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MigrationGuidelineContext.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Migration Guideline Context. + public partial class MigrationGuidelineContext + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal MigrationGuidelineContext() + { + } + + /// Initializes a new instance of . + /// Gets the reasoning context key. + /// Gets the reasoning context value. + /// Keeps track of any properties unknown to the library. + internal MigrationGuidelineContext(string contextKey, string contextValue, IDictionary serializedAdditionalRawData) + { + ContextKey = contextKey; + ContextValue = contextValue; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the reasoning context key. + public string ContextKey { get; } + /// Gets the reasoning context value. + public string ContextValue { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MultiSubnetIntent.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MultiSubnetIntent.cs new file mode 100644 index 000000000000..208917fe6942 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/MultiSubnetIntent.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The MultiSubnetIntent. + public readonly partial struct MultiSubnetIntent : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MultiSubnetIntent(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string HighAvailabilityValue = "HighAvailability"; + private const string DisasterRecoveryValue = "DisasterRecovery"; + + /// None. + public static MultiSubnetIntent None { get; } = new MultiSubnetIntent(NoneValue); + /// HighAvailability. + public static MultiSubnetIntent HighAvailability { get; } = new MultiSubnetIntent(HighAvailabilityValue); + /// DisasterRecovery. + public static MultiSubnetIntent DisasterRecovery { get; } = new MultiSubnetIntent(DisasterRecoveryValue); + /// Determines if two values are the same. + public static bool operator ==(MultiSubnetIntent left, MultiSubnetIntent right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MultiSubnetIntent left, MultiSubnetIntent right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MultiSubnetIntent(string value) => new MultiSubnetIntent(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MultiSubnetIntent other && Equals(other); + /// + public bool Equals(MultiSubnetIntent other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/PercentileOfUtilization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/PercentileOfUtilization.cs new file mode 100644 index 000000000000..1f63d6279ec0 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/PercentileOfUtilization.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The PercentileOfUtilization. + public readonly partial struct PercentileOfUtilization : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PercentileOfUtilization(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string Percentile50Value = "Percentile50"; + private const string Percentile90Value = "Percentile90"; + private const string Percentile95Value = "Percentile95"; + private const string Percentile99Value = "Percentile99"; + + /// Percentile50. + public static PercentileOfUtilization Percentile50 { get; } = new PercentileOfUtilization(Percentile50Value); + /// Percentile90. + public static PercentileOfUtilization Percentile90 { get; } = new PercentileOfUtilization(Percentile90Value); + /// Percentile95. + public static PercentileOfUtilization Percentile95 { get; } = new PercentileOfUtilization(Percentile95Value); + /// Percentile99. + public static PercentileOfUtilization Percentile99 { get; } = new PercentileOfUtilization(Percentile99Value); + /// Determines if two values are the same. + public static bool operator ==(PercentileOfUtilization left, PercentileOfUtilization right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PercentileOfUtilization left, PercentileOfUtilization right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PercentileOfUtilization(string value) => new PercentileOfUtilization(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PercentileOfUtilization other && Equals(other); + /// + public bool Equals(PercentileOfUtilization other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ProcessorInfo.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ProcessorInfo.Serialization.cs new file mode 100644 index 000000000000..01b90c5f4b6a --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ProcessorInfo.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class ProcessorInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProcessorInfo)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(NumberOfSockets)) + { + writer.WritePropertyName("numberOfSockets"u8); + writer.WriteNumberValue(NumberOfSockets.Value); + } + if (Optional.IsDefined(NumberOfCoresPerSocket)) + { + writer.WritePropertyName("numberOfCoresPerSocket"u8); + writer.WriteNumberValue(NumberOfCoresPerSocket.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProcessorInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProcessorInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProcessorInfo(document.RootElement, options); + } + + internal static ProcessorInfo DeserializeProcessorInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + int? numberOfSockets = default; + int? numberOfCoresPerSocket = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("numberOfSockets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfSockets = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("numberOfCoresPerSocket"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfCoresPerSocket = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProcessorInfo(name, numberOfSockets, numberOfCoresPerSocket, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProcessorInfo)} does not support writing '{options.Format}' format."); + } + } + + ProcessorInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProcessorInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProcessorInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ProcessorInfo.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ProcessorInfo.cs new file mode 100644 index 000000000000..378ac2850d53 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ProcessorInfo.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Represents a information \ details of a processor. + public partial class ProcessorInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ProcessorInfo() + { + } + + /// Initializes a new instance of . + /// Gets or sets the name \ model of a processor. + /// Gets or sets the number of sockets. + /// Gets or sets the number of cores in a socket. + /// Keeps track of any properties unknown to the library. + internal ProcessorInfo(string name, int? numberOfSockets, int? numberOfCoresPerSocket, IDictionary serializedAdditionalRawData) + { + Name = name; + NumberOfSockets = numberOfSockets; + NumberOfCoresPerSocket = numberOfCoresPerSocket; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the name \ model of a processor. + public string Name { get; set; } + /// Gets or sets the number of sockets. + public int? NumberOfSockets { get; set; } + /// Gets or sets the number of cores in a socket. + public int? NumberOfCoresPerSocket { get; set; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ProductSupportStatus.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ProductSupportStatus.Serialization.cs new file mode 100644 index 000000000000..52c8ee041797 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ProductSupportStatus.Serialization.cs @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class ProductSupportStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProductSupportStatus)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(CurrentVersion)) + { + writer.WritePropertyName("currentVersion"u8); + writer.WriteStringValue(CurrentVersion); + } + if (options.Format != "W" && Optional.IsDefined(ServicePackStatus)) + { + writer.WritePropertyName("servicePackStatus"u8); + writer.WriteStringValue(ServicePackStatus); + } + if (options.Format != "W" && Optional.IsDefined(EsuStatus)) + { + writer.WritePropertyName("esuStatus"u8); + writer.WriteStringValue(EsuStatus); + } + if (options.Format != "W" && Optional.IsDefined(SupportStatus)) + { + writer.WritePropertyName("supportStatus"u8); + writer.WriteStringValue(SupportStatus); + } + if (options.Format != "W" && Optional.IsDefined(Eta)) + { + writer.WritePropertyName("eta"u8); + writer.WriteNumberValue(Eta.Value); + } + if (options.Format != "W" && Optional.IsDefined(CurrentEsuYear)) + { + writer.WritePropertyName("currentEsuYear"u8); + writer.WriteStringValue(CurrentEsuYear); + } + if (options.Format != "W" && Optional.IsDefined(MainstreamEndOn)) + { + writer.WritePropertyName("mainstreamEndDate"u8); + writer.WriteStringValue(MainstreamEndOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(ExtendedSupportEndOn)) + { + writer.WritePropertyName("extendedSupportEndDate"u8); + writer.WriteStringValue(ExtendedSupportEndOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(ExtendedSecurityUpdateYear1EndOn)) + { + writer.WritePropertyName("extendedSecurityUpdateYear1EndDate"u8); + writer.WriteStringValue(ExtendedSecurityUpdateYear1EndOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(ExtendedSecurityUpdateYear2EndOn)) + { + writer.WritePropertyName("extendedSecurityUpdateYear2EndDate"u8); + writer.WriteStringValue(ExtendedSecurityUpdateYear2EndOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(ExtendedSecurityUpdateYear3EndOn)) + { + writer.WritePropertyName("extendedSecurityUpdateYear3EndDate"u8); + writer.WriteStringValue(ExtendedSecurityUpdateYear3EndOn.Value, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProductSupportStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProductSupportStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProductSupportStatus(document.RootElement, options); + } + + internal static ProductSupportStatus DeserializeProductSupportStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string currentVersion = default; + string servicePackStatus = default; + string esuStatus = default; + string supportStatus = default; + int? eta = default; + string currentEsuYear = default; + DateTimeOffset? mainstreamEndDate = default; + DateTimeOffset? extendedSupportEndDate = default; + DateTimeOffset? extendedSecurityUpdateYear1EndDate = default; + DateTimeOffset? extendedSecurityUpdateYear2EndDate = default; + DateTimeOffset? extendedSecurityUpdateYear3EndDate = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("currentVersion"u8)) + { + currentVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("servicePackStatus"u8)) + { + servicePackStatus = property.Value.GetString(); + continue; + } + if (property.NameEquals("esuStatus"u8)) + { + esuStatus = property.Value.GetString(); + continue; + } + if (property.NameEquals("supportStatus"u8)) + { + supportStatus = property.Value.GetString(); + continue; + } + if (property.NameEquals("eta"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + eta = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("currentEsuYear"u8)) + { + currentEsuYear = property.Value.GetString(); + continue; + } + if (property.NameEquals("mainstreamEndDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mainstreamEndDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("extendedSupportEndDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + extendedSupportEndDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("extendedSecurityUpdateYear1EndDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + extendedSecurityUpdateYear1EndDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("extendedSecurityUpdateYear2EndDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + extendedSecurityUpdateYear2EndDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("extendedSecurityUpdateYear3EndDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + extendedSecurityUpdateYear3EndDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProductSupportStatus( + currentVersion, + servicePackStatus, + esuStatus, + supportStatus, + eta, + currentEsuYear, + mainstreamEndDate, + extendedSupportEndDate, + extendedSecurityUpdateYear1EndDate, + extendedSecurityUpdateYear2EndDate, + extendedSecurityUpdateYear3EndDate, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProductSupportStatus)} does not support writing '{options.Format}' format."); + } + } + + ProductSupportStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProductSupportStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProductSupportStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ProductSupportStatus.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ProductSupportStatus.cs new file mode 100644 index 000000000000..70a242be2fef --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ProductSupportStatus.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Class to represent the Product Support Status. + public partial class ProductSupportStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ProductSupportStatus() + { + } + + /// Initializes a new instance of . + /// Gets or sets current version of ServicePack. + /// Gets or sets ServicePack of the product. + /// Gets or sets the Extended Security Update ESU status. + /// Gets or sets the support status of the product. + /// Gets or sets the ETA. + /// Gets or sets the current ESU support year. + /// Gets or sets the main stream end date of the product. + /// Gets or sets the extended support end date of the product. + /// Gets or sets the extended security update year 1 end date of the product. + /// Gets or sets the extended security update year 2 end date of the product. + /// Gets or sets the extended security update year 3 end date of the product. + /// Keeps track of any properties unknown to the library. + internal ProductSupportStatus(string currentVersion, string servicePackStatus, string esuStatus, string supportStatus, int? eta, string currentEsuYear, DateTimeOffset? mainstreamEndOn, DateTimeOffset? extendedSupportEndOn, DateTimeOffset? extendedSecurityUpdateYear1EndOn, DateTimeOffset? extendedSecurityUpdateYear2EndOn, DateTimeOffset? extendedSecurityUpdateYear3EndOn, IDictionary serializedAdditionalRawData) + { + CurrentVersion = currentVersion; + ServicePackStatus = servicePackStatus; + EsuStatus = esuStatus; + SupportStatus = supportStatus; + Eta = eta; + CurrentEsuYear = currentEsuYear; + MainstreamEndOn = mainstreamEndOn; + ExtendedSupportEndOn = extendedSupportEndOn; + ExtendedSecurityUpdateYear1EndOn = extendedSecurityUpdateYear1EndOn; + ExtendedSecurityUpdateYear2EndOn = extendedSecurityUpdateYear2EndOn; + ExtendedSecurityUpdateYear3EndOn = extendedSecurityUpdateYear3EndOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets current version of ServicePack. + public string CurrentVersion { get; } + /// Gets or sets ServicePack of the product. + public string ServicePackStatus { get; } + /// Gets or sets the Extended Security Update ESU status. + public string EsuStatus { get; } + /// Gets or sets the support status of the product. + public string SupportStatus { get; } + /// Gets or sets the ETA. + public int? Eta { get; } + /// Gets or sets the current ESU support year. + public string CurrentEsuYear { get; } + /// Gets or sets the main stream end date of the product. + public DateTimeOffset? MainstreamEndOn { get; } + /// Gets or sets the extended support end date of the product. + public DateTimeOffset? ExtendedSupportEndOn { get; } + /// Gets or sets the extended security update year 1 end date of the product. + public DateTimeOffset? ExtendedSecurityUpdateYear1EndOn { get; } + /// Gets or sets the extended security update year 2 end date of the product. + public DateTimeOffset? ExtendedSecurityUpdateYear2EndOn { get; } + /// Gets or sets the extended security update year 3 end date of the product. + public DateTimeOffset? ExtendedSecurityUpdateYear3EndOn { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/RecommendedSuitability.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/RecommendedSuitability.cs new file mode 100644 index 000000000000..58ee938136a3 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/RecommendedSuitability.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The RecommendedSuitability. + public readonly partial struct RecommendedSuitability : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RecommendedSuitability(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string SuitableForSqlDBValue = "SuitableForSqlDB"; + private const string SuitableForSqlMIValue = "SuitableForSqlMI"; + private const string SuitableForVmValue = "SuitableForVM"; + private const string PotentiallySuitableForVmValue = "PotentiallySuitableForVM"; + private const string ReadinessUnknownValue = "ReadinessUnknown"; + private const string NotSuitableValue = "NotSuitable"; + private const string SuitableForSqlVmValue = "SuitableForSqlVM"; + private const string ConditionallySuitableForSqlDBValue = "ConditionallySuitableForSqlDB"; + private const string ConditionallySuitableForSqlMIValue = "ConditionallySuitableForSqlMI"; + private const string ConditionallySuitableForVmValue = "ConditionallySuitableForVM"; + private const string ConditionallySuitableForSqlVmValue = "ConditionallySuitableForSqlVM"; + + /// Unknown. + public static RecommendedSuitability Unknown { get; } = new RecommendedSuitability(UnknownValue); + /// SuitableForSqlDB. + public static RecommendedSuitability SuitableForSqlDB { get; } = new RecommendedSuitability(SuitableForSqlDBValue); + /// SuitableForSqlMI. + public static RecommendedSuitability SuitableForSqlMI { get; } = new RecommendedSuitability(SuitableForSqlMIValue); + /// SuitableForVM. + public static RecommendedSuitability SuitableForVm { get; } = new RecommendedSuitability(SuitableForVmValue); + /// PotentiallySuitableForVM. + public static RecommendedSuitability PotentiallySuitableForVm { get; } = new RecommendedSuitability(PotentiallySuitableForVmValue); + /// ReadinessUnknown. + public static RecommendedSuitability ReadinessUnknown { get; } = new RecommendedSuitability(ReadinessUnknownValue); + /// NotSuitable. + public static RecommendedSuitability NotSuitable { get; } = new RecommendedSuitability(NotSuitableValue); + /// SuitableForSqlVM. + public static RecommendedSuitability SuitableForSqlVm { get; } = new RecommendedSuitability(SuitableForSqlVmValue); + /// ConditionallySuitableForSqlDB. + public static RecommendedSuitability ConditionallySuitableForSqlDB { get; } = new RecommendedSuitability(ConditionallySuitableForSqlDBValue); + /// ConditionallySuitableForSqlMI. + public static RecommendedSuitability ConditionallySuitableForSqlMI { get; } = new RecommendedSuitability(ConditionallySuitableForSqlMIValue); + /// ConditionallySuitableForVM. + public static RecommendedSuitability ConditionallySuitableForVm { get; } = new RecommendedSuitability(ConditionallySuitableForVmValue); + /// ConditionallySuitableForSqlVM. + public static RecommendedSuitability ConditionallySuitableForSqlVm { get; } = new RecommendedSuitability(ConditionallySuitableForSqlVmValue); + /// Determines if two values are the same. + public static bool operator ==(RecommendedSuitability left, RecommendedSuitability right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RecommendedSuitability left, RecommendedSuitability right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator RecommendedSuitability(string value) => new RecommendedSuitability(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RecommendedSuitability other && Equals(other); + /// + public bool Equals(RecommendedSuitability other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ServerCollectorListResult.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ServerCollectorListResult.Serialization.cs new file mode 100644 index 000000000000..6c12d345b667 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ServerCollectorListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class ServerCollectorListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerCollectorListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ServerCollectorListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerCollectorListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServerCollectorListResult(document.RootElement, options); + } + + internal static ServerCollectorListResult DeserializeServerCollectorListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MigrationAssessmentServerCollectorData.DeserializeMigrationAssessmentServerCollectorData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServerCollectorListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ServerCollectorListResult)} does not support writing '{options.Format}' format."); + } + } + + ServerCollectorListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeServerCollectorListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServerCollectorListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ServerCollectorListResult.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ServerCollectorListResult.cs new file mode 100644 index 000000000000..1c8c4c8d083c --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/ServerCollectorListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The response of a ServerCollector list operation. + internal partial class ServerCollectorListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The ServerCollector items on this page. + /// is null. + internal ServerCollectorListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The ServerCollector items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ServerCollectorListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ServerCollectorListResult() + { + } + + /// The ServerCollector items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SharedResourcesDto.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SharedResourcesDto.Serialization.cs new file mode 100644 index 000000000000..aa60fc3ecd29 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SharedResourcesDto.Serialization.cs @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class SharedResourcesDto : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SharedResourcesDto)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsCollectionDefined(SharedDataDisks)) + { + writer.WritePropertyName("sharedDataDisks"u8); + writer.WriteStartArray(); + foreach (var item in SharedDataDisks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(SharedLogDisks)) + { + writer.WritePropertyName("sharedLogDisks"u8); + writer.WriteStartArray(); + foreach (var item in SharedLogDisks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(SharedTempDBDisks)) + { + writer.WritePropertyName("sharedTempDbDisks"u8); + writer.WriteStartArray(); + foreach (var item in SharedTempDBDisks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfMounts)) + { + writer.WritePropertyName("numberOfMounts"u8); + writer.WriteNumberValue(NumberOfMounts.Value); + } + if (options.Format != "W" && Optional.IsDefined(QuorumWitness)) + { + writer.WritePropertyName("quorumWitness"u8); + writer.WriteObjectValue(QuorumWitness, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SharedResourcesDto IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SharedResourcesDto)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSharedResourcesDto(document.RootElement, options); + } + + internal static SharedResourcesDto DeserializeSharedResourcesDto(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList sharedDataDisks = default; + IReadOnlyList sharedLogDisks = default; + IReadOnlyList sharedTempDBDisks = default; + int? numberOfMounts = default; + AzureQuorumWitnessDto quorumWitness = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sharedDataDisks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AzureManagedDiskSkuDto.DeserializeAzureManagedDiskSkuDto(item, options)); + } + sharedDataDisks = array; + continue; + } + if (property.NameEquals("sharedLogDisks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AzureManagedDiskSkuDto.DeserializeAzureManagedDiskSkuDto(item, options)); + } + sharedLogDisks = array; + continue; + } + if (property.NameEquals("sharedTempDbDisks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AzureManagedDiskSkuDto.DeserializeAzureManagedDiskSkuDto(item, options)); + } + sharedTempDBDisks = array; + continue; + } + if (property.NameEquals("numberOfMounts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfMounts = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("quorumWitness"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + quorumWitness = AzureQuorumWitnessDto.DeserializeAzureQuorumWitnessDto(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SharedResourcesDto( + sharedDataDisks ?? new ChangeTrackingList(), + sharedLogDisks ?? new ChangeTrackingList(), + sharedTempDBDisks ?? new ChangeTrackingList(), + numberOfMounts, + quorumWitness, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SharedResourcesDto)} does not support writing '{options.Format}' format."); + } + } + + SharedResourcesDto IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSharedResourcesDto(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SharedResourcesDto)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SharedResourcesDto.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SharedResourcesDto.cs new file mode 100644 index 000000000000..d4300f0f72d4 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SharedResourcesDto.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Shared Resources. + public partial class SharedResourcesDto + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SharedResourcesDto() + { + SharedDataDisks = new ChangeTrackingList(); + SharedLogDisks = new ChangeTrackingList(); + SharedTempDBDisks = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets the list of shared data disks. + /// Gets the list of shared log disks. + /// Gets the list of shared Temporary database disks. + /// Gets number of mounts of shared disks. + /// Gets quorum witness. + /// Keeps track of any properties unknown to the library. + internal SharedResourcesDto(IReadOnlyList sharedDataDisks, IReadOnlyList sharedLogDisks, IReadOnlyList sharedTempDBDisks, int? numberOfMounts, AzureQuorumWitnessDto quorumWitness, IDictionary serializedAdditionalRawData) + { + SharedDataDisks = sharedDataDisks; + SharedLogDisks = sharedLogDisks; + SharedTempDBDisks = sharedTempDBDisks; + NumberOfMounts = numberOfMounts; + QuorumWitness = quorumWitness; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the list of shared data disks. + public IReadOnlyList SharedDataDisks { get; } + /// Gets the list of shared log disks. + public IReadOnlyList SharedLogDisks { get; } + /// Gets the list of shared Temporary database disks. + public IReadOnlyList SharedTempDBDisks { get; } + /// Gets number of mounts of shared disks. + public int? NumberOfMounts { get; } + /// Gets quorum witness. + internal AzureQuorumWitnessDto QuorumWitness { get; } + /// Gets quorum witness type. + public AzureQuorumWitnessDtoQuorumWitnessType? QuorumWitnessType + { + get => QuorumWitness?.QuorumWitnessType; + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SkuReplicationMode.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SkuReplicationMode.cs new file mode 100644 index 000000000000..e89da7bc0815 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SkuReplicationMode.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The SkuReplicationMode. + public readonly partial struct SkuReplicationMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SkuReplicationMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotApplicableValue = "NotApplicable"; + private const string ActiveGeoReplicationValue = "ActiveGeoReplication"; + private const string FailoverGroupInstanceValue = "FailoverGroupInstance"; + + /// NotApplicable. + public static SkuReplicationMode NotApplicable { get; } = new SkuReplicationMode(NotApplicableValue); + /// ActiveGeoReplication. + public static SkuReplicationMode ActiveGeoReplication { get; } = new SkuReplicationMode(ActiveGeoReplicationValue); + /// FailoverGroupInstance. + public static SkuReplicationMode FailoverGroupInstance { get; } = new SkuReplicationMode(FailoverGroupInstanceValue); + /// Determines if two values are the same. + public static bool operator ==(SkuReplicationMode left, SkuReplicationMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SkuReplicationMode left, SkuReplicationMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SkuReplicationMode(string value) => new SkuReplicationMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SkuReplicationMode other && Equals(other); + /// + public bool Equals(SkuReplicationMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessedNetworkAdapter.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessedNetworkAdapter.Serialization.cs new file mode 100644 index 000000000000..d70c70a6a048 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessedNetworkAdapter.Serialization.cs @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class SqlAssessedNetworkAdapter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlAssessedNetworkAdapter)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Suitability)) + { + writer.WritePropertyName("suitability"u8); + writer.WriteStringValue(Suitability.Value.ToString()); + } + if (Optional.IsDefined(SuitabilityDetail)) + { + writer.WritePropertyName("suitabilityDetail"u8); + writer.WriteStringValue(SuitabilityDetail.Value.ToString()); + } + if (Optional.IsDefined(SuitabilityExplanation)) + { + writer.WritePropertyName("suitabilityExplanation"u8); + writer.WriteStringValue(SuitabilityExplanation.Value.ToString()); + } + if (Optional.IsDefined(MonthlyBandwidthCosts)) + { + writer.WritePropertyName("monthlyBandwidthCosts"u8); + writer.WriteNumberValue(MonthlyBandwidthCosts.Value); + } + if (Optional.IsDefined(NetGigabytesTransmittedPerMonth)) + { + writer.WritePropertyName("netGigabytesTransmittedPerMonth"u8); + writer.WriteNumberValue(NetGigabytesTransmittedPerMonth.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (Optional.IsDefined(MacAddress)) + { + writer.WritePropertyName("macAddress"u8); + writer.WriteStringValue(MacAddress); + } + if (options.Format != "W" && Optional.IsCollectionDefined(IPAddresses)) + { + writer.WritePropertyName("ipAddresses"u8); + writer.WriteStartArray(); + foreach (var item in IPAddresses) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(MegabytesPerSecondReceived)) + { + writer.WritePropertyName("megabytesPerSecondReceived"u8); + writer.WriteNumberValue(MegabytesPerSecondReceived.Value); + } + if (Optional.IsDefined(MegabytesPerSecondTransmitted)) + { + writer.WritePropertyName("megabytesPerSecondTransmitted"u8); + writer.WriteNumberValue(MegabytesPerSecondTransmitted.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SqlAssessedNetworkAdapter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlAssessedNetworkAdapter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSqlAssessedNetworkAdapter(document.RootElement, options); + } + + internal static SqlAssessedNetworkAdapter DeserializeSqlAssessedNetworkAdapter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MigrationAssessmentCloudSuitability? suitability = default; + AzureNetworkAdapterSuitabilityDetail? suitabilityDetail = default; + AzureNetworkAdapterSuitabilityExplanation? suitabilityExplanation = default; + double? monthlyBandwidthCosts = default; + double? netGigabytesTransmittedPerMonth = default; + string name = default; + string displayName = default; + string macAddress = default; + IReadOnlyList ipAddresses = default; + double? megabytesPerSecondReceived = default; + double? megabytesPerSecondTransmitted = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("suitability"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitability = new MigrationAssessmentCloudSuitability(property.Value.GetString()); + continue; + } + if (property.NameEquals("suitabilityDetail"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitabilityDetail = new AzureNetworkAdapterSuitabilityDetail(property.Value.GetString()); + continue; + } + if (property.NameEquals("suitabilityExplanation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitabilityExplanation = new AzureNetworkAdapterSuitabilityExplanation(property.Value.GetString()); + continue; + } + if (property.NameEquals("monthlyBandwidthCosts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyBandwidthCosts = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("netGigabytesTransmittedPerMonth"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + netGigabytesTransmittedPerMonth = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("macAddress"u8)) + { + macAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipAddresses"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipAddresses = array; + continue; + } + if (property.NameEquals("megabytesPerSecondReceived"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + megabytesPerSecondReceived = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("megabytesPerSecondTransmitted"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + megabytesPerSecondTransmitted = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SqlAssessedNetworkAdapter( + suitability, + suitabilityDetail, + suitabilityExplanation, + monthlyBandwidthCosts, + netGigabytesTransmittedPerMonth, + name, + displayName, + macAddress, + ipAddresses ?? new ChangeTrackingList(), + megabytesPerSecondReceived, + megabytesPerSecondTransmitted, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SqlAssessedNetworkAdapter)} does not support writing '{options.Format}' format."); + } + } + + SqlAssessedNetworkAdapter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSqlAssessedNetworkAdapter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SqlAssessedNetworkAdapter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessedNetworkAdapter.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessedNetworkAdapter.cs new file mode 100644 index 000000000000..dac8268cde14 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessedNetworkAdapter.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// SQL Assessed Network Adapter. + public partial class SqlAssessedNetworkAdapter + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SqlAssessedNetworkAdapter() + { + IPAddresses = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets the suitability. + /// Gets the suitability detail. + /// Gets the suitability explanation. + /// Gets the monthly bandwidth costs. + /// Gets the net gigabytes transmitted per month. + /// Gets the name. + /// Gets the display name. + /// Gets the mac address. + /// Gets the ip addresses. + /// Gets the megabytes per second received. + /// Gets the megabytes per second transmitted. + /// Keeps track of any properties unknown to the library. + internal SqlAssessedNetworkAdapter(MigrationAssessmentCloudSuitability? suitability, AzureNetworkAdapterSuitabilityDetail? suitabilityDetail, AzureNetworkAdapterSuitabilityExplanation? suitabilityExplanation, double? monthlyBandwidthCosts, double? netGigabytesTransmittedPerMonth, string name, string displayName, string macAddress, IReadOnlyList ipAddresses, double? megabytesPerSecondReceived, double? megabytesPerSecondTransmitted, IDictionary serializedAdditionalRawData) + { + Suitability = suitability; + SuitabilityDetail = suitabilityDetail; + SuitabilityExplanation = suitabilityExplanation; + MonthlyBandwidthCosts = monthlyBandwidthCosts; + NetGigabytesTransmittedPerMonth = netGigabytesTransmittedPerMonth; + Name = name; + DisplayName = displayName; + MacAddress = macAddress; + IPAddresses = ipAddresses; + MegabytesPerSecondReceived = megabytesPerSecondReceived; + MegabytesPerSecondTransmitted = megabytesPerSecondTransmitted; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the suitability. + public MigrationAssessmentCloudSuitability? Suitability { get; } + /// Gets the suitability detail. + public AzureNetworkAdapterSuitabilityDetail? SuitabilityDetail { get; } + /// Gets the suitability explanation. + public AzureNetworkAdapterSuitabilityExplanation? SuitabilityExplanation { get; } + /// Gets the monthly bandwidth costs. + public double? MonthlyBandwidthCosts { get; } + /// Gets the net gigabytes transmitted per month. + public double? NetGigabytesTransmittedPerMonth { get; } + /// Gets the name. + public string Name { get; } + /// Gets the display name. + public string DisplayName { get; } + /// Gets the mac address. + public string MacAddress { get; } + /// Gets the ip addresses. + public IReadOnlyList IPAddresses { get; } + /// Gets the megabytes per second received. + public double? MegabytesPerSecondReceived { get; } + /// Gets the megabytes per second transmitted. + public double? MegabytesPerSecondTransmitted { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentMigrationIssue.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentMigrationIssue.Serialization.cs new file mode 100644 index 000000000000..fc772e3c9cfe --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentMigrationIssue.Serialization.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class SqlAssessmentMigrationIssue : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlAssessmentMigrationIssue)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(IssueId)) + { + writer.WritePropertyName("issueId"u8); + writer.WriteStringValue(IssueId); + } + if (options.Format != "W" && Optional.IsDefined(IssueCategory)) + { + writer.WritePropertyName("issueCategory"u8); + writer.WriteStringValue(IssueCategory.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ImpactedObjects)) + { + writer.WritePropertyName("impactedObjects"u8); + writer.WriteStartArray(); + foreach (var item in ImpactedObjects) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SqlAssessmentMigrationIssue IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlAssessmentMigrationIssue)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSqlAssessmentMigrationIssue(document.RootElement, options); + } + + internal static SqlAssessmentMigrationIssue DeserializeSqlAssessmentMigrationIssue(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string issueId = default; + SqlAssessmentMigrationIssueCategory? issueCategory = default; + IReadOnlyList impactedObjects = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("issueId"u8)) + { + issueId = property.Value.GetString(); + continue; + } + if (property.NameEquals("issueCategory"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + issueCategory = new SqlAssessmentMigrationIssueCategory(property.Value.GetString()); + continue; + } + if (property.NameEquals("impactedObjects"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ImpactedAssessmentObject.DeserializeImpactedAssessmentObject(item, options)); + } + impactedObjects = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SqlAssessmentMigrationIssue(issueId, issueCategory, impactedObjects ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SqlAssessmentMigrationIssue)} does not support writing '{options.Format}' format."); + } + } + + SqlAssessmentMigrationIssue IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSqlAssessmentMigrationIssue(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SqlAssessmentMigrationIssue)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentMigrationIssue.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentMigrationIssue.cs new file mode 100644 index 000000000000..0ec793b19dc4 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentMigrationIssue.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Class representing the SQL migration issues. + public partial class SqlAssessmentMigrationIssue + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SqlAssessmentMigrationIssue() + { + ImpactedObjects = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets the issue id. + /// Gets the issue category. + /// Gets the list of impacted objects. + /// Keeps track of any properties unknown to the library. + internal SqlAssessmentMigrationIssue(string issueId, SqlAssessmentMigrationIssueCategory? issueCategory, IReadOnlyList impactedObjects, IDictionary serializedAdditionalRawData) + { + IssueId = issueId; + IssueCategory = issueCategory; + ImpactedObjects = impactedObjects; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the issue id. + public string IssueId { get; } + /// Gets the issue category. + public SqlAssessmentMigrationIssueCategory? IssueCategory { get; } + /// Gets the list of impacted objects. + public IReadOnlyList ImpactedObjects { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentMigrationIssueCategory.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentMigrationIssueCategory.cs new file mode 100644 index 000000000000..8e8a46e54392 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentMigrationIssueCategory.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The SqlAssessmentMigrationIssueCategory. + public readonly partial struct SqlAssessmentMigrationIssueCategory : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SqlAssessmentMigrationIssueCategory(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string IssueValue = "Issue"; + private const string WarningValue = "Warning"; + private const string InternalValue = "Internal"; + + /// Issue. + public static SqlAssessmentMigrationIssueCategory Issue { get; } = new SqlAssessmentMigrationIssueCategory(IssueValue); + /// Warning. + public static SqlAssessmentMigrationIssueCategory Warning { get; } = new SqlAssessmentMigrationIssueCategory(WarningValue); + /// Internal. + public static SqlAssessmentMigrationIssueCategory Internal { get; } = new SqlAssessmentMigrationIssueCategory(InternalValue); + /// Determines if two values are the same. + public static bool operator ==(SqlAssessmentMigrationIssueCategory left, SqlAssessmentMigrationIssueCategory right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SqlAssessmentMigrationIssueCategory left, SqlAssessmentMigrationIssueCategory right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SqlAssessmentMigrationIssueCategory(string value) => new SqlAssessmentMigrationIssueCategory(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SqlAssessmentMigrationIssueCategory other && Equals(other); + /// + public bool Equals(SqlAssessmentMigrationIssueCategory other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentOptionsListResult.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentOptionsListResult.Serialization.cs new file mode 100644 index 000000000000..3ba672aa4121 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentOptionsListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class SqlAssessmentOptionsListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlAssessmentOptionsListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SqlAssessmentOptionsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlAssessmentOptionsListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSqlAssessmentOptionsListResult(document.RootElement, options); + } + + internal static SqlAssessmentOptionsListResult DeserializeSqlAssessmentOptionsListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MigrationAssessmentSqlAssessmentOptionData.DeserializeMigrationAssessmentSqlAssessmentOptionData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SqlAssessmentOptionsListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SqlAssessmentOptionsListResult)} does not support writing '{options.Format}' format."); + } + } + + SqlAssessmentOptionsListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSqlAssessmentOptionsListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SqlAssessmentOptionsListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentOptionsListResult.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentOptionsListResult.cs new file mode 100644 index 000000000000..70526b7fc17d --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentOptionsListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The response of a SqlAssessmentOptions list operation. + internal partial class SqlAssessmentOptionsListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The SqlAssessmentOptions items on this page. + /// is null. + internal SqlAssessmentOptionsListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The SqlAssessmentOptions items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal SqlAssessmentOptionsListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SqlAssessmentOptionsListResult() + { + } + + /// The SqlAssessmentOptions items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2IaasSuitabilityDetails.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2IaasSuitabilityDetails.Serialization.cs new file mode 100644 index 000000000000..8b5ce17df89c --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2IaasSuitabilityDetails.Serialization.cs @@ -0,0 +1,393 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class SqlAssessmentV2IaasSuitabilityDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlAssessmentV2IaasSuitabilityDetails)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(AzureSqlSku)) + { + writer.WritePropertyName("azureSqlSku"u8); + writer.WriteObjectValue(AzureSqlSku, options); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ReplicaAzureSqlSku)) + { + writer.WritePropertyName("replicaAzureSqlSku"u8); + writer.WriteStartArray(); + foreach (var item in ReplicaAzureSqlSku) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(SharedResources)) + { + writer.WritePropertyName("sharedResources"u8); + writer.WriteObjectValue(SharedResources, options); + } + if (options.Format != "W" && Optional.IsDefined(MonthlyComputeCost)) + { + writer.WritePropertyName("monthlyComputeCost"u8); + writer.WriteNumberValue(MonthlyComputeCost.Value); + } + if (options.Format != "W" && Optional.IsDefined(MonthlyStorageCost)) + { + writer.WritePropertyName("monthlyStorageCost"u8); + writer.WriteNumberValue(MonthlyStorageCost.Value); + } + if (Optional.IsCollectionDefined(CostComponents)) + { + writer.WritePropertyName("costComponents"u8); + writer.WriteStartArray(); + foreach (var item in CostComponents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(SecuritySuitability)) + { + writer.WritePropertyName("securitySuitability"u8); + writer.WriteStringValue(SecuritySuitability.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ShouldProvisionReplicas)) + { + writer.WritePropertyName("shouldProvisionReplicas"u8); + writer.WriteBooleanValue(ShouldProvisionReplicas.Value); + } + if (options.Format != "W" && Optional.IsDefined(SkuReplicationMode)) + { + writer.WritePropertyName("skuReplicationMode"u8); + writer.WriteStringValue(SkuReplicationMode.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(MigrationGuidelines)) + { + writer.WritePropertyName("migrationGuidelines"u8); + writer.WriteStartArray(); + foreach (var item in MigrationGuidelines) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(RecommendationReasonings)) + { + writer.WritePropertyName("recommendationReasonings"u8); + writer.WriteStartArray(); + foreach (var item in RecommendationReasonings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(MigrationTargetPlatform)) + { + writer.WritePropertyName("migrationTargetPlatform"u8); + writer.WriteStringValue(MigrationTargetPlatform.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Suitability)) + { + writer.WritePropertyName("suitability"u8); + writer.WriteStringValue(Suitability.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(MigrationIssues)) + { + writer.WritePropertyName("migrationIssues"u8); + writer.WriteStartArray(); + foreach (var item in MigrationIssues) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SqlAssessmentV2IaasSuitabilityDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlAssessmentV2IaasSuitabilityDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSqlAssessmentV2IaasSuitabilityDetails(document.RootElement, options); + } + + internal static SqlAssessmentV2IaasSuitabilityDetails DeserializeSqlAssessmentV2IaasSuitabilityDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureSqlIaasSkuDto azureSqlSku = default; + IReadOnlyList replicaAzureSqlSku = default; + SharedResourcesDto sharedResources = default; + double? monthlyComputeCost = default; + double? monthlyStorageCost = default; + IReadOnlyList costComponents = default; + MigrationAssessmentCloudSuitability? securitySuitability = default; + bool? shouldProvisionReplicas = default; + SkuReplicationMode? skuReplicationMode = default; + IReadOnlyList migrationGuidelines = default; + IReadOnlyList recommendationReasonings = default; + MigrationAssessmentTargetType? migrationTargetPlatform = default; + MigrationAssessmentCloudSuitability? suitability = default; + IReadOnlyList migrationIssues = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azureSqlSku"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSqlSku = AzureSqlIaasSkuDto.DeserializeAzureSqlIaasSkuDto(property.Value, options); + continue; + } + if (property.NameEquals("replicaAzureSqlSku"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AzureSqlIaasSkuDto.DeserializeAzureSqlIaasSkuDto(item, options)); + } + replicaAzureSqlSku = array; + continue; + } + if (property.NameEquals("sharedResources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sharedResources = SharedResourcesDto.DeserializeSharedResourcesDto(property.Value, options); + continue; + } + if (property.NameEquals("monthlyComputeCost"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyComputeCost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyStorageCost"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyStorageCost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("costComponents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CostComponent.DeserializeCostComponent(item, options)); + } + costComponents = array; + continue; + } + if (property.NameEquals("securitySuitability"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securitySuitability = new MigrationAssessmentCloudSuitability(property.Value.GetString()); + continue; + } + if (property.NameEquals("shouldProvisionReplicas"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + shouldProvisionReplicas = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("skuReplicationMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + skuReplicationMode = new SkuReplicationMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("migrationGuidelines"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SqlMigrationGuideline.DeserializeSqlMigrationGuideline(item, options)); + } + migrationGuidelines = array; + continue; + } + if (property.NameEquals("recommendationReasonings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SqlRecommendationReasoning.DeserializeSqlRecommendationReasoning(item, options)); + } + recommendationReasonings = array; + continue; + } + if (property.NameEquals("migrationTargetPlatform"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + migrationTargetPlatform = new MigrationAssessmentTargetType(property.Value.GetString()); + continue; + } + if (property.NameEquals("suitability"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitability = new MigrationAssessmentCloudSuitability(property.Value.GetString()); + continue; + } + if (property.NameEquals("migrationIssues"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SqlAssessmentMigrationIssue.DeserializeSqlAssessmentMigrationIssue(item, options)); + } + migrationIssues = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SqlAssessmentV2IaasSuitabilityDetails( + azureSqlSku, + replicaAzureSqlSku ?? new ChangeTrackingList(), + sharedResources, + monthlyComputeCost, + monthlyStorageCost, + costComponents ?? new ChangeTrackingList(), + securitySuitability, + shouldProvisionReplicas, + skuReplicationMode, + migrationGuidelines ?? new ChangeTrackingList(), + recommendationReasonings ?? new ChangeTrackingList(), + migrationTargetPlatform, + suitability, + migrationIssues ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SqlAssessmentV2IaasSuitabilityDetails)} does not support writing '{options.Format}' format."); + } + } + + SqlAssessmentV2IaasSuitabilityDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSqlAssessmentV2IaasSuitabilityDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SqlAssessmentV2IaasSuitabilityDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2IaasSuitabilityDetails.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2IaasSuitabilityDetails.cs new file mode 100644 index 000000000000..0f67b3c03501 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2IaasSuitabilityDetails.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Class representing Azure SQL IAAS suitability details. + public partial class SqlAssessmentV2IaasSuitabilityDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SqlAssessmentV2IaasSuitabilityDetails() + { + ReplicaAzureSqlSku = new ChangeTrackingList(); + CostComponents = new ChangeTrackingList(); + MigrationGuidelines = new ChangeTrackingList(); + RecommendationReasonings = new ChangeTrackingList(); + MigrationIssues = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets the azure SQL IAAS SKU. + /// Gets the replica azure SQL IAAS SKU. + /// Gets the shared resources. + /// Gets the monthly compute cost. + /// Gets the monthly storage cost. + /// Gets the collection of cost components. + /// Gets the suitability for Microsoft cloud defender. + /// Gets a value indicating whether replicas should be provisioned. + /// Gets the replication mode. + /// Gets the list of migration guidelines applicable to this target. + /// Gets the list of SQL recommendation Reasoning. + /// Gets the migration target platform. + /// Gets the azure suitability. + /// Gets the list of migrations issues. + /// Keeps track of any properties unknown to the library. + internal SqlAssessmentV2IaasSuitabilityDetails(AzureSqlIaasSkuDto azureSqlSku, IReadOnlyList replicaAzureSqlSku, SharedResourcesDto sharedResources, double? monthlyComputeCost, double? monthlyStorageCost, IReadOnlyList costComponents, MigrationAssessmentCloudSuitability? securitySuitability, bool? shouldProvisionReplicas, SkuReplicationMode? skuReplicationMode, IReadOnlyList migrationGuidelines, IReadOnlyList recommendationReasonings, MigrationAssessmentTargetType? migrationTargetPlatform, MigrationAssessmentCloudSuitability? suitability, IReadOnlyList migrationIssues, IDictionary serializedAdditionalRawData) + { + AzureSqlSku = azureSqlSku; + ReplicaAzureSqlSku = replicaAzureSqlSku; + SharedResources = sharedResources; + MonthlyComputeCost = monthlyComputeCost; + MonthlyStorageCost = monthlyStorageCost; + CostComponents = costComponents; + SecuritySuitability = securitySuitability; + ShouldProvisionReplicas = shouldProvisionReplicas; + SkuReplicationMode = skuReplicationMode; + MigrationGuidelines = migrationGuidelines; + RecommendationReasonings = recommendationReasonings; + MigrationTargetPlatform = migrationTargetPlatform; + Suitability = suitability; + MigrationIssues = migrationIssues; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the azure SQL IAAS SKU. + public AzureSqlIaasSkuDto AzureSqlSku { get; } + /// Gets the replica azure SQL IAAS SKU. + public IReadOnlyList ReplicaAzureSqlSku { get; } + /// Gets the shared resources. + public SharedResourcesDto SharedResources { get; } + /// Gets the monthly compute cost. + public double? MonthlyComputeCost { get; } + /// Gets the monthly storage cost. + public double? MonthlyStorageCost { get; } + /// Gets the collection of cost components. + public IReadOnlyList CostComponents { get; } + /// Gets the suitability for Microsoft cloud defender. + public MigrationAssessmentCloudSuitability? SecuritySuitability { get; } + /// Gets a value indicating whether replicas should be provisioned. + public bool? ShouldProvisionReplicas { get; } + /// Gets the replication mode. + public SkuReplicationMode? SkuReplicationMode { get; } + /// Gets the list of migration guidelines applicable to this target. + public IReadOnlyList MigrationGuidelines { get; } + /// Gets the list of SQL recommendation Reasoning. + public IReadOnlyList RecommendationReasonings { get; } + /// Gets the migration target platform. + public MigrationAssessmentTargetType? MigrationTargetPlatform { get; } + /// Gets the azure suitability. + public MigrationAssessmentCloudSuitability? Suitability { get; } + /// Gets the list of migrations issues. + public IReadOnlyList MigrationIssues { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2ListResult.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2ListResult.Serialization.cs new file mode 100644 index 000000000000..582aff10fae3 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2ListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class SqlAssessmentV2ListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlAssessmentV2ListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SqlAssessmentV2ListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlAssessmentV2ListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSqlAssessmentV2ListResult(document.RootElement, options); + } + + internal static SqlAssessmentV2ListResult DeserializeSqlAssessmentV2ListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MigrationAssessmentSqlAssessmentV2Data.DeserializeMigrationAssessmentSqlAssessmentV2Data(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SqlAssessmentV2ListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SqlAssessmentV2ListResult)} does not support writing '{options.Format}' format."); + } + } + + SqlAssessmentV2ListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSqlAssessmentV2ListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SqlAssessmentV2ListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2ListResult.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2ListResult.cs new file mode 100644 index 000000000000..df02a073e8c7 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2ListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The response of a SqlAssessmentV2 list operation. + internal partial class SqlAssessmentV2ListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The SqlAssessmentV2 items on this page. + /// is null. + internal SqlAssessmentV2ListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The SqlAssessmentV2 items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal SqlAssessmentV2ListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SqlAssessmentV2ListResult() + { + } + + /// The SqlAssessmentV2 items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2PaasSuitabilityDetails.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2PaasSuitabilityDetails.Serialization.cs new file mode 100644 index 000000000000..d7326d4b84a9 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2PaasSuitabilityDetails.Serialization.cs @@ -0,0 +1,393 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class SqlAssessmentV2PaasSuitabilityDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlAssessmentV2PaasSuitabilityDetails)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(AzureSqlSku)) + { + writer.WritePropertyName("azureSqlSku"u8); + writer.WriteObjectValue(AzureSqlSku, options); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ReplicaAzureSqlSku)) + { + writer.WritePropertyName("replicaAzureSqlSku"u8); + writer.WriteStartArray(); + foreach (var item in ReplicaAzureSqlSku) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(SharedResources)) + { + writer.WritePropertyName("sharedResources"u8); + writer.WriteObjectValue(SharedResources, options); + } + if (options.Format != "W" && Optional.IsDefined(MonthlyComputeCost)) + { + writer.WritePropertyName("monthlyComputeCost"u8); + writer.WriteNumberValue(MonthlyComputeCost.Value); + } + if (options.Format != "W" && Optional.IsDefined(MonthlyStorageCost)) + { + writer.WritePropertyName("monthlyStorageCost"u8); + writer.WriteNumberValue(MonthlyStorageCost.Value); + } + if (Optional.IsCollectionDefined(CostComponents)) + { + writer.WritePropertyName("costComponents"u8); + writer.WriteStartArray(); + foreach (var item in CostComponents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(SecuritySuitability)) + { + writer.WritePropertyName("securitySuitability"u8); + writer.WriteStringValue(SecuritySuitability.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ShouldProvisionReplicas)) + { + writer.WritePropertyName("shouldProvisionReplicas"u8); + writer.WriteBooleanValue(ShouldProvisionReplicas.Value); + } + if (options.Format != "W" && Optional.IsDefined(SkuReplicationMode)) + { + writer.WritePropertyName("skuReplicationMode"u8); + writer.WriteStringValue(SkuReplicationMode.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(MigrationGuidelines)) + { + writer.WritePropertyName("migrationGuidelines"u8); + writer.WriteStartArray(); + foreach (var item in MigrationGuidelines) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(RecommendationReasonings)) + { + writer.WritePropertyName("recommendationReasonings"u8); + writer.WriteStartArray(); + foreach (var item in RecommendationReasonings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(MigrationTargetPlatform)) + { + writer.WritePropertyName("migrationTargetPlatform"u8); + writer.WriteStringValue(MigrationTargetPlatform.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Suitability)) + { + writer.WritePropertyName("suitability"u8); + writer.WriteStringValue(Suitability.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(MigrationIssues)) + { + writer.WritePropertyName("migrationIssues"u8); + writer.WriteStartArray(); + foreach (var item in MigrationIssues) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SqlAssessmentV2PaasSuitabilityDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlAssessmentV2PaasSuitabilityDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSqlAssessmentV2PaasSuitabilityDetails(document.RootElement, options); + } + + internal static SqlAssessmentV2PaasSuitabilityDetails DeserializeSqlAssessmentV2PaasSuitabilityDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureSqlPaasSkuDto azureSqlSku = default; + IReadOnlyList replicaAzureSqlSku = default; + SharedResourcesDto sharedResources = default; + double? monthlyComputeCost = default; + double? monthlyStorageCost = default; + IReadOnlyList costComponents = default; + MigrationAssessmentCloudSuitability? securitySuitability = default; + bool? shouldProvisionReplicas = default; + SkuReplicationMode? skuReplicationMode = default; + IReadOnlyList migrationGuidelines = default; + IReadOnlyList recommendationReasonings = default; + MigrationAssessmentTargetType? migrationTargetPlatform = default; + MigrationAssessmentCloudSuitability? suitability = default; + IReadOnlyList migrationIssues = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azureSqlSku"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSqlSku = AzureSqlPaasSkuDto.DeserializeAzureSqlPaasSkuDto(property.Value, options); + continue; + } + if (property.NameEquals("replicaAzureSqlSku"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AzureSqlPaasSkuDto.DeserializeAzureSqlPaasSkuDto(item, options)); + } + replicaAzureSqlSku = array; + continue; + } + if (property.NameEquals("sharedResources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sharedResources = SharedResourcesDto.DeserializeSharedResourcesDto(property.Value, options); + continue; + } + if (property.NameEquals("monthlyComputeCost"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyComputeCost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyStorageCost"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyStorageCost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("costComponents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CostComponent.DeserializeCostComponent(item, options)); + } + costComponents = array; + continue; + } + if (property.NameEquals("securitySuitability"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securitySuitability = new MigrationAssessmentCloudSuitability(property.Value.GetString()); + continue; + } + if (property.NameEquals("shouldProvisionReplicas"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + shouldProvisionReplicas = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("skuReplicationMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + skuReplicationMode = new SkuReplicationMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("migrationGuidelines"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SqlMigrationGuideline.DeserializeSqlMigrationGuideline(item, options)); + } + migrationGuidelines = array; + continue; + } + if (property.NameEquals("recommendationReasonings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SqlRecommendationReasoning.DeserializeSqlRecommendationReasoning(item, options)); + } + recommendationReasonings = array; + continue; + } + if (property.NameEquals("migrationTargetPlatform"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + migrationTargetPlatform = new MigrationAssessmentTargetType(property.Value.GetString()); + continue; + } + if (property.NameEquals("suitability"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suitability = new MigrationAssessmentCloudSuitability(property.Value.GetString()); + continue; + } + if (property.NameEquals("migrationIssues"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SqlAssessmentMigrationIssue.DeserializeSqlAssessmentMigrationIssue(item, options)); + } + migrationIssues = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SqlAssessmentV2PaasSuitabilityDetails( + azureSqlSku, + replicaAzureSqlSku ?? new ChangeTrackingList(), + sharedResources, + monthlyComputeCost, + monthlyStorageCost, + costComponents ?? new ChangeTrackingList(), + securitySuitability, + shouldProvisionReplicas, + skuReplicationMode, + migrationGuidelines ?? new ChangeTrackingList(), + recommendationReasonings ?? new ChangeTrackingList(), + migrationTargetPlatform, + suitability, + migrationIssues ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SqlAssessmentV2PaasSuitabilityDetails)} does not support writing '{options.Format}' format."); + } + } + + SqlAssessmentV2PaasSuitabilityDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSqlAssessmentV2PaasSuitabilityDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SqlAssessmentV2PaasSuitabilityDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2PaasSuitabilityDetails.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2PaasSuitabilityDetails.cs new file mode 100644 index 000000000000..9782585403ce --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2PaasSuitabilityDetails.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Class representing Azure SQL PAAS suitability details. + public partial class SqlAssessmentV2PaasSuitabilityDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SqlAssessmentV2PaasSuitabilityDetails() + { + ReplicaAzureSqlSku = new ChangeTrackingList(); + CostComponents = new ChangeTrackingList(); + MigrationGuidelines = new ChangeTrackingList(); + RecommendationReasonings = new ChangeTrackingList(); + MigrationIssues = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets the azure SQL PAAS SKU. + /// Gets the replica azure SQL PAAS SKU. + /// Gets the shared resources. + /// Gets the monthly compute cost. + /// Gets the monthly storage cost. + /// Gets the collection of cost components. + /// Gets the suitability for Microsoft cloud defender. + /// Gets a value indicating whether replicas should be provisioned. + /// Gets the replication mode. + /// Gets the list of migration guidelines applicable to this target. + /// Gets the list of SQL recommendation Reasoning. + /// Gets the migration target platform. + /// Gets the azure suitability. + /// Gets the list of migrations issues. + /// Keeps track of any properties unknown to the library. + internal SqlAssessmentV2PaasSuitabilityDetails(AzureSqlPaasSkuDto azureSqlSku, IReadOnlyList replicaAzureSqlSku, SharedResourcesDto sharedResources, double? monthlyComputeCost, double? monthlyStorageCost, IReadOnlyList costComponents, MigrationAssessmentCloudSuitability? securitySuitability, bool? shouldProvisionReplicas, SkuReplicationMode? skuReplicationMode, IReadOnlyList migrationGuidelines, IReadOnlyList recommendationReasonings, MigrationAssessmentTargetType? migrationTargetPlatform, MigrationAssessmentCloudSuitability? suitability, IReadOnlyList migrationIssues, IDictionary serializedAdditionalRawData) + { + AzureSqlSku = azureSqlSku; + ReplicaAzureSqlSku = replicaAzureSqlSku; + SharedResources = sharedResources; + MonthlyComputeCost = monthlyComputeCost; + MonthlyStorageCost = monthlyStorageCost; + CostComponents = costComponents; + SecuritySuitability = securitySuitability; + ShouldProvisionReplicas = shouldProvisionReplicas; + SkuReplicationMode = skuReplicationMode; + MigrationGuidelines = migrationGuidelines; + RecommendationReasonings = recommendationReasonings; + MigrationTargetPlatform = migrationTargetPlatform; + Suitability = suitability; + MigrationIssues = migrationIssues; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the azure SQL PAAS SKU. + public AzureSqlPaasSkuDto AzureSqlSku { get; } + /// Gets the replica azure SQL PAAS SKU. + public IReadOnlyList ReplicaAzureSqlSku { get; } + /// Gets the shared resources. + public SharedResourcesDto SharedResources { get; } + /// Gets the monthly compute cost. + public double? MonthlyComputeCost { get; } + /// Gets the monthly storage cost. + public double? MonthlyStorageCost { get; } + /// Gets the collection of cost components. + public IReadOnlyList CostComponents { get; } + /// Gets the suitability for Microsoft cloud defender. + public MigrationAssessmentCloudSuitability? SecuritySuitability { get; } + /// Gets a value indicating whether replicas should be provisioned. + public bool? ShouldProvisionReplicas { get; } + /// Gets the replication mode. + public SkuReplicationMode? SkuReplicationMode { get; } + /// Gets the list of migration guidelines applicable to this target. + public IReadOnlyList MigrationGuidelines { get; } + /// Gets the list of SQL recommendation Reasoning. + public IReadOnlyList RecommendationReasonings { get; } + /// Gets the migration target platform. + public MigrationAssessmentTargetType? MigrationTargetPlatform { get; } + /// Gets the azure suitability. + public MigrationAssessmentCloudSuitability? Suitability { get; } + /// Gets the list of migrations issues. + public IReadOnlyList MigrationIssues { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2SummaryDetails.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2SummaryDetails.Serialization.cs new file mode 100644 index 000000000000..8a8c7deb95a1 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2SummaryDetails.Serialization.cs @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class SqlAssessmentV2SummaryDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlAssessmentV2SummaryDetails)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsCollectionDefined(SuitabilitySummary)) + { + writer.WritePropertyName("suitabilitySummary"u8); + writer.WriteStartObject(); + foreach (var item in SuitabilitySummary) + { + writer.WritePropertyName(item.Key); + writer.WriteNumberValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsDefined(MonthlyComputeCost)) + { + writer.WritePropertyName("monthlyComputeCost"u8); + writer.WriteNumberValue(MonthlyComputeCost.Value); + } + if (options.Format != "W" && Optional.IsDefined(MonthlyStorageCost)) + { + writer.WritePropertyName("monthlyStorageCost"u8); + writer.WriteNumberValue(MonthlyStorageCost.Value); + } + if (options.Format != "W" && Optional.IsDefined(MonthlyLicenseCost)) + { + writer.WritePropertyName("monthlyLicenseCost"u8); + writer.WriteNumberValue(MonthlyLicenseCost.Value); + } + if (options.Format != "W" && Optional.IsDefined(ConfidenceScore)) + { + writer.WritePropertyName("confidenceScore"u8); + writer.WriteNumberValue(ConfidenceScore.Value); + } + if (options.Format != "W" && Optional.IsDefined(MonthlySecurityCost)) + { + writer.WritePropertyName("monthlySecurityCost"u8); + writer.WriteNumberValue(MonthlySecurityCost.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SqlAssessmentV2SummaryDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlAssessmentV2SummaryDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSqlAssessmentV2SummaryDetails(document.RootElement, options); + } + + internal static SqlAssessmentV2SummaryDetails DeserializeSqlAssessmentV2SummaryDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyDictionary suitabilitySummary = default; + double? monthlyComputeCost = default; + double? monthlyStorageCost = default; + double? monthlyLicenseCost = default; + double? confidenceScore = default; + double? monthlySecurityCost = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("suitabilitySummary"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetInt32()); + } + suitabilitySummary = dictionary; + continue; + } + if (property.NameEquals("monthlyComputeCost"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyComputeCost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyStorageCost"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyStorageCost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyLicenseCost"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlyLicenseCost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("confidenceScore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + confidenceScore = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlySecurityCost"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monthlySecurityCost = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SqlAssessmentV2SummaryDetails( + suitabilitySummary ?? new ChangeTrackingDictionary(), + monthlyComputeCost, + monthlyStorageCost, + monthlyLicenseCost, + confidenceScore, + monthlySecurityCost, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SqlAssessmentV2SummaryDetails)} does not support writing '{options.Format}' format."); + } + } + + SqlAssessmentV2SummaryDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSqlAssessmentV2SummaryDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SqlAssessmentV2SummaryDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2SummaryDetails.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2SummaryDetails.cs new file mode 100644 index 000000000000..7c57adfd34d6 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2SummaryDetails.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// SQL Assessment V2 summary data. + public partial class SqlAssessmentV2SummaryDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SqlAssessmentV2SummaryDetails() + { + SuitabilitySummary = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Sql assessment summary data. + /// Monthly compute cost. + /// Monthly storage cost. + /// Monthly license cost. + /// Confidence Rating. + /// Monthly security cost. + /// Keeps track of any properties unknown to the library. + internal SqlAssessmentV2SummaryDetails(IReadOnlyDictionary suitabilitySummary, double? monthlyComputeCost, double? monthlyStorageCost, double? monthlyLicenseCost, double? confidenceScore, double? monthlySecurityCost, IDictionary serializedAdditionalRawData) + { + SuitabilitySummary = suitabilitySummary; + MonthlyComputeCost = monthlyComputeCost; + MonthlyStorageCost = monthlyStorageCost; + MonthlyLicenseCost = monthlyLicenseCost; + ConfidenceScore = confidenceScore; + MonthlySecurityCost = monthlySecurityCost; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Sql assessment summary data. + public IReadOnlyDictionary SuitabilitySummary { get; } + /// Monthly compute cost. + public double? MonthlyComputeCost { get; } + /// Monthly storage cost. + public double? MonthlyStorageCost { get; } + /// Monthly license cost. + public double? MonthlyLicenseCost { get; } + /// Confidence Rating. + public double? ConfidenceScore { get; } + /// Monthly security cost. + public double? MonthlySecurityCost { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2SummaryListResult.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2SummaryListResult.Serialization.cs new file mode 100644 index 000000000000..3ca38ded8a30 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2SummaryListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class SqlAssessmentV2SummaryListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlAssessmentV2SummaryListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SqlAssessmentV2SummaryListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlAssessmentV2SummaryListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSqlAssessmentV2SummaryListResult(document.RootElement, options); + } + + internal static SqlAssessmentV2SummaryListResult DeserializeSqlAssessmentV2SummaryListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MigrationAssessmentSqlAssessmentV2SummaryData.DeserializeMigrationAssessmentSqlAssessmentV2SummaryData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SqlAssessmentV2SummaryListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SqlAssessmentV2SummaryListResult)} does not support writing '{options.Format}' format."); + } + } + + SqlAssessmentV2SummaryListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSqlAssessmentV2SummaryListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SqlAssessmentV2SummaryListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2SummaryListResult.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2SummaryListResult.cs new file mode 100644 index 000000000000..1f8bc5165bdd --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAssessmentV2SummaryListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The response of a SqlAssessmentV2Summary list operation. + internal partial class SqlAssessmentV2SummaryListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The SqlAssessmentV2Summary items on this page. + /// is null. + internal SqlAssessmentV2SummaryListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The SqlAssessmentV2Summary items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal SqlAssessmentV2SummaryListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SqlAssessmentV2SummaryListResult() + { + } + + /// The SqlAssessmentV2Summary items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAvailabilityGroupDataOverview.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAvailabilityGroupDataOverview.Serialization.cs new file mode 100644 index 000000000000..7fdb65c7957a --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAvailabilityGroupDataOverview.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class SqlAvailabilityGroupDataOverview : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlAvailabilityGroupDataOverview)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AvailabilityGroupId)) + { + writer.WritePropertyName("availabilityGroupId"u8); + writer.WriteStringValue(AvailabilityGroupId); + } + if (Optional.IsDefined(AvailabilityGroupName)) + { + writer.WritePropertyName("availabilityGroupName"u8); + writer.WriteStringValue(AvailabilityGroupName); + } + if (Optional.IsDefined(SqlAvailabilityGroupSdsArmId)) + { + writer.WritePropertyName("sqlAvailabilityGroupSdsArmId"u8); + writer.WriteStringValue(SqlAvailabilityGroupSdsArmId); + } + if (Optional.IsDefined(SqlAvailabilityGroupEntityId)) + { + writer.WritePropertyName("sqlAvailabilityGroupEntityId"u8); + writer.WriteStringValue(SqlAvailabilityGroupEntityId); + } + if (Optional.IsDefined(SqlAvailabilityReplicaId)) + { + writer.WritePropertyName("sqlAvailabilityReplicaId"u8); + writer.WriteStringValue(SqlAvailabilityReplicaId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SqlAvailabilityGroupDataOverview IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlAvailabilityGroupDataOverview)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSqlAvailabilityGroupDataOverview(document.RootElement, options); + } + + internal static SqlAvailabilityGroupDataOverview DeserializeSqlAvailabilityGroupDataOverview(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string availabilityGroupId = default; + string availabilityGroupName = default; + ResourceIdentifier sqlAvailabilityGroupSdsArmId = default; + string sqlAvailabilityGroupEntityId = default; + string sqlAvailabilityReplicaId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("availabilityGroupId"u8)) + { + availabilityGroupId = property.Value.GetString(); + continue; + } + if (property.NameEquals("availabilityGroupName"u8)) + { + availabilityGroupName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sqlAvailabilityGroupSdsArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sqlAvailabilityGroupSdsArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("sqlAvailabilityGroupEntityId"u8)) + { + sqlAvailabilityGroupEntityId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sqlAvailabilityReplicaId"u8)) + { + sqlAvailabilityReplicaId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SqlAvailabilityGroupDataOverview( + availabilityGroupId, + availabilityGroupName, + sqlAvailabilityGroupSdsArmId, + sqlAvailabilityGroupEntityId, + sqlAvailabilityReplicaId, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SqlAvailabilityGroupDataOverview)} does not support writing '{options.Format}' format."); + } + } + + SqlAvailabilityGroupDataOverview IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSqlAvailabilityGroupDataOverview(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SqlAvailabilityGroupDataOverview)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAvailabilityGroupDataOverview.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAvailabilityGroupDataOverview.cs new file mode 100644 index 000000000000..2a24b8680ec6 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAvailabilityGroupDataOverview.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Assessed Sql Availability Group Data Overview. + public partial class SqlAvailabilityGroupDataOverview + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SqlAvailabilityGroupDataOverview() + { + } + + /// Initializes a new instance of . + /// Gets the availability group id. + /// Gets the availability group name. + /// Gets the availability group arm id. + /// Gets the availability group entity id. + /// Gets the availability replica id. + /// Keeps track of any properties unknown to the library. + internal SqlAvailabilityGroupDataOverview(string availabilityGroupId, string availabilityGroupName, ResourceIdentifier sqlAvailabilityGroupSdsArmId, string sqlAvailabilityGroupEntityId, string sqlAvailabilityReplicaId, IDictionary serializedAdditionalRawData) + { + AvailabilityGroupId = availabilityGroupId; + AvailabilityGroupName = availabilityGroupName; + SqlAvailabilityGroupSdsArmId = sqlAvailabilityGroupSdsArmId; + SqlAvailabilityGroupEntityId = sqlAvailabilityGroupEntityId; + SqlAvailabilityReplicaId = sqlAvailabilityReplicaId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the availability group id. + public string AvailabilityGroupId { get; } + /// Gets the availability group name. + public string AvailabilityGroupName { get; } + /// Gets the availability group arm id. + public ResourceIdentifier SqlAvailabilityGroupSdsArmId { get; } + /// Gets the availability group entity id. + public string SqlAvailabilityGroupEntityId { get; } + /// Gets the availability replica id. + public string SqlAvailabilityReplicaId { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAvailabilityReplicaSummary.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAvailabilityReplicaSummary.Serialization.cs new file mode 100644 index 000000000000..b27a637a7c49 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAvailabilityReplicaSummary.Serialization.cs @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class SqlAvailabilityReplicaSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlAvailabilityReplicaSummary)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(NumberOfSynchronousReadReplicas)) + { + writer.WritePropertyName("numberOfSynchronousReadReplicas"u8); + writer.WriteNumberValue(NumberOfSynchronousReadReplicas.Value); + } + if (Optional.IsDefined(NumberOfSynchronousNonReadReplicas)) + { + writer.WritePropertyName("numberOfSynchronousNonReadReplicas"u8); + writer.WriteNumberValue(NumberOfSynchronousNonReadReplicas.Value); + } + if (Optional.IsDefined(NumberOfAsynchronousReadReplicas)) + { + writer.WritePropertyName("numberOfAsynchronousReadReplicas"u8); + writer.WriteNumberValue(NumberOfAsynchronousReadReplicas.Value); + } + if (Optional.IsDefined(NumberOfAsynchronousNonReadReplicas)) + { + writer.WritePropertyName("numberOfAsynchronousNonReadReplicas"u8); + writer.WriteNumberValue(NumberOfAsynchronousNonReadReplicas.Value); + } + if (Optional.IsDefined(NumberOfPrimaryReplicas)) + { + writer.WritePropertyName("numberOfPrimaryReplicas"u8); + writer.WriteNumberValue(NumberOfPrimaryReplicas.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SqlAvailabilityReplicaSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlAvailabilityReplicaSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSqlAvailabilityReplicaSummary(document.RootElement, options); + } + + internal static SqlAvailabilityReplicaSummary DeserializeSqlAvailabilityReplicaSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? numberOfSynchronousReadReplicas = default; + int? numberOfSynchronousNonReadReplicas = default; + int? numberOfAsynchronousReadReplicas = default; + int? numberOfAsynchronousNonReadReplicas = default; + int? numberOfPrimaryReplicas = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("numberOfSynchronousReadReplicas"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfSynchronousReadReplicas = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("numberOfSynchronousNonReadReplicas"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfSynchronousNonReadReplicas = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("numberOfAsynchronousReadReplicas"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfAsynchronousReadReplicas = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("numberOfAsynchronousNonReadReplicas"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfAsynchronousNonReadReplicas = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("numberOfPrimaryReplicas"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfPrimaryReplicas = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SqlAvailabilityReplicaSummary( + numberOfSynchronousReadReplicas, + numberOfSynchronousNonReadReplicas, + numberOfAsynchronousReadReplicas, + numberOfAsynchronousNonReadReplicas, + numberOfPrimaryReplicas, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SqlAvailabilityReplicaSummary)} does not support writing '{options.Format}' format."); + } + } + + SqlAvailabilityReplicaSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSqlAvailabilityReplicaSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SqlAvailabilityReplicaSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAvailabilityReplicaSummary.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAvailabilityReplicaSummary.cs new file mode 100644 index 000000000000..24ac7408d9ad --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlAvailabilityReplicaSummary.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Assessed Sql Availability Replica Summary. + public partial class SqlAvailabilityReplicaSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SqlAvailabilityReplicaSummary() + { + } + + /// Initializes a new instance of . + /// Gets the number Of synchronous read replicas. + /// Gets the number Of synchronous non read replicas. + /// Gets the number Of asynchronous read replicas. + /// Gets the number Of asynchronous non read replicas. + /// Gets the number Of primary replicas. + /// Keeps track of any properties unknown to the library. + internal SqlAvailabilityReplicaSummary(int? numberOfSynchronousReadReplicas, int? numberOfSynchronousNonReadReplicas, int? numberOfAsynchronousReadReplicas, int? numberOfAsynchronousNonReadReplicas, int? numberOfPrimaryReplicas, IDictionary serializedAdditionalRawData) + { + NumberOfSynchronousReadReplicas = numberOfSynchronousReadReplicas; + NumberOfSynchronousNonReadReplicas = numberOfSynchronousNonReadReplicas; + NumberOfAsynchronousReadReplicas = numberOfAsynchronousReadReplicas; + NumberOfAsynchronousNonReadReplicas = numberOfAsynchronousNonReadReplicas; + NumberOfPrimaryReplicas = numberOfPrimaryReplicas; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the number Of synchronous read replicas. + public int? NumberOfSynchronousReadReplicas { get; } + /// Gets the number Of synchronous non read replicas. + public int? NumberOfSynchronousNonReadReplicas { get; } + /// Gets the number Of asynchronous read replicas. + public int? NumberOfAsynchronousReadReplicas { get; } + /// Gets the number Of asynchronous non read replicas. + public int? NumberOfAsynchronousNonReadReplicas { get; } + /// Gets the number Of primary replicas. + public int? NumberOfPrimaryReplicas { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlCollectorListResult.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlCollectorListResult.Serialization.cs new file mode 100644 index 000000000000..7192a95f38ca --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlCollectorListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class SqlCollectorListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlCollectorListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SqlCollectorListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlCollectorListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSqlCollectorListResult(document.RootElement, options); + } + + internal static SqlCollectorListResult DeserializeSqlCollectorListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MigrationAssessmentSqlCollectorData.DeserializeMigrationAssessmentSqlCollectorData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SqlCollectorListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SqlCollectorListResult)} does not support writing '{options.Format}' format."); + } + } + + SqlCollectorListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSqlCollectorListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SqlCollectorListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlCollectorListResult.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlCollectorListResult.cs new file mode 100644 index 000000000000..987749f287cf --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlCollectorListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The response of a SqlCollector list operation. + internal partial class SqlCollectorListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The SqlCollector items on this page. + /// is null. + internal SqlCollectorListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The SqlCollector items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal SqlCollectorListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SqlCollectorListResult() + { + } + + /// The SqlCollector items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlDBSettings.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlDBSettings.Serialization.cs new file mode 100644 index 000000000000..166bbccae12d --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlDBSettings.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class SqlDBSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlDBSettings)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AzureSqlServiceTier)) + { + writer.WritePropertyName("azureSqlServiceTier"u8); + writer.WriteStringValue(AzureSqlServiceTier.Value.ToString()); + } + if (Optional.IsDefined(AzureSqlDataBaseType)) + { + writer.WritePropertyName("azureSqlDataBaseType"u8); + writer.WriteStringValue(AzureSqlDataBaseType.Value.ToString()); + } + if (Optional.IsDefined(AzureSqlComputeTier)) + { + writer.WritePropertyName("azureSqlComputeTier"u8); + writer.WriteStringValue(AzureSqlComputeTier.Value.ToString()); + } + if (Optional.IsDefined(AzureSqlPurchaseModel)) + { + writer.WritePropertyName("azureSqlPurchaseModel"u8); + writer.WriteStringValue(AzureSqlPurchaseModel.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SqlDBSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlDBSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSqlDBSettings(document.RootElement, options); + } + + internal static SqlDBSettings DeserializeSqlDBSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureSqlServiceTier? azureSqlServiceTier = default; + AzureSqlDataBaseType? azureSqlDataBaseType = default; + MigrationAssessmentComputeTier? azureSqlComputeTier = default; + AzureSqlPurchaseModel? azureSqlPurchaseModel = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azureSqlServiceTier"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSqlServiceTier = new AzureSqlServiceTier(property.Value.GetString()); + continue; + } + if (property.NameEquals("azureSqlDataBaseType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSqlDataBaseType = new AzureSqlDataBaseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("azureSqlComputeTier"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSqlComputeTier = new MigrationAssessmentComputeTier(property.Value.GetString()); + continue; + } + if (property.NameEquals("azureSqlPurchaseModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSqlPurchaseModel = new AzureSqlPurchaseModel(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SqlDBSettings(azureSqlServiceTier, azureSqlDataBaseType, azureSqlComputeTier, azureSqlPurchaseModel, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SqlDBSettings)} does not support writing '{options.Format}' format."); + } + } + + SqlDBSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSqlDBSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SqlDBSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlDBSettings.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlDBSettings.cs new file mode 100644 index 000000000000..90e4989f93b9 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlDBSettings.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// SQL database assessment settings. + public partial class SqlDBSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public SqlDBSettings() + { + } + + /// Initializes a new instance of . + /// Gets or sets the azure SQL service tier. + /// Gets or sets the azure PAAS SQL instance type. + /// Gets or sets the azure SQL compute tier. + /// Gets or sets the azure SQL purchase model. + /// Keeps track of any properties unknown to the library. + internal SqlDBSettings(AzureSqlServiceTier? azureSqlServiceTier, AzureSqlDataBaseType? azureSqlDataBaseType, MigrationAssessmentComputeTier? azureSqlComputeTier, AzureSqlPurchaseModel? azureSqlPurchaseModel, IDictionary serializedAdditionalRawData) + { + AzureSqlServiceTier = azureSqlServiceTier; + AzureSqlDataBaseType = azureSqlDataBaseType; + AzureSqlComputeTier = azureSqlComputeTier; + AzureSqlPurchaseModel = azureSqlPurchaseModel; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the azure SQL service tier. + public AzureSqlServiceTier? AzureSqlServiceTier { get; set; } + /// Gets or sets the azure PAAS SQL instance type. + public AzureSqlDataBaseType? AzureSqlDataBaseType { get; set; } + /// Gets or sets the azure SQL compute tier. + public MigrationAssessmentComputeTier? AzureSqlComputeTier { get; set; } + /// Gets or sets the azure SQL purchase model. + public AzureSqlPurchaseModel? AzureSqlPurchaseModel { get; set; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlFciMetadata.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlFciMetadata.Serialization.cs new file mode 100644 index 000000000000..0b41d34a0829 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlFciMetadata.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class SqlFciMetadata : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlFciMetadata)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } + if (Optional.IsDefined(IsMultiSubnet)) + { + writer.WritePropertyName("isMultiSubnet"u8); + writer.WriteBooleanValue(IsMultiSubnet.Value); + } + if (Optional.IsDefined(FciSharedDiskCount)) + { + writer.WritePropertyName("fciSharedDiskCount"u8); + writer.WriteNumberValue(FciSharedDiskCount.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SqlFciMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlFciMetadata)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSqlFciMetadata(document.RootElement, options); + } + + internal static SqlFciMetadata DeserializeSqlFciMetadata(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SqlFciMetadataState? state = default; + bool? isMultiSubnet = default; + int? fciSharedDiskCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new SqlFciMetadataState(property.Value.GetString()); + continue; + } + if (property.NameEquals("isMultiSubnet"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isMultiSubnet = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("fciSharedDiskCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fciSharedDiskCount = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SqlFciMetadata(state, isMultiSubnet, fciSharedDiskCount, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SqlFciMetadata)} does not support writing '{options.Format}' format."); + } + } + + SqlFciMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSqlFciMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SqlFciMetadata)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlFciMetadata.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlFciMetadata.cs new file mode 100644 index 000000000000..274b254490e6 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlFciMetadata.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Sql fci meta data. + public partial class SqlFciMetadata + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SqlFciMetadata() + { + } + + /// Initializes a new instance of . + /// Gets the Sql fci meta data state. + /// Gets whether fci is multi subnet. + /// Gets the fci shared disk count. + /// Keeps track of any properties unknown to the library. + internal SqlFciMetadata(SqlFciMetadataState? state, bool? isMultiSubnet, int? fciSharedDiskCount, IDictionary serializedAdditionalRawData) + { + State = state; + IsMultiSubnet = isMultiSubnet; + FciSharedDiskCount = fciSharedDiskCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the Sql fci meta data state. + public SqlFciMetadataState? State { get; } + /// Gets whether fci is multi subnet. + public bool? IsMultiSubnet { get; } + /// Gets the fci shared disk count. + public int? FciSharedDiskCount { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlFciMetadataState.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlFciMetadataState.cs new file mode 100644 index 000000000000..e33339354c9b --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlFciMetadataState.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The SqlFciMetadataState. + public readonly partial struct SqlFciMetadataState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SqlFciMetadataState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string InheritedValue = "Inherited"; + private const string InitializingValue = "Initializing"; + private const string OnlineValue = "Online"; + private const string OfflineValue = "Offline"; + private const string FailedValue = "Failed"; + private const string PendingValue = "Pending"; + private const string OnlinePendingValue = "OnlinePending"; + private const string OfflinePendingValue = "OfflinePending"; + + /// Unknown. + public static SqlFciMetadataState Unknown { get; } = new SqlFciMetadataState(UnknownValue); + /// Inherited. + public static SqlFciMetadataState Inherited { get; } = new SqlFciMetadataState(InheritedValue); + /// Initializing. + public static SqlFciMetadataState Initializing { get; } = new SqlFciMetadataState(InitializingValue); + /// Online. + public static SqlFciMetadataState Online { get; } = new SqlFciMetadataState(OnlineValue); + /// Offline. + public static SqlFciMetadataState Offline { get; } = new SqlFciMetadataState(OfflineValue); + /// Failed. + public static SqlFciMetadataState Failed { get; } = new SqlFciMetadataState(FailedValue); + /// Pending. + public static SqlFciMetadataState Pending { get; } = new SqlFciMetadataState(PendingValue); + /// OnlinePending. + public static SqlFciMetadataState OnlinePending { get; } = new SqlFciMetadataState(OnlinePendingValue); + /// OfflinePending. + public static SqlFciMetadataState OfflinePending { get; } = new SqlFciMetadataState(OfflinePendingValue); + /// Determines if two values are the same. + public static bool operator ==(SqlFciMetadataState left, SqlFciMetadataState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SqlFciMetadataState left, SqlFciMetadataState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SqlFciMetadataState(string value) => new SqlFciMetadataState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SqlFciMetadataState other && Equals(other); + /// + public bool Equals(SqlFciMetadataState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlFciState.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlFciState.cs new file mode 100644 index 000000000000..3384116f1477 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlFciState.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The SqlFciState. + public readonly partial struct SqlFciState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SqlFciState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string ActiveValue = "Active"; + private const string PassiveValue = "Passive"; + private const string NotApplicableValue = "NotApplicable"; + + /// Unknown. + public static SqlFciState Unknown { get; } = new SqlFciState(UnknownValue); + /// Active. + public static SqlFciState Active { get; } = new SqlFciState(ActiveValue); + /// Passive. + public static SqlFciState Passive { get; } = new SqlFciState(PassiveValue); + /// NotApplicable. + public static SqlFciState NotApplicable { get; } = new SqlFciState(NotApplicableValue); + /// Determines if two values are the same. + public static bool operator ==(SqlFciState left, SqlFciState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SqlFciState left, SqlFciState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SqlFciState(string value) => new SqlFciState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SqlFciState other && Equals(other); + /// + public bool Equals(SqlFciState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlMISettings.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlMISettings.Serialization.cs new file mode 100644 index 000000000000..8551062c225d --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlMISettings.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class SqlMISettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlMISettings)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AzureSqlServiceTier)) + { + writer.WritePropertyName("azureSqlServiceTier"u8); + writer.WriteStringValue(AzureSqlServiceTier.Value.ToString()); + } + if (Optional.IsDefined(AzureSqlInstanceType)) + { + writer.WritePropertyName("azureSqlInstanceType"u8); + writer.WriteStringValue(AzureSqlInstanceType.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SqlMISettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlMISettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSqlMISettings(document.RootElement, options); + } + + internal static SqlMISettings DeserializeSqlMISettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureSqlServiceTier? azureSqlServiceTier = default; + AzureSqlInstanceType? azureSqlInstanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azureSqlServiceTier"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSqlServiceTier = new AzureSqlServiceTier(property.Value.GetString()); + continue; + } + if (property.NameEquals("azureSqlInstanceType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureSqlInstanceType = new AzureSqlInstanceType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SqlMISettings(azureSqlServiceTier, azureSqlInstanceType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SqlMISettings)} does not support writing '{options.Format}' format."); + } + } + + SqlMISettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSqlMISettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SqlMISettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlMISettings.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlMISettings.cs new file mode 100644 index 000000000000..0481b9f121ab --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlMISettings.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// SQL managed instance assessment settings. + public partial class SqlMISettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public SqlMISettings() + { + } + + /// Initializes a new instance of . + /// Gets or sets the azure SQL service tier. + /// Gets or sets the azure PAAS SQL instance type. + /// Keeps track of any properties unknown to the library. + internal SqlMISettings(AzureSqlServiceTier? azureSqlServiceTier, AzureSqlInstanceType? azureSqlInstanceType, IDictionary serializedAdditionalRawData) + { + AzureSqlServiceTier = azureSqlServiceTier; + AzureSqlInstanceType = azureSqlInstanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the azure SQL service tier. + public AzureSqlServiceTier? AzureSqlServiceTier { get; set; } + /// Gets or sets the azure PAAS SQL instance type. + public AzureSqlInstanceType? AzureSqlInstanceType { get; set; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlMigrationGuideline.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlMigrationGuideline.Serialization.cs new file mode 100644 index 000000000000..2c78f6e4696a --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlMigrationGuideline.Serialization.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class SqlMigrationGuideline : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlMigrationGuideline)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(GuidelineId)) + { + writer.WritePropertyName("guidelineId"u8); + writer.WriteStringValue(GuidelineId); + } + if (Optional.IsDefined(MigrationGuidelineCategory)) + { + writer.WritePropertyName("migrationGuidelineCategory"u8); + writer.WriteStringValue(MigrationGuidelineCategory.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(MigrationGuidelineContext)) + { + writer.WritePropertyName("migrationGuidelineContext"u8); + writer.WriteStartArray(); + foreach (var item in MigrationGuidelineContext) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SqlMigrationGuideline IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlMigrationGuideline)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSqlMigrationGuideline(document.RootElement, options); + } + + internal static SqlMigrationGuideline DeserializeSqlMigrationGuideline(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string guidelineId = default; + SqlMigrationGuidelineCategory? migrationGuidelineCategory = default; + IReadOnlyList migrationGuidelineContext = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("guidelineId"u8)) + { + guidelineId = property.Value.GetString(); + continue; + } + if (property.NameEquals("migrationGuidelineCategory"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + migrationGuidelineCategory = new SqlMigrationGuidelineCategory(property.Value.GetString()); + continue; + } + if (property.NameEquals("migrationGuidelineContext"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.MigrationGuidelineContext.DeserializeMigrationGuidelineContext(item, options)); + } + migrationGuidelineContext = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SqlMigrationGuideline(guidelineId, migrationGuidelineCategory, migrationGuidelineContext ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SqlMigrationGuideline)} does not support writing '{options.Format}' format."); + } + } + + SqlMigrationGuideline IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSqlMigrationGuideline(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SqlMigrationGuideline)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlMigrationGuideline.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlMigrationGuideline.cs new file mode 100644 index 000000000000..d235a56412d6 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlMigrationGuideline.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Sql Migration Guideline. + public partial class SqlMigrationGuideline + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SqlMigrationGuideline() + { + MigrationGuidelineContext = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets the guideline id. + /// Gets the migration guideline category. + /// Gets the migration guideline context. + /// Keeps track of any properties unknown to the library. + internal SqlMigrationGuideline(string guidelineId, SqlMigrationGuidelineCategory? migrationGuidelineCategory, IReadOnlyList migrationGuidelineContext, IDictionary serializedAdditionalRawData) + { + GuidelineId = guidelineId; + MigrationGuidelineCategory = migrationGuidelineCategory; + MigrationGuidelineContext = migrationGuidelineContext; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the guideline id. + public string GuidelineId { get; } + /// Gets the migration guideline category. + public SqlMigrationGuidelineCategory? MigrationGuidelineCategory { get; } + /// Gets the migration guideline context. + public IReadOnlyList MigrationGuidelineContext { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlMigrationGuidelineCategory.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlMigrationGuidelineCategory.cs new file mode 100644 index 000000000000..d0a5f44b4c00 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlMigrationGuidelineCategory.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The SqlMigrationGuidelineCategory. + public readonly partial struct SqlMigrationGuidelineCategory : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SqlMigrationGuidelineCategory(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string GeneralValue = "General"; + private const string FailoverCluterInstanceGuideLineValue = "FailoverCluterInstanceGuideLine"; + private const string AvailabilityGroupGuidelineValue = "AvailabilityGroupGuideline"; + + /// Unknown. + public static SqlMigrationGuidelineCategory Unknown { get; } = new SqlMigrationGuidelineCategory(UnknownValue); + /// General. + public static SqlMigrationGuidelineCategory General { get; } = new SqlMigrationGuidelineCategory(GeneralValue); + /// FailoverCluterInstanceGuideLine. + public static SqlMigrationGuidelineCategory FailoverCluterInstanceGuideLine { get; } = new SqlMigrationGuidelineCategory(FailoverCluterInstanceGuideLineValue); + /// AvailabilityGroupGuideline. + public static SqlMigrationGuidelineCategory AvailabilityGroupGuideline { get; } = new SqlMigrationGuidelineCategory(AvailabilityGroupGuidelineValue); + /// Determines if two values are the same. + public static bool operator ==(SqlMigrationGuidelineCategory left, SqlMigrationGuidelineCategory right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SqlMigrationGuidelineCategory left, SqlMigrationGuidelineCategory right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SqlMigrationGuidelineCategory(string value) => new SqlMigrationGuidelineCategory(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SqlMigrationGuidelineCategory other && Equals(other); + /// + public bool Equals(SqlMigrationGuidelineCategory other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlOptimizationLogic.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlOptimizationLogic.cs new file mode 100644 index 000000000000..d268bee5ee3a --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlOptimizationLogic.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The SqlOptimizationLogic. + public readonly partial struct SqlOptimizationLogic : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SqlOptimizationLogic(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MinimizeCostValue = "MinimizeCost"; + private const string ModernizeToPaaSValue = "ModernizeToPaaS"; + private const string ModernizeToAzureSqlMIValue = "ModernizeToAzureSqlMi"; + private const string ModernizeToAzureSqlDBValue = "ModernizeToAzureSqlDb"; + + /// MinimizeCost. + public static SqlOptimizationLogic MinimizeCost { get; } = new SqlOptimizationLogic(MinimizeCostValue); + /// ModernizeToPaaS. + public static SqlOptimizationLogic ModernizeToPaaS { get; } = new SqlOptimizationLogic(ModernizeToPaaSValue); + /// ModernizeToAzureSqlMi. + public static SqlOptimizationLogic ModernizeToAzureSqlMI { get; } = new SqlOptimizationLogic(ModernizeToAzureSqlMIValue); + /// ModernizeToAzureSqlDb. + public static SqlOptimizationLogic ModernizeToAzureSqlDB { get; } = new SqlOptimizationLogic(ModernizeToAzureSqlDBValue); + /// Determines if two values are the same. + public static bool operator ==(SqlOptimizationLogic left, SqlOptimizationLogic right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SqlOptimizationLogic left, SqlOptimizationLogic right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SqlOptimizationLogic(string value) => new SqlOptimizationLogic(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SqlOptimizationLogic other && Equals(other); + /// + public bool Equals(SqlOptimizationLogic other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlPaaSTargetConfig.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlPaaSTargetConfig.Serialization.cs new file mode 100644 index 000000000000..aed590bb5adc --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlPaaSTargetConfig.Serialization.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class SqlPaaSTargetConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlPaaSTargetConfig)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ComputeTier)) + { + writer.WritePropertyName("computeTier"u8); + writer.WriteStringValue(ComputeTier.Value.ToString()); + } + if (Optional.IsDefined(HardwareGeneration)) + { + writer.WritePropertyName("hardwareGeneration"u8); + writer.WriteStringValue(HardwareGeneration.Value.ToString()); + } + if (Optional.IsDefined(TargetType)) + { + writer.WritePropertyName("targetType"u8); + writer.WriteStringValue(TargetType.Value.ToString()); + } + if (Optional.IsDefined(ServiceTier)) + { + writer.WritePropertyName("serviceTier"u8); + writer.WriteStringValue(ServiceTier.Value.ToString()); + } + if (Optional.IsCollectionDefined(TargetLocations)) + { + writer.WritePropertyName("targetLocations"u8); + writer.WriteStartArray(); + foreach (var item in TargetLocations) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SqlPaaSTargetConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlPaaSTargetConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSqlPaaSTargetConfig(document.RootElement, options); + } + + internal static SqlPaaSTargetConfig DeserializeSqlPaaSTargetConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MigrationAssessmentComputeTier? computeTier = default; + MigrationAssessmentHardwareGeneration? hardwareGeneration = default; + MigrationAssessmentTargetType? targetType = default; + AzureSqlServiceTier? serviceTier = default; + IList targetLocations = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("computeTier"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeTier = new MigrationAssessmentComputeTier(property.Value.GetString()); + continue; + } + if (property.NameEquals("hardwareGeneration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hardwareGeneration = new MigrationAssessmentHardwareGeneration(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetType = new MigrationAssessmentTargetType(property.Value.GetString()); + continue; + } + if (property.NameEquals("serviceTier"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceTier = new AzureSqlServiceTier(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetLocations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new AzureLocation(item.GetString())); + } + targetLocations = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SqlPaaSTargetConfig( + computeTier, + hardwareGeneration, + targetType, + serviceTier, + targetLocations ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SqlPaaSTargetConfig)} does not support writing '{options.Format}' format."); + } + } + + SqlPaaSTargetConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSqlPaaSTargetConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SqlPaaSTargetConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlPaaSTargetConfig.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlPaaSTargetConfig.cs new file mode 100644 index 000000000000..6d57a24c77bd --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlPaaSTargetConfig.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// SQL target options. + public partial class SqlPaaSTargetConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public SqlPaaSTargetConfig() + { + TargetLocations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets the Azure SQL compute tier. + /// Gets or sets the Azure SQL hardware generation. + /// Gets or sets the Azure SQL target type. + /// Gets or sets the Azure SQL service tier. + /// Gets or sets the target location. + /// Keeps track of any properties unknown to the library. + internal SqlPaaSTargetConfig(MigrationAssessmentComputeTier? computeTier, MigrationAssessmentHardwareGeneration? hardwareGeneration, MigrationAssessmentTargetType? targetType, AzureSqlServiceTier? serviceTier, IList targetLocations, IDictionary serializedAdditionalRawData) + { + ComputeTier = computeTier; + HardwareGeneration = hardwareGeneration; + TargetType = targetType; + ServiceTier = serviceTier; + TargetLocations = targetLocations; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the Azure SQL compute tier. + public MigrationAssessmentComputeTier? ComputeTier { get; set; } + /// Gets or sets the Azure SQL hardware generation. + public MigrationAssessmentHardwareGeneration? HardwareGeneration { get; set; } + /// Gets or sets the Azure SQL target type. + public MigrationAssessmentTargetType? TargetType { get; set; } + /// Gets or sets the Azure SQL service tier. + public AzureSqlServiceTier? ServiceTier { get; set; } + /// Gets or sets the target location. + public IList TargetLocations { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlRecommendationReasoning.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlRecommendationReasoning.Serialization.cs new file mode 100644 index 000000000000..a035674a37d1 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlRecommendationReasoning.Serialization.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class SqlRecommendationReasoning : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlRecommendationReasoning)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ReasoningId)) + { + writer.WritePropertyName("reasoningId"u8); + writer.WriteStringValue(ReasoningId); + } + if (Optional.IsDefined(ReasoningString)) + { + writer.WritePropertyName("reasoningString"u8); + writer.WriteStringValue(ReasoningString); + } + if (Optional.IsDefined(ReasoningCategory)) + { + writer.WritePropertyName("reasoningCategory"u8); + writer.WriteStringValue(ReasoningCategory); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ContextParameters)) + { + writer.WritePropertyName("contextParameters"u8); + writer.WriteStartArray(); + foreach (var item in ContextParameters) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SqlRecommendationReasoning IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlRecommendationReasoning)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSqlRecommendationReasoning(document.RootElement, options); + } + + internal static SqlRecommendationReasoning DeserializeSqlRecommendationReasoning(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string reasoningId = default; + string reasoningString = default; + string reasoningCategory = default; + IReadOnlyList contextParameters = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("reasoningId"u8)) + { + reasoningId = property.Value.GetString(); + continue; + } + if (property.NameEquals("reasoningString"u8)) + { + reasoningString = property.Value.GetString(); + continue; + } + if (property.NameEquals("reasoningCategory"u8)) + { + reasoningCategory = property.Value.GetString(); + continue; + } + if (property.NameEquals("contextParameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SqlRecommendationReasoningContext.DeserializeSqlRecommendationReasoningContext(item, options)); + } + contextParameters = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SqlRecommendationReasoning(reasoningId, reasoningString, reasoningCategory, contextParameters ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SqlRecommendationReasoning)} does not support writing '{options.Format}' format."); + } + } + + SqlRecommendationReasoning IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSqlRecommendationReasoning(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SqlRecommendationReasoning)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlRecommendationReasoning.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlRecommendationReasoning.cs new file mode 100644 index 000000000000..b9c032cfa475 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlRecommendationReasoning.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Class representing Azure SQL Recommendation Reasoning. + public partial class SqlRecommendationReasoning + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SqlRecommendationReasoning() + { + ContextParameters = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets the reasoning id. + /// Gets the reasoning status. + /// Gets the reasoning category. + /// Gets the Sql recommended reasoning parameters. + /// Keeps track of any properties unknown to the library. + internal SqlRecommendationReasoning(string reasoningId, string reasoningString, string reasoningCategory, IReadOnlyList contextParameters, IDictionary serializedAdditionalRawData) + { + ReasoningId = reasoningId; + ReasoningString = reasoningString; + ReasoningCategory = reasoningCategory; + ContextParameters = contextParameters; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the reasoning id. + public string ReasoningId { get; } + /// Gets the reasoning status. + public string ReasoningString { get; } + /// Gets the reasoning category. + public string ReasoningCategory { get; } + /// Gets the Sql recommended reasoning parameters. + public IReadOnlyList ContextParameters { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlRecommendationReasoningContext.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlRecommendationReasoningContext.Serialization.cs new file mode 100644 index 000000000000..7d5c72d9bcde --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlRecommendationReasoningContext.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class SqlRecommendationReasoningContext : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlRecommendationReasoningContext)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ContextKey)) + { + writer.WritePropertyName("contextKey"u8); + writer.WriteStringValue(ContextKey); + } + if (Optional.IsDefined(ContextValue)) + { + writer.WritePropertyName("contextValue"u8); + writer.WriteStringValue(ContextValue); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SqlRecommendationReasoningContext IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlRecommendationReasoningContext)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSqlRecommendationReasoningContext(document.RootElement, options); + } + + internal static SqlRecommendationReasoningContext DeserializeSqlRecommendationReasoningContext(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string contextKey = default; + string contextValue = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("contextKey"u8)) + { + contextKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("contextValue"u8)) + { + contextValue = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SqlRecommendationReasoningContext(contextKey, contextValue, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SqlRecommendationReasoningContext)} does not support writing '{options.Format}' format."); + } + } + + SqlRecommendationReasoningContext IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSqlRecommendationReasoningContext(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SqlRecommendationReasoningContext)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlRecommendationReasoningContext.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlRecommendationReasoningContext.cs new file mode 100644 index 000000000000..1ffef2b2c417 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlRecommendationReasoningContext.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Class representing Azure SQL Recommendation Reasoning Context. + public partial class SqlRecommendationReasoningContext + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SqlRecommendationReasoningContext() + { + } + + /// Initializes a new instance of . + /// Gets the reasoning context key. + /// Gets the reasoning context value. + /// Keeps track of any properties unknown to the library. + internal SqlRecommendationReasoningContext(string contextKey, string contextValue, IDictionary serializedAdditionalRawData) + { + ContextKey = contextKey; + ContextValue = contextValue; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the reasoning context key. + public string ContextKey { get; } + /// Gets the reasoning context value. + public string ContextValue { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlServerLicense.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlServerLicense.cs new file mode 100644 index 000000000000..eeea75fa8741 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlServerLicense.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The SqlServerLicense. + public readonly partial struct SqlServerLicense : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SqlServerLicense(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string YesValue = "Yes"; + private const string NoValue = "No"; + + /// Unknown. + public static SqlServerLicense Unknown { get; } = new SqlServerLicense(UnknownValue); + /// Yes. + public static SqlServerLicense Yes { get; } = new SqlServerLicense(YesValue); + /// No. + public static SqlServerLicense No { get; } = new SqlServerLicense(NoValue); + /// Determines if two values are the same. + public static bool operator ==(SqlServerLicense left, SqlServerLicense right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SqlServerLicense left, SqlServerLicense right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SqlServerLicense(string value) => new SqlServerLicense(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SqlServerLicense other && Equals(other); + /// + public bool Equals(SqlServerLicense other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlVmSettings.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlVmSettings.Serialization.cs new file mode 100644 index 000000000000..0f6096ac1097 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlVmSettings.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class SqlVmSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlVmSettings)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(InstanceSeries)) + { + writer.WritePropertyName("instanceSeries"u8); + writer.WriteStartArray(); + foreach (var item in InstanceSeries) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SqlVmSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlVmSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSqlVmSettings(document.RootElement, options); + } + + internal static SqlVmSettings DeserializeSqlVmSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList instanceSeries = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceSeries"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new AzureVmFamily(item.GetString())); + } + instanceSeries = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SqlVmSettings(instanceSeries ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SqlVmSettings)} does not support writing '{options.Format}' format."); + } + } + + SqlVmSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSqlVmSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SqlVmSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlVmSettings.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlVmSettings.cs new file mode 100644 index 000000000000..0db13234b9b2 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/SqlVmSettings.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// SQL VM assessment settings. + internal partial class SqlVmSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public SqlVmSettings() + { + InstanceSeries = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// Gets or sets the Azure VM families (calling instance series to keep it + /// consistent with other targets). + /// + /// Keeps track of any properties unknown to the library. + internal SqlVmSettings(IList instanceSeries, IDictionary serializedAdditionalRawData) + { + InstanceSeries = instanceSeries; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Gets or sets the Azure VM families (calling instance series to keep it + /// consistent with other targets). + /// + public IList InstanceSeries { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/UltraDiskAssessmentConfig.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/UltraDiskAssessmentConfig.Serialization.cs new file mode 100644 index 000000000000..0881c2458ae8 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/UltraDiskAssessmentConfig.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class UltraDiskAssessmentConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UltraDiskAssessmentConfig)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(FamilyName)) + { + writer.WritePropertyName("familyName"u8); + writer.WriteStringValue(FamilyName); + } + if (Optional.IsCollectionDefined(TargetLocations)) + { + writer.WritePropertyName("targetLocations"u8); + writer.WriteStartArray(); + foreach (var item in TargetLocations) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UltraDiskAssessmentConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UltraDiskAssessmentConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUltraDiskAssessmentConfig(document.RootElement, options); + } + + internal static UltraDiskAssessmentConfig DeserializeUltraDiskAssessmentConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string familyName = default; + IReadOnlyList targetLocations = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("familyName"u8)) + { + familyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetLocations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + targetLocations = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UltraDiskAssessmentConfig(familyName, targetLocations ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UltraDiskAssessmentConfig)} does not support writing '{options.Format}' format."); + } + } + + UltraDiskAssessmentConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeUltraDiskAssessmentConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UltraDiskAssessmentConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/UltraDiskAssessmentConfig.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/UltraDiskAssessmentConfig.cs new file mode 100644 index 000000000000..4cdc1bf46231 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/UltraDiskAssessmentConfig.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Assessment options for Ultra disk type. + public partial class UltraDiskAssessmentConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal UltraDiskAssessmentConfig() + { + TargetLocations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Family name. + /// List of locations where ultra disk is supported for this VMfamily. + /// Keeps track of any properties unknown to the library. + internal UltraDiskAssessmentConfig(string familyName, IReadOnlyList targetLocations, IDictionary serializedAdditionalRawData) + { + FamilyName = familyName; + TargetLocations = targetLocations; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Family name. + public string FamilyName { get; } + /// List of locations where ultra disk is supported for this VMfamily. + public IReadOnlyList TargetLocations { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/VMwareCollectorListResult.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/VMwareCollectorListResult.Serialization.cs new file mode 100644 index 000000000000..be8c7e79b245 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/VMwareCollectorListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + internal partial class VMwareCollectorListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareCollectorListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VMwareCollectorListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareCollectorListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareCollectorListResult(document.RootElement, options); + } + + internal static VMwareCollectorListResult DeserializeVMwareCollectorListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MigrationAssessmentVMwareCollectorData.DeserializeMigrationAssessmentVMwareCollectorData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareCollectorListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VMwareCollectorListResult)} does not support writing '{options.Format}' format."); + } + } + + VMwareCollectorListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVMwareCollectorListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareCollectorListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/VMwareCollectorListResult.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/VMwareCollectorListResult.cs new file mode 100644 index 000000000000..2045d485f3ec --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/VMwareCollectorListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// The response of a VmwareCollector list operation. + internal partial class VMwareCollectorListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The VmwareCollector items on this page. + /// is null. + internal VMwareCollectorListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The VmwareCollector items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal VMwareCollectorListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VMwareCollectorListResult() + { + } + + /// The VmwareCollector items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/VmFamilyConfig.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/VmFamilyConfig.Serialization.cs new file mode 100644 index 000000000000..113bbc47c4e9 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/VmFamilyConfig.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class VmFamilyConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VmFamilyConfig)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(FamilyName)) + { + writer.WritePropertyName("familyName"u8); + writer.WriteStringValue(FamilyName); + } + if (options.Format != "W" && Optional.IsCollectionDefined(TargetLocations)) + { + writer.WritePropertyName("targetLocations"u8); + writer.WriteStartArray(); + foreach (var item in TargetLocations) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStartArray(); + foreach (var item in Category) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VmFamilyConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VmFamilyConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVmFamilyConfig(document.RootElement, options); + } + + internal static VmFamilyConfig DeserializeVmFamilyConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string familyName = default; + IReadOnlyList targetLocations = default; + IReadOnlyList category = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("familyName"u8)) + { + familyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetLocations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + targetLocations = array; + continue; + } + if (property.NameEquals("category"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + category = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VmFamilyConfig(familyName, targetLocations ?? new ChangeTrackingList(), category ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VmFamilyConfig)} does not support writing '{options.Format}' format."); + } + } + + VmFamilyConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVmFamilyConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VmFamilyConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/VmFamilyConfig.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/VmFamilyConfig.cs new file mode 100644 index 000000000000..e37b43ae398f --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/VmFamilyConfig.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// + /// VM family name, the list of targeted azure locations and the category of the + /// family. + /// + public partial class VmFamilyConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal VmFamilyConfig() + { + TargetLocations = new ChangeTrackingList(); + Category = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Name of the VM family. + /// List of Azure regions. + /// Category of the VM family. + /// Keeps track of any properties unknown to the library. + internal VmFamilyConfig(string familyName, IReadOnlyList targetLocations, IReadOnlyList category, IDictionary serializedAdditionalRawData) + { + FamilyName = familyName; + TargetLocations = targetLocations; + Category = category; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Name of the VM family. + public string FamilyName { get; } + /// List of Azure regions. + public IReadOnlyList TargetLocations { get; } + /// Category of the VM family. + public IReadOnlyList Category { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/VmUptime.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/VmUptime.Serialization.cs new file mode 100644 index 000000000000..fab6af1617b5 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/VmUptime.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class VmUptime : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VmUptime)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DaysPerMonth)) + { + writer.WritePropertyName("daysPerMonth"u8); + writer.WriteNumberValue(DaysPerMonth.Value); + } + if (Optional.IsDefined(HoursPerDay)) + { + writer.WritePropertyName("hoursPerDay"u8); + writer.WriteNumberValue(HoursPerDay.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VmUptime IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VmUptime)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVmUptime(document.RootElement, options); + } + + internal static VmUptime DeserializeVmUptime(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? daysPerMonth = default; + int? hoursPerDay = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("daysPerMonth"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + daysPerMonth = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("hoursPerDay"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hoursPerDay = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VmUptime(daysPerMonth, hoursPerDay, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VmUptime)} does not support writing '{options.Format}' format."); + } + } + + VmUptime IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVmUptime(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VmUptime)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/VmUptime.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/VmUptime.cs new file mode 100644 index 000000000000..c6836fd45a39 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/VmUptime.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Details on the total up-time for the VM. + public partial class VmUptime + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public VmUptime() + { + } + + /// Initializes a new instance of . + /// Number of days in a month for VM uptime. + /// Number of hours per day for VM uptime. + /// Keeps track of any properties unknown to the library. + internal VmUptime(int? daysPerMonth, int? hoursPerDay, IDictionary serializedAdditionalRawData) + { + DaysPerMonth = daysPerMonth; + HoursPerDay = hoursPerDay; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Number of days in a month for VM uptime. + public int? DaysPerMonth { get; set; } + /// Number of hours per day for VM uptime. + public int? HoursPerDay { get; set; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/WorkloadSummary.Serialization.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/WorkloadSummary.Serialization.cs new file mode 100644 index 000000000000..4afc9bd8a4ce --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/WorkloadSummary.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + public partial class WorkloadSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WorkloadSummary)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(OracleInstances)) + { + writer.WritePropertyName("oracleInstances"u8); + writer.WriteNumberValue(OracleInstances.Value); + } + if (Optional.IsDefined(SpringApps)) + { + writer.WritePropertyName("springApps"u8); + writer.WriteNumberValue(SpringApps.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + WorkloadSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WorkloadSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWorkloadSummary(document.RootElement, options); + } + + internal static WorkloadSummary DeserializeWorkloadSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? oracleInstances = default; + int? springApps = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("oracleInstances"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + oracleInstances = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("springApps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + springApps = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WorkloadSummary(oracleInstances, springApps, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WorkloadSummary)} does not support writing '{options.Format}' format."); + } + } + + WorkloadSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWorkloadSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WorkloadSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/WorkloadSummary.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/WorkloadSummary.cs new file mode 100644 index 000000000000..500ea64a3f7b --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/Models/WorkloadSummary.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migration.Assessment.Models +{ + /// Workload summary. + public partial class WorkloadSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal WorkloadSummary() + { + } + + /// Initializes a new instance of . + /// Gets or sets oracle databases. + /// Gets or sets oracle databases. + /// Keeps track of any properties unknown to the library. + internal WorkloadSummary(int? oracleInstances, int? springApps, IDictionary serializedAdditionalRawData) + { + OracleInstances = oracleInstances; + SpringApps = springApps; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets oracle databases. + public int? OracleInstances { get; } + /// Gets or sets oracle databases. + public int? SpringApps { get; } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/ProviderConstants.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..c1b38c9a8126 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/ProviderConstants.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessedMachinesRestOperations.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessedMachinesRestOperations.cs new file mode 100644 index 000000000000..4567a8f238a1 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessedMachinesRestOperations.cs @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal partial class AssessedMachinesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AssessedMachinesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public AssessedMachinesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByAssessmentRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/assessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/assessedMachines", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (totalRecordCount != null) + { + uri.AppendQuery("totalRecordCount", totalRecordCount.Value, true); + } + return uri; + } + + internal HttpMessage CreateListByAssessmentRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/assessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/assessedMachines", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (totalRecordCount != null) + { + uri.AppendQuery("totalRecordCount", totalRecordCount.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AssessedMachine resources by Assessment. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// Machine Assessment ARM name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListByAssessmentRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, continuationToken, totalRecordCount); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessedMachineListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessedMachineListResult.DeserializeAssessedMachineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AssessedMachine resources by Assessment. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// Machine Assessment ARM name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListByAssessment(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListByAssessmentRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, continuationToken, totalRecordCount); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessedMachineListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessedMachineListResult.DeserializeAssessedMachineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedMachineName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/assessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/assessedMachines/", false); + uri.AppendPath(assessedMachineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedMachineName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/assessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/assessedMachines/", false); + uri.AppendPath(assessedMachineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a AssessedMachine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// Machine Assessment ARM name. + /// Machine assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedMachineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNullOrEmpty(assessedMachineName, nameof(assessedMachineName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, assessedMachineName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessedMachineData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessedMachineData.DeserializeAssessedMachineData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AssessedMachineData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a AssessedMachine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// Machine Assessment ARM name. + /// Machine assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedMachineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNullOrEmpty(assessedMachineName, nameof(assessedMachineName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, assessedMachineName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessedMachineData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessedMachineData.DeserializeAssessedMachineData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AssessedMachineData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByAssessmentNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByAssessmentNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AssessedMachine resources by Assessment. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// Machine Assessment ARM name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListByAssessmentNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, continuationToken, totalRecordCount); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessedMachineListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessedMachineListResult.DeserializeAssessedMachineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AssessedMachine resources by Assessment. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// Machine Assessment ARM name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentNextPage(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListByAssessmentNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, continuationToken, totalRecordCount); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessedMachineListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessedMachineListResult.DeserializeAssessedMachineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessedSqlDatabaseV2RestOperations.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessedSqlDatabaseV2RestOperations.cs new file mode 100644 index 000000000000..5fcaca3f239e --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessedSqlDatabaseV2RestOperations.cs @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal partial class AssessedSqlDatabaseV2RestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AssessedSqlDatabaseV2RestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public AssessedSqlDatabaseV2RestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListBySqlAssessmentV2RequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/assessedSqlDatabases", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (totalRecordCount != null) + { + uri.AppendQuery("totalRecordCount", totalRecordCount.Value, true); + } + return uri; + } + + internal HttpMessage CreateListBySqlAssessmentV2Request(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/assessedSqlDatabases", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (totalRecordCount != null) + { + uri.AppendQuery("totalRecordCount", totalRecordCount.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AssessedSqlDatabaseV2 resources by SqlAssessmentV2. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListBySqlAssessmentV2Async(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListBySqlAssessmentV2Request(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, continuationToken, totalRecordCount); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessedSqlDatabaseV2ListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessedSqlDatabaseV2ListResult.DeserializeAssessedSqlDatabaseV2ListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AssessedSqlDatabaseV2 resources by SqlAssessmentV2. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListBySqlAssessmentV2(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListBySqlAssessmentV2Request(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, continuationToken, totalRecordCount); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessedSqlDatabaseV2ListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessedSqlDatabaseV2ListResult.DeserializeAssessedSqlDatabaseV2ListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedSqlDatabaseName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/assessedSqlDatabases/", false); + uri.AppendPath(assessedSqlDatabaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedSqlDatabaseName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/assessedSqlDatabases/", false); + uri.AppendPath(assessedSqlDatabaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a AssessedSqlDatabaseV2. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Sql assessment Assessed Databases ARM name. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedSqlDatabaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNullOrEmpty(assessedSqlDatabaseName, nameof(assessedSqlDatabaseName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, assessedSqlDatabaseName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessedSqlDatabaseV2Data value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessedSqlDatabaseV2Data.DeserializeAssessedSqlDatabaseV2Data(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AssessedSqlDatabaseV2Data)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a AssessedSqlDatabaseV2. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Sql assessment Assessed Databases ARM name. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedSqlDatabaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNullOrEmpty(assessedSqlDatabaseName, nameof(assessedSqlDatabaseName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, assessedSqlDatabaseName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessedSqlDatabaseV2Data value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessedSqlDatabaseV2Data.DeserializeAssessedSqlDatabaseV2Data(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AssessedSqlDatabaseV2Data)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySqlAssessmentV2NextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySqlAssessmentV2NextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AssessedSqlDatabaseV2 resources by SqlAssessmentV2. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListBySqlAssessmentV2NextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListBySqlAssessmentV2NextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, continuationToken, totalRecordCount); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessedSqlDatabaseV2ListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessedSqlDatabaseV2ListResult.DeserializeAssessedSqlDatabaseV2ListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AssessedSqlDatabaseV2 resources by SqlAssessmentV2. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListBySqlAssessmentV2NextPage(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListBySqlAssessmentV2NextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, continuationToken, totalRecordCount); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessedSqlDatabaseV2ListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessedSqlDatabaseV2ListResult.DeserializeAssessedSqlDatabaseV2ListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessedSqlInstanceV2RestOperations.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessedSqlInstanceV2RestOperations.cs new file mode 100644 index 000000000000..59a7dc8517fe --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessedSqlInstanceV2RestOperations.cs @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal partial class AssessedSqlInstanceV2RestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AssessedSqlInstanceV2RestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public AssessedSqlInstanceV2RestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListBySqlAssessmentV2RequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/assessedSqlInstances", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (totalRecordCount != null) + { + uri.AppendQuery("totalRecordCount", totalRecordCount.Value, true); + } + return uri; + } + + internal HttpMessage CreateListBySqlAssessmentV2Request(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/assessedSqlInstances", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (totalRecordCount != null) + { + uri.AppendQuery("totalRecordCount", totalRecordCount.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AssessedSqlInstanceV2 resources by SqlAssessmentV2. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListBySqlAssessmentV2Async(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListBySqlAssessmentV2Request(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, continuationToken, totalRecordCount); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessedSqlInstanceV2ListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessedSqlInstanceV2ListResult.DeserializeAssessedSqlInstanceV2ListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AssessedSqlInstanceV2 resources by SqlAssessmentV2. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListBySqlAssessmentV2(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListBySqlAssessmentV2Request(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, continuationToken, totalRecordCount); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessedSqlInstanceV2ListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessedSqlInstanceV2ListResult.DeserializeAssessedSqlInstanceV2ListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedSqlInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/assessedSqlInstances/", false); + uri.AppendPath(assessedSqlInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedSqlInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/assessedSqlInstances/", false); + uri.AppendPath(assessedSqlInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a AssessedSqlInstanceV2. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Sql assessment Assessed Instance ARM name. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedSqlInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNullOrEmpty(assessedSqlInstanceName, nameof(assessedSqlInstanceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, assessedSqlInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessedSqlInstanceV2Data value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessedSqlInstanceV2Data.DeserializeAssessedSqlInstanceV2Data(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AssessedSqlInstanceV2Data)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a AssessedSqlInstanceV2. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Sql assessment Assessed Instance ARM name. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedSqlInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNullOrEmpty(assessedSqlInstanceName, nameof(assessedSqlInstanceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, assessedSqlInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessedSqlInstanceV2Data value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessedSqlInstanceV2Data.DeserializeAssessedSqlInstanceV2Data(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AssessedSqlInstanceV2Data)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySqlAssessmentV2NextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySqlAssessmentV2NextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AssessedSqlInstanceV2 resources by SqlAssessmentV2. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListBySqlAssessmentV2NextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListBySqlAssessmentV2NextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, continuationToken, totalRecordCount); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessedSqlInstanceV2ListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessedSqlInstanceV2ListResult.DeserializeAssessedSqlInstanceV2ListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AssessedSqlInstanceV2 resources by SqlAssessmentV2. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListBySqlAssessmentV2NextPage(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListBySqlAssessmentV2NextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, continuationToken, totalRecordCount); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessedSqlInstanceV2ListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessedSqlInstanceV2ListResult.DeserializeAssessedSqlInstanceV2ListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessedSqlMachinesRestOperations.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessedSqlMachinesRestOperations.cs new file mode 100644 index 000000000000..f33b82aa6e73 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessedSqlMachinesRestOperations.cs @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal partial class AssessedSqlMachinesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AssessedSqlMachinesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public AssessedSqlMachinesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListBySqlAssessmentV2RequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/assessedSqlMachines", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (totalRecordCount != null) + { + uri.AppendQuery("totalRecordCount", totalRecordCount.Value, true); + } + return uri; + } + + internal HttpMessage CreateListBySqlAssessmentV2Request(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/assessedSqlMachines", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (totalRecordCount != null) + { + uri.AppendQuery("totalRecordCount", totalRecordCount.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AssessedSqlMachine resources by SqlAssessmentV2. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListBySqlAssessmentV2Async(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListBySqlAssessmentV2Request(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, continuationToken, totalRecordCount); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessedSqlMachineListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessedSqlMachineListResult.DeserializeAssessedSqlMachineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AssessedSqlMachine resources by SqlAssessmentV2. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListBySqlAssessmentV2(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListBySqlAssessmentV2Request(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, continuationToken, totalRecordCount); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessedSqlMachineListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessedSqlMachineListResult.DeserializeAssessedSqlMachineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedSqlMachineName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/assessedSqlMachines/", false); + uri.AppendPath(assessedSqlMachineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedSqlMachineName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/assessedSqlMachines/", false); + uri.AppendPath(assessedSqlMachineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a AssessedSqlMachine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Sql assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedSqlMachineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNullOrEmpty(assessedSqlMachineName, nameof(assessedSqlMachineName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, assessedSqlMachineName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessedSqlMachineData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessedSqlMachineData.DeserializeAssessedSqlMachineData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AssessedSqlMachineData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a AssessedSqlMachine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Sql assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string assessedSqlMachineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNullOrEmpty(assessedSqlMachineName, nameof(assessedSqlMachineName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, assessedSqlMachineName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessedSqlMachineData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessedSqlMachineData.DeserializeAssessedSqlMachineData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AssessedSqlMachineData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySqlAssessmentV2NextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySqlAssessmentV2NextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AssessedSqlMachine resources by SqlAssessmentV2. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListBySqlAssessmentV2NextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListBySqlAssessmentV2NextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, continuationToken, totalRecordCount); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessedSqlMachineListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessedSqlMachineListResult.DeserializeAssessedSqlMachineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AssessedSqlMachine resources by SqlAssessmentV2. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListBySqlAssessmentV2NextPage(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListBySqlAssessmentV2NextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, continuationToken, totalRecordCount); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessedSqlMachineListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessedSqlMachineListResult.DeserializeAssessedSqlMachineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessedSqlRecommendedEntityRestOperations.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessedSqlRecommendedEntityRestOperations.cs new file mode 100644 index 000000000000..affc7b6efb62 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessedSqlRecommendedEntityRestOperations.cs @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal partial class AssessedSqlRecommendedEntityRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AssessedSqlRecommendedEntityRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public AssessedSqlRecommendedEntityRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListBySqlAssessmentV2RequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/recommendedAssessedEntities", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (totalRecordCount != null) + { + uri.AppendQuery("totalRecordCount", totalRecordCount.Value, true); + } + return uri; + } + + internal HttpMessage CreateListBySqlAssessmentV2Request(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/recommendedAssessedEntities", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (totalRecordCount != null) + { + uri.AppendQuery("totalRecordCount", totalRecordCount.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AssessedSqlRecommendedEntity resources by SqlAssessmentV2. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListBySqlAssessmentV2Async(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListBySqlAssessmentV2Request(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, continuationToken, totalRecordCount); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessedSqlRecommendedEntityListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessedSqlRecommendedEntityListResult.DeserializeAssessedSqlRecommendedEntityListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AssessedSqlRecommendedEntity resources by SqlAssessmentV2. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListBySqlAssessmentV2(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListBySqlAssessmentV2Request(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, continuationToken, totalRecordCount); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessedSqlRecommendedEntityListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessedSqlRecommendedEntityListResult.DeserializeAssessedSqlRecommendedEntityListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string recommendedAssessedEntityName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/recommendedAssessedEntities/", false); + uri.AppendPath(recommendedAssessedEntityName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string recommendedAssessedEntityName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/recommendedAssessedEntities/", false); + uri.AppendPath(recommendedAssessedEntityName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a AssessedSqlRecommendedEntity. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Sql assessment Assessed Recommended Entity ARM name. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string recommendedAssessedEntityName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNullOrEmpty(recommendedAssessedEntityName, nameof(recommendedAssessedEntityName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, recommendedAssessedEntityName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessedSqlRecommendedEntityData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessedSqlRecommendedEntityData.DeserializeAssessedSqlRecommendedEntityData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AssessedSqlRecommendedEntityData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a AssessedSqlRecommendedEntity. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Sql assessment Assessed Recommended Entity ARM name. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string recommendedAssessedEntityName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNullOrEmpty(recommendedAssessedEntityName, nameof(recommendedAssessedEntityName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, recommendedAssessedEntityName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessedSqlRecommendedEntityData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessedSqlRecommendedEntityData.DeserializeAssessedSqlRecommendedEntityData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AssessedSqlRecommendedEntityData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySqlAssessmentV2NextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySqlAssessmentV2NextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AssessedSqlRecommendedEntity resources by SqlAssessmentV2. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListBySqlAssessmentV2NextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListBySqlAssessmentV2NextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, continuationToken, totalRecordCount); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessedSqlRecommendedEntityListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessedSqlRecommendedEntityListResult.DeserializeAssessedSqlRecommendedEntityListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AssessedSqlRecommendedEntity resources by SqlAssessmentV2. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListBySqlAssessmentV2NextPage(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListBySqlAssessmentV2NextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, continuationToken, totalRecordCount); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessedSqlRecommendedEntityListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessedSqlRecommendedEntityListResult.DeserializeAssessedSqlRecommendedEntityListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessmentOptionsRestOperations.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessmentOptionsRestOperations.cs new file mode 100644 index 000000000000..8bd3b75988c6 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessmentOptionsRestOperations.cs @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal partial class AssessmentOptionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AssessmentOptionsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public AssessmentOptionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByAssessmentProjectRequestUri(string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/assessmentOptions", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectRequest(string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/assessmentOptions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AssessmentOptions resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectAsync(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessmentOptionsListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessmentOptionsListResult.DeserializeAssessmentOptionsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AssessmentOptions resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProject(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessmentOptionsListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessmentOptionsListResult.DeserializeAssessmentOptionsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string assessmentOptionsName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/assessmentOptions/", false); + uri.AppendPath(assessmentOptionsName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string assessmentOptionsName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/assessmentOptions/", false); + uri.AppendPath(assessmentOptionsName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a AssessmentOptions. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// assessment options ARM name. Accepted value is 'default'. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string assessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(assessmentOptionsName, nameof(assessmentOptionsName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, assessmentOptionsName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentAssessmentOptionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrationAssessmentAssessmentOptionData.DeserializeMigrationAssessmentAssessmentOptionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentAssessmentOptionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a AssessmentOptions. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// assessment options ARM name. Accepted value is 'default'. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string assessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(assessmentOptionsName, nameof(assessmentOptionsName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, assessmentOptionsName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentAssessmentOptionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrationAssessmentAssessmentOptionData.DeserializeMigrationAssessmentAssessmentOptionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentAssessmentOptionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByAssessmentProjectNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AssessmentOptions resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessmentOptionsListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessmentOptionsListResult.DeserializeAssessmentOptionsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AssessmentOptions resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProjectNextPage(string nextLink, string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessmentOptionsListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessmentOptionsListResult.DeserializeAssessmentOptionsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessmentProjectSummaryRestOperations.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessmentProjectSummaryRestOperations.cs new file mode 100644 index 000000000000..566801bd51ae --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessmentProjectSummaryRestOperations.cs @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal partial class AssessmentProjectSummaryRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AssessmentProjectSummaryRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public AssessmentProjectSummaryRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByAssessmentProjectRequestUri(string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/projectSummary", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectRequest(string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/projectSummary", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AssessmentProjectSummary resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectAsync(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessmentProjectSummaryListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessmentProjectSummaryListResult.DeserializeAssessmentProjectSummaryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AssessmentProjectSummary resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProject(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessmentProjectSummaryListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessmentProjectSummaryListResult.DeserializeAssessmentProjectSummaryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string projectSummaryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/projectSummary/", false); + uri.AppendPath(projectSummaryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string projectSummaryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/projectSummary/", false); + uri.AppendPath(projectSummaryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a AssessmentProjectSummary. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string projectSummaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(projectSummaryName, nameof(projectSummaryName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, projectSummaryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentAssessmentProjectSummaryData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrationAssessmentAssessmentProjectSummaryData.DeserializeMigrationAssessmentAssessmentProjectSummaryData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentAssessmentProjectSummaryData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a AssessmentProjectSummary. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string projectSummaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(projectSummaryName, nameof(projectSummaryName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, projectSummaryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentAssessmentProjectSummaryData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrationAssessmentAssessmentProjectSummaryData.DeserializeMigrationAssessmentAssessmentProjectSummaryData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentAssessmentProjectSummaryData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByAssessmentProjectNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AssessmentProjectSummary resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessmentProjectSummaryListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessmentProjectSummaryListResult.DeserializeAssessmentProjectSummaryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AssessmentProjectSummary resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProjectNextPage(string nextLink, string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessmentProjectSummaryListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessmentProjectSummaryListResult.DeserializeAssessmentProjectSummaryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessmentProjectsRestOperations.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessmentProjectsRestOperations.cs new file mode 100644 index 000000000000..05eb7b38ed36 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessmentProjectsRestOperations.cs @@ -0,0 +1,723 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal partial class AssessmentProjectsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AssessmentProjectsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public AssessmentProjectsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AssessmentProject resources by subscription ID. + /// The ID of the target subscription. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessmentProjectListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessmentProjectListResult.DeserializeAssessmentProjectListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AssessmentProject resources by subscription ID. + /// The ID of the target subscription. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessmentProjectListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessmentProjectListResult.DeserializeAssessmentProjectListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AssessmentProject resources by resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessmentProjectListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessmentProjectListResult.DeserializeAssessmentProjectListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AssessmentProject resources by resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessmentProjectListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessmentProjectListResult.DeserializeAssessmentProjectListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentAssessmentProjectData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrationAssessmentAssessmentProjectData.DeserializeMigrationAssessmentAssessmentProjectData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentAssessmentProjectData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentAssessmentProjectData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrationAssessmentAssessmentProjectData.DeserializeMigrationAssessmentAssessmentProjectData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentAssessmentProjectData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string projectName, MigrationAssessmentAssessmentProjectData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string projectName, MigrationAssessmentAssessmentProjectData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string projectName, MigrationAssessmentAssessmentProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, projectName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string projectName, MigrationAssessmentAssessmentProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, projectName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string projectName, MigrationAssessmentAssessmentProjectPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string projectName, MigrationAssessmentAssessmentProjectPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string projectName, MigrationAssessmentAssessmentProjectPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, projectName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string projectName, MigrationAssessmentAssessmentProjectPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, projectName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AssessmentProject resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessmentProjectListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessmentProjectListResult.DeserializeAssessmentProjectListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AssessmentProject resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessmentProjectListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessmentProjectListResult.DeserializeAssessmentProjectListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AssessmentProject resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessmentProjectListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessmentProjectListResult.DeserializeAssessmentProjectListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AssessmentProject resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessmentProjectListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessmentProjectListResult.DeserializeAssessmentProjectListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessmentsRestOperations.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessmentsRestOperations.cs new file mode 100644 index 000000000000..48e30c8bc77f --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AssessmentsRestOperations.cs @@ -0,0 +1,666 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal partial class AssessmentsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AssessmentsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public AssessmentsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByGroupRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/assessments", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByGroupRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/assessments", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Assessment resources by Group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByGroupAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var message = CreateListByGroupRequest(subscriptionId, resourceGroupName, projectName, groupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessmentListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessmentListResult.DeserializeAssessmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Assessment resources by Group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByGroup(string subscriptionId, string resourceGroupName, string projectName, string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var message = CreateListByGroupRequest(subscriptionId, resourceGroupName, projectName, groupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessmentListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessmentListResult.DeserializeAssessmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/assessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/assessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a Assessment. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// Machine Assessment ARM name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentAssessmentData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrationAssessmentAssessmentData.DeserializeMigrationAssessmentAssessmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentAssessmentData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a Assessment. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// Machine Assessment ARM name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentAssessmentData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrationAssessmentAssessmentData.DeserializeMigrationAssessmentAssessmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentAssessmentData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, MigrationAssessmentAssessmentData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/assessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, MigrationAssessmentAssessmentData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/assessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a Assessment. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// Machine Assessment ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, MigrationAssessmentAssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a Assessment. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// Machine Assessment ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, MigrationAssessmentAssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/assessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/assessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a Assessment. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// Machine Assessment ARM name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a Assessment. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// Machine Assessment ARM name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDownloadUrlRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, BinaryData body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/assessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/downloadUrl", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDownloadUrlRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, BinaryData body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/assessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/downloadUrl", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); +#if NET6_0_OR_GREATER + content.JsonWriter.WriteRawValue(body); +#else + using (JsonDocument document = JsonDocument.Parse(body)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Get the URL for downloading the assessment in a report format. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// Machine Assessment ARM name. + /// The content of the action request. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DownloadUrlAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, BinaryData body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateDownloadUrlRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the URL for downloading the assessment in a report format. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// Machine Assessment ARM name. + /// The content of the action request. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response DownloadUrl(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, BinaryData body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateDownloadUrlRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Assessment resources by Group. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var message = CreateListByGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, groupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessmentListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessmentListResult.DeserializeAssessmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Assessment resources by Group. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var message = CreateListByGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, groupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessmentListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessmentListResult.DeserializeAssessmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AvsAssessedMachinesRestOperations.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AvsAssessedMachinesRestOperations.cs new file mode 100644 index 000000000000..890822344efa --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AvsAssessedMachinesRestOperations.cs @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal partial class AvsAssessedMachinesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AvsAssessedMachinesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public AvsAssessedMachinesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByAvsAssessmentRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/avsAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/avsAssessedMachines", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (totalRecordCount != null) + { + uri.AppendQuery("totalRecordCount", totalRecordCount.Value, true); + } + return uri; + } + + internal HttpMessage CreateListByAvsAssessmentRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/avsAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/avsAssessedMachines", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (totalRecordCount != null) + { + uri.AppendQuery("totalRecordCount", totalRecordCount.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AvsAssessedMachine resources by AvsAssessment. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// AVS Assessment ARM name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListByAvsAssessmentAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListByAvsAssessmentRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, continuationToken, totalRecordCount); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvsAssessedMachineListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AvsAssessedMachineListResult.DeserializeAvsAssessedMachineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AvsAssessedMachine resources by AvsAssessment. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// AVS Assessment ARM name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListByAvsAssessment(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListByAvsAssessmentRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, continuationToken, totalRecordCount); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvsAssessedMachineListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AvsAssessedMachineListResult.DeserializeAvsAssessedMachineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string avsAssessedMachineName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/avsAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/avsAssessedMachines/", false); + uri.AppendPath(avsAssessedMachineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string avsAssessedMachineName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/avsAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/avsAssessedMachines/", false); + uri.AppendPath(avsAssessedMachineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a AvsAssessedMachine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// AVS Assessment ARM name. + /// AVS assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string avsAssessedMachineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNullOrEmpty(avsAssessedMachineName, nameof(avsAssessedMachineName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, avsAssessedMachineName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentAvsAssessedMachineData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrationAssessmentAvsAssessedMachineData.DeserializeMigrationAssessmentAvsAssessedMachineData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentAvsAssessedMachineData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a AvsAssessedMachine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// AVS Assessment ARM name. + /// AVS assessment Assessed Machine ARM name. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string avsAssessedMachineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNullOrEmpty(avsAssessedMachineName, nameof(avsAssessedMachineName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, avsAssessedMachineName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentAvsAssessedMachineData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrationAssessmentAvsAssessedMachineData.DeserializeMigrationAssessmentAvsAssessedMachineData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentAvsAssessedMachineData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByAvsAssessmentNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByAvsAssessmentNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AvsAssessedMachine resources by AvsAssessment. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// AVS Assessment ARM name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListByAvsAssessmentNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListByAvsAssessmentNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, continuationToken, totalRecordCount); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvsAssessedMachineListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AvsAssessedMachineListResult.DeserializeAvsAssessedMachineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AvsAssessedMachine resources by AvsAssessment. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// AVS Assessment ARM name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListByAvsAssessmentNextPage(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListByAvsAssessmentNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, groupName, assessmentName, filter, pageSize, continuationToken, totalRecordCount); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvsAssessedMachineListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AvsAssessedMachineListResult.DeserializeAvsAssessedMachineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AvsAssessmentOptionsRestOperations.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AvsAssessmentOptionsRestOperations.cs new file mode 100644 index 000000000000..0f474e0deabf --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AvsAssessmentOptionsRestOperations.cs @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal partial class AvsAssessmentOptionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AvsAssessmentOptionsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public AvsAssessmentOptionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByAssessmentProjectRequestUri(string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/avsAssessmentOptions", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectRequest(string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/avsAssessmentOptions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AvsAssessmentOptions resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectAsync(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvsAssessmentOptionsListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AvsAssessmentOptionsListResult.DeserializeAvsAssessmentOptionsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AvsAssessmentOptions resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProject(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvsAssessmentOptionsListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AvsAssessmentOptionsListResult.DeserializeAvsAssessmentOptionsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string avsAssessmentOptionsName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/avsAssessmentOptions/", false); + uri.AppendPath(avsAssessmentOptionsName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string avsAssessmentOptionsName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/avsAssessmentOptions/", false); + uri.AppendPath(avsAssessmentOptionsName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a AvsAssessmentOptions. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// AVS Assessment options ARM name. Accepted value is 'default'. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string avsAssessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(avsAssessmentOptionsName, nameof(avsAssessmentOptionsName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, avsAssessmentOptionsName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentAvsAssessmentOptionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrationAssessmentAvsAssessmentOptionData.DeserializeMigrationAssessmentAvsAssessmentOptionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentAvsAssessmentOptionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a AvsAssessmentOptions. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// AVS Assessment options ARM name. Accepted value is 'default'. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string avsAssessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(avsAssessmentOptionsName, nameof(avsAssessmentOptionsName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, avsAssessmentOptionsName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentAvsAssessmentOptionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrationAssessmentAvsAssessmentOptionData.DeserializeMigrationAssessmentAvsAssessmentOptionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentAvsAssessmentOptionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByAssessmentProjectNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AvsAssessmentOptions resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvsAssessmentOptionsListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AvsAssessmentOptionsListResult.DeserializeAvsAssessmentOptionsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AvsAssessmentOptions resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProjectNextPage(string nextLink, string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvsAssessmentOptionsListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AvsAssessmentOptionsListResult.DeserializeAvsAssessmentOptionsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AvsAssessmentsRestOperations.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AvsAssessmentsRestOperations.cs new file mode 100644 index 000000000000..e622a00e11ae --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/AvsAssessmentsRestOperations.cs @@ -0,0 +1,666 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal partial class AvsAssessmentsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AvsAssessmentsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public AvsAssessmentsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByGroupRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/avsAssessments", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByGroupRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/avsAssessments", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AvsAssessment resources by Group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByGroupAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var message = CreateListByGroupRequest(subscriptionId, resourceGroupName, projectName, groupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvsAssessmentListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AvsAssessmentListResult.DeserializeAvsAssessmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AvsAssessment resources by Group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByGroup(string subscriptionId, string resourceGroupName, string projectName, string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var message = CreateListByGroupRequest(subscriptionId, resourceGroupName, projectName, groupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvsAssessmentListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AvsAssessmentListResult.DeserializeAvsAssessmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/avsAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/avsAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a AvsAssessment. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// AVS Assessment ARM name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentAvsAssessmentData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrationAssessmentAvsAssessmentData.DeserializeMigrationAssessmentAvsAssessmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentAvsAssessmentData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a AvsAssessment. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// AVS Assessment ARM name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentAvsAssessmentData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrationAssessmentAvsAssessmentData.DeserializeMigrationAssessmentAvsAssessmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentAvsAssessmentData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, MigrationAssessmentAvsAssessmentData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/avsAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, MigrationAssessmentAvsAssessmentData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/avsAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a AvsAssessment. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// AVS Assessment ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, MigrationAssessmentAvsAssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a AvsAssessment. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// AVS Assessment ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, MigrationAssessmentAvsAssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/avsAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/avsAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a AvsAssessment. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// AVS Assessment ARM name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a AvsAssessment. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// AVS Assessment ARM name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDownloadUrlRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, BinaryData body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/avsAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/downloadUrl", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDownloadUrlRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, BinaryData body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/avsAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/downloadUrl", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); +#if NET6_0_OR_GREATER + content.JsonWriter.WriteRawValue(body); +#else + using (JsonDocument document = JsonDocument.Parse(body)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Get the URL for downloading the assessment in a report format. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// AVS Assessment ARM name. + /// The content of the action request. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DownloadUrlAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, BinaryData body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateDownloadUrlRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the URL for downloading the assessment in a report format. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// AVS Assessment ARM name. + /// The content of the action request. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response DownloadUrl(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, BinaryData body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateDownloadUrlRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AvsAssessment resources by Group. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var message = CreateListByGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, groupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvsAssessmentListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AvsAssessmentListResult.DeserializeAvsAssessmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AvsAssessment resources by Group. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var message = CreateListByGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, groupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvsAssessmentListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AvsAssessmentListResult.DeserializeAvsAssessmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/GroupsRestOperations.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/GroupsRestOperations.cs new file mode 100644 index 000000000000..a8c781233bcd --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/GroupsRestOperations.cs @@ -0,0 +1,615 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal partial class GroupsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of GroupsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public GroupsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByAssessmentProjectRequestUri(string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectRequest(string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Group resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectAsync(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GroupListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = GroupListResult.DeserializeGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Group resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProject(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GroupListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = GroupListResult.DeserializeGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a Group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, groupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentGroupData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrationAssessmentGroupData.DeserializeMigrationAssessmentGroupData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentGroupData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a Group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, groupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentGroupData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrationAssessmentGroupData.DeserializeMigrationAssessmentGroupData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentGroupData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, MigrationAssessmentGroupData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, MigrationAssessmentGroupData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a Group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, MigrationAssessmentGroupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, projectName, groupName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a Group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string projectName, string groupName, MigrationAssessmentGroupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, projectName, groupName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a Group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName, groupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a Group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string projectName, string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName, groupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateMachinesRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, MigrateGroupUpdateContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/updateMachines", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateMachinesRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, MigrateGroupUpdateContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/updateMachines", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Update machines in group by adding or removing machines. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// The content of the action request. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateMachinesAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, MigrateGroupUpdateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateUpdateMachinesRequest(subscriptionId, resourceGroupName, projectName, groupName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update machines in group by adding or removing machines. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// The content of the action request. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response UpdateMachines(string subscriptionId, string resourceGroupName, string projectName, string groupName, MigrateGroupUpdateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateUpdateMachinesRequest(subscriptionId, resourceGroupName, projectName, groupName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByAssessmentProjectNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Group resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GroupListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = GroupListResult.DeserializeGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Group resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProjectNextPage(string nextLink, string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GroupListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = GroupListResult.DeserializeGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/HypervCollectorsRestOperations.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/HypervCollectorsRestOperations.cs new file mode 100644 index 000000000000..a217fc4bb8e6 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/HypervCollectorsRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal partial class HypervCollectorsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of HypervCollectorsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public HypervCollectorsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByAssessmentProjectRequestUri(string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/hypervcollectors", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectRequest(string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/hypervcollectors", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List HypervCollector resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectAsync(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HyperVCollectorListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HyperVCollectorListResult.DeserializeHyperVCollectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List HypervCollector resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProject(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HyperVCollectorListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HyperVCollectorListResult.DeserializeHyperVCollectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string hyperVCollectorName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/hypervcollectors/", false); + uri.AppendPath(hyperVCollectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string hyperVCollectorName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/hypervcollectors/", false); + uri.AppendPath(hyperVCollectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a HypervCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Hyper-V collector ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string hyperVCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(hyperVCollectorName, nameof(hyperVCollectorName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, hyperVCollectorName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentHyperVCollectorData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrationAssessmentHyperVCollectorData.DeserializeMigrationAssessmentHyperVCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentHyperVCollectorData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a HypervCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Hyper-V collector ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string hyperVCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(hyperVCollectorName, nameof(hyperVCollectorName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, hyperVCollectorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentHyperVCollectorData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrationAssessmentHyperVCollectorData.DeserializeMigrationAssessmentHyperVCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentHyperVCollectorData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string projectName, string hyperVCollectorName, MigrationAssessmentHyperVCollectorData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/hypervcollectors/", false); + uri.AppendPath(hyperVCollectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string projectName, string hyperVCollectorName, MigrationAssessmentHyperVCollectorData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/hypervcollectors/", false); + uri.AppendPath(hyperVCollectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a HypervCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Hyper-V collector ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string projectName, string hyperVCollectorName, MigrationAssessmentHyperVCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(hyperVCollectorName, nameof(hyperVCollectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, projectName, hyperVCollectorName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a HypervCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Hyper-V collector ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string projectName, string hyperVCollectorName, MigrationAssessmentHyperVCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(hyperVCollectorName, nameof(hyperVCollectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, projectName, hyperVCollectorName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string projectName, string hyperVCollectorName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/hypervcollectors/", false); + uri.AppendPath(hyperVCollectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string projectName, string hyperVCollectorName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/hypervcollectors/", false); + uri.AppendPath(hyperVCollectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a HypervCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Hyper-V collector ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string projectName, string hyperVCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(hyperVCollectorName, nameof(hyperVCollectorName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName, hyperVCollectorName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a HypervCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Hyper-V collector ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string projectName, string hyperVCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(hyperVCollectorName, nameof(hyperVCollectorName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName, hyperVCollectorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByAssessmentProjectNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List HypervCollector resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HyperVCollectorListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HyperVCollectorListResult.DeserializeHyperVCollectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List HypervCollector resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProjectNextPage(string nextLink, string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HyperVCollectorListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HyperVCollectorListResult.DeserializeHyperVCollectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/ImportCollectorsRestOperations.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/ImportCollectorsRestOperations.cs new file mode 100644 index 000000000000..c73e6c3fd690 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/ImportCollectorsRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal partial class ImportCollectorsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ImportCollectorsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ImportCollectorsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByAssessmentProjectRequestUri(string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/importcollectors", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectRequest(string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/importcollectors", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ImportCollector resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectAsync(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ImportCollectorListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ImportCollectorListResult.DeserializeImportCollectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ImportCollector resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProject(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ImportCollectorListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ImportCollectorListResult.DeserializeImportCollectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string importCollectorName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/importcollectors/", false); + uri.AppendPath(importCollectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string importCollectorName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/importcollectors/", false); + uri.AppendPath(importCollectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a ImportCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Import collector ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string importCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(importCollectorName, nameof(importCollectorName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, importCollectorName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentImportCollectorData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrationAssessmentImportCollectorData.DeserializeMigrationAssessmentImportCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentImportCollectorData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a ImportCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Import collector ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string importCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(importCollectorName, nameof(importCollectorName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, importCollectorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentImportCollectorData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrationAssessmentImportCollectorData.DeserializeMigrationAssessmentImportCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentImportCollectorData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string projectName, string importCollectorName, MigrationAssessmentImportCollectorData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/importcollectors/", false); + uri.AppendPath(importCollectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string projectName, string importCollectorName, MigrationAssessmentImportCollectorData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/importcollectors/", false); + uri.AppendPath(importCollectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a ImportCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Import collector ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string projectName, string importCollectorName, MigrationAssessmentImportCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(importCollectorName, nameof(importCollectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, projectName, importCollectorName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a ImportCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Import collector ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string projectName, string importCollectorName, MigrationAssessmentImportCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(importCollectorName, nameof(importCollectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, projectName, importCollectorName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string projectName, string importCollectorName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/importcollectors/", false); + uri.AppendPath(importCollectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string projectName, string importCollectorName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/importcollectors/", false); + uri.AppendPath(importCollectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a ImportCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Import collector ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string projectName, string importCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(importCollectorName, nameof(importCollectorName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName, importCollectorName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a ImportCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Import collector ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string projectName, string importCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(importCollectorName, nameof(importCollectorName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName, importCollectorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByAssessmentProjectNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ImportCollector resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ImportCollectorListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ImportCollectorListResult.DeserializeImportCollectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ImportCollector resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProjectNextPage(string nextLink, string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ImportCollectorListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ImportCollectorListResult.DeserializeImportCollectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/MachinesRestOperations.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/MachinesRestOperations.cs new file mode 100644 index 000000000000..1d78d7cbdee9 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/MachinesRestOperations.cs @@ -0,0 +1,369 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal partial class MachinesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of MachinesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public MachinesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByAssessmentProjectRequestUri(string subscriptionId, string resourceGroupName, string projectName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/machines", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (totalRecordCount != null) + { + uri.AppendQuery("totalRecordCount", totalRecordCount.Value, true); + } + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectRequest(string subscriptionId, string resourceGroupName, string projectName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/machines", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (totalRecordCount != null) + { + uri.AppendQuery("totalRecordCount", totalRecordCount.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Machine resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectAsync(string subscriptionId, string resourceGroupName, string projectName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName, filter, pageSize, continuationToken, totalRecordCount); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MachineListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MachineListResult.DeserializeMachineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Machine resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProject(string subscriptionId, string resourceGroupName, string projectName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName, filter, pageSize, continuationToken, totalRecordCount); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MachineListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MachineListResult.DeserializeMachineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string machineName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/machines/", false); + uri.AppendPath(machineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string machineName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/machines/", false); + uri.AppendPath(machineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a Machine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Assessible Machine ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, machineName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentMachineData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrationAssessmentMachineData.DeserializeMigrationAssessmentMachineData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentMachineData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a Machine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Assessible Machine ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, machineName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentMachineData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrationAssessmentMachineData.DeserializeMigrationAssessmentMachineData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentMachineData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByAssessmentProjectNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string filter, int? pageSize, string continuationToken, int? totalRecordCount) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Machine resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, filter, pageSize, continuationToken, totalRecordCount); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MachineListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MachineListResult.DeserializeMachineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Machine resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Filter query. + /// Optional parameter for page size. + /// Optional parameter for continuation token. + /// Total record count. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProjectNextPage(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string filter = null, int? pageSize = null, string continuationToken = null, int? totalRecordCount = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, filter, pageSize, continuationToken, totalRecordCount); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MachineListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MachineListResult.DeserializeMachineListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/PrivateEndpointConnectionRestOperations.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/PrivateEndpointConnectionRestOperations.cs new file mode 100644 index 000000000000..b2e37e9ec1e2 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/PrivateEndpointConnectionRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal partial class PrivateEndpointConnectionRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of PrivateEndpointConnectionRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public PrivateEndpointConnectionRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByAssessmentProjectRequestUri(string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/privateEndpointConnections", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectRequest(string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/privateEndpointConnections", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List PrivateEndpointConnection resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectAsync(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentPrivateEndpointConnectionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrationAssessmentPrivateEndpointConnectionListResult.DeserializeMigrationAssessmentPrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List PrivateEndpointConnection resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProject(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentPrivateEndpointConnectionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrationAssessmentPrivateEndpointConnectionListResult.DeserializeMigrationAssessmentPrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string privateEndpointConnectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string privateEndpointConnectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a PrivateEndpointConnection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Private endpoint connection ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, privateEndpointConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentPrivateEndpointConnectionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrationAssessmentPrivateEndpointConnectionData.DeserializeMigrationAssessmentPrivateEndpointConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentPrivateEndpointConnectionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a PrivateEndpointConnection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Private endpoint connection ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentPrivateEndpointConnectionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrationAssessmentPrivateEndpointConnectionData.DeserializeMigrationAssessmentPrivateEndpointConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentPrivateEndpointConnectionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string projectName, string privateEndpointConnectionName, MigrationAssessmentPrivateEndpointConnectionData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string projectName, string privateEndpointConnectionName, MigrationAssessmentPrivateEndpointConnectionData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a PrivateEndpointConnection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Private endpoint connection ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string projectName, string privateEndpointConnectionName, MigrationAssessmentPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, projectName, privateEndpointConnectionName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a PrivateEndpointConnection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Private endpoint connection ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string projectName, string privateEndpointConnectionName, MigrationAssessmentPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, projectName, privateEndpointConnectionName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string projectName, string privateEndpointConnectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string projectName, string privateEndpointConnectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a PrivateEndpointConnection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Private endpoint connection ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string projectName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName, privateEndpointConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a PrivateEndpointConnection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Private endpoint connection ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string projectName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByAssessmentProjectNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List PrivateEndpointConnection resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentPrivateEndpointConnectionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrationAssessmentPrivateEndpointConnectionListResult.DeserializeMigrationAssessmentPrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List PrivateEndpointConnection resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProjectNextPage(string nextLink, string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentPrivateEndpointConnectionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrationAssessmentPrivateEndpointConnectionListResult.DeserializeMigrationAssessmentPrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/PrivateLinkResourceRestOperations.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/PrivateLinkResourceRestOperations.cs new file mode 100644 index 000000000000..3083a8f5cad4 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/PrivateLinkResourceRestOperations.cs @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal partial class PrivateLinkResourceRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of PrivateLinkResourceRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public PrivateLinkResourceRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByAssessmentProjectRequestUri(string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/privateLinkResources", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectRequest(string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/privateLinkResources", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List PrivateLinkResource resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectAsync(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentPrivateLinkResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrationAssessmentPrivateLinkResourceListResult.DeserializeMigrationAssessmentPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List PrivateLinkResource resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProject(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentPrivateLinkResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrationAssessmentPrivateLinkResourceListResult.DeserializeMigrationAssessmentPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string privateLinkResourceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/privateLinkResources/", false); + uri.AppendPath(privateLinkResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string privateLinkResourceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/privateLinkResources/", false); + uri.AppendPath(privateLinkResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a PrivateLinkResource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Private link resource ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, privateLinkResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentPrivateLinkResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrationAssessmentPrivateLinkResourceData.DeserializeMigrationAssessmentPrivateLinkResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentPrivateLinkResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a PrivateLinkResource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Private link resource ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, privateLinkResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentPrivateLinkResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrationAssessmentPrivateLinkResourceData.DeserializeMigrationAssessmentPrivateLinkResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentPrivateLinkResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByAssessmentProjectNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List PrivateLinkResource resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentPrivateLinkResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrationAssessmentPrivateLinkResourceListResult.DeserializeMigrationAssessmentPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List PrivateLinkResource resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProjectNextPage(string nextLink, string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentPrivateLinkResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrationAssessmentPrivateLinkResourceListResult.DeserializeMigrationAssessmentPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/ServerCollectorsRestOperations.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/ServerCollectorsRestOperations.cs new file mode 100644 index 000000000000..fe09b6e07ebb --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/ServerCollectorsRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal partial class ServerCollectorsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ServerCollectorsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ServerCollectorsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByAssessmentProjectRequestUri(string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/servercollectors", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectRequest(string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/servercollectors", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ServerCollector resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectAsync(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ServerCollectorListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ServerCollectorListResult.DeserializeServerCollectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ServerCollector resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProject(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ServerCollectorListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ServerCollectorListResult.DeserializeServerCollectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string serverCollectorName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/servercollectors/", false); + uri.AppendPath(serverCollectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string serverCollectorName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/servercollectors/", false); + uri.AppendPath(serverCollectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a ServerCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Physical server collector ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string serverCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(serverCollectorName, nameof(serverCollectorName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, serverCollectorName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentServerCollectorData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrationAssessmentServerCollectorData.DeserializeMigrationAssessmentServerCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentServerCollectorData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a ServerCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Physical server collector ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string serverCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(serverCollectorName, nameof(serverCollectorName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, serverCollectorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentServerCollectorData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrationAssessmentServerCollectorData.DeserializeMigrationAssessmentServerCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentServerCollectorData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string projectName, string serverCollectorName, MigrationAssessmentServerCollectorData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/servercollectors/", false); + uri.AppendPath(serverCollectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string projectName, string serverCollectorName, MigrationAssessmentServerCollectorData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/servercollectors/", false); + uri.AppendPath(serverCollectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a ServerCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Physical server collector ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string projectName, string serverCollectorName, MigrationAssessmentServerCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(serverCollectorName, nameof(serverCollectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, projectName, serverCollectorName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a ServerCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Physical server collector ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string projectName, string serverCollectorName, MigrationAssessmentServerCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(serverCollectorName, nameof(serverCollectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, projectName, serverCollectorName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string projectName, string serverCollectorName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/servercollectors/", false); + uri.AppendPath(serverCollectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string projectName, string serverCollectorName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/servercollectors/", false); + uri.AppendPath(serverCollectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a ServerCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Physical server collector ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string projectName, string serverCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(serverCollectorName, nameof(serverCollectorName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName, serverCollectorName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a ServerCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Physical server collector ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string projectName, string serverCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(serverCollectorName, nameof(serverCollectorName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName, serverCollectorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByAssessmentProjectNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ServerCollector resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ServerCollectorListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ServerCollectorListResult.DeserializeServerCollectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ServerCollector resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProjectNextPage(string nextLink, string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ServerCollectorListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ServerCollectorListResult.DeserializeServerCollectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/SqlAssessmentOptionsRestOperations.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/SqlAssessmentOptionsRestOperations.cs new file mode 100644 index 000000000000..9da88ae11fcb --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/SqlAssessmentOptionsRestOperations.cs @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal partial class SqlAssessmentOptionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SqlAssessmentOptionsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public SqlAssessmentOptionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByAssessmentProjectRequestUri(string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/sqlAssessmentOptions", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectRequest(string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/sqlAssessmentOptions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SqlAssessmentOptions resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectAsync(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SqlAssessmentOptionsListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SqlAssessmentOptionsListResult.DeserializeSqlAssessmentOptionsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SqlAssessmentOptions resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProject(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SqlAssessmentOptionsListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SqlAssessmentOptionsListResult.DeserializeSqlAssessmentOptionsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string assessmentOptionsName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/sqlAssessmentOptions/", false); + uri.AppendPath(assessmentOptionsName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string assessmentOptionsName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/sqlAssessmentOptions/", false); + uri.AppendPath(assessmentOptionsName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a SqlAssessmentOptions. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Sql assessment options ARM name. Accepted values is 'default'. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string assessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(assessmentOptionsName, nameof(assessmentOptionsName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, assessmentOptionsName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentSqlAssessmentOptionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrationAssessmentSqlAssessmentOptionData.DeserializeMigrationAssessmentSqlAssessmentOptionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentSqlAssessmentOptionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a SqlAssessmentOptions. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Sql assessment options ARM name. Accepted values is 'default'. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string assessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(assessmentOptionsName, nameof(assessmentOptionsName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, assessmentOptionsName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentSqlAssessmentOptionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrationAssessmentSqlAssessmentOptionData.DeserializeMigrationAssessmentSqlAssessmentOptionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentSqlAssessmentOptionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByAssessmentProjectNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SqlAssessmentOptions resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SqlAssessmentOptionsListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SqlAssessmentOptionsListResult.DeserializeSqlAssessmentOptionsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SqlAssessmentOptions resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProjectNextPage(string nextLink, string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SqlAssessmentOptionsListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SqlAssessmentOptionsListResult.DeserializeSqlAssessmentOptionsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/SqlAssessmentV2RestOperations.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/SqlAssessmentV2RestOperations.cs new file mode 100644 index 000000000000..4512fddc1876 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/SqlAssessmentV2RestOperations.cs @@ -0,0 +1,666 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal partial class SqlAssessmentV2RestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SqlAssessmentV2RestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public SqlAssessmentV2RestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByGroupRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByGroupRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SqlAssessmentV2 resources by Group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByGroupAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var message = CreateListByGroupRequest(subscriptionId, resourceGroupName, projectName, groupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SqlAssessmentV2ListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SqlAssessmentV2ListResult.DeserializeSqlAssessmentV2ListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SqlAssessmentV2 resources by Group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByGroup(string subscriptionId, string resourceGroupName, string projectName, string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var message = CreateListByGroupRequest(subscriptionId, resourceGroupName, projectName, groupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SqlAssessmentV2ListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SqlAssessmentV2ListResult.DeserializeSqlAssessmentV2ListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a SqlAssessmentV2. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentSqlAssessmentV2Data value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrationAssessmentSqlAssessmentV2Data.DeserializeMigrationAssessmentSqlAssessmentV2Data(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentSqlAssessmentV2Data)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a SqlAssessmentV2. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentSqlAssessmentV2Data value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrationAssessmentSqlAssessmentV2Data.DeserializeMigrationAssessmentSqlAssessmentV2Data(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentSqlAssessmentV2Data)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, MigrationAssessmentSqlAssessmentV2Data data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, MigrationAssessmentSqlAssessmentV2Data data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a SqlAssessmentV2. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, MigrationAssessmentSqlAssessmentV2Data data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a SqlAssessmentV2. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, MigrationAssessmentSqlAssessmentV2Data data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a SqlAssessmentV2. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a SqlAssessmentV2. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDownloadUrlRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, BinaryData body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/downloadUrl", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDownloadUrlRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, BinaryData body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/downloadUrl", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); +#if NET6_0_OR_GREATER + content.JsonWriter.WriteRawValue(body); +#else + using (JsonDocument document = JsonDocument.Parse(body)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Get the URL for downloading the assessment in a report format. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// The content of the action request. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DownloadUrlAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, BinaryData body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateDownloadUrlRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the URL for downloading the assessment in a report format. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// The content of the action request. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response DownloadUrl(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, BinaryData body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateDownloadUrlRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SqlAssessmentV2 resources by Group. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var message = CreateListByGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, groupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SqlAssessmentV2ListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SqlAssessmentV2ListResult.DeserializeSqlAssessmentV2ListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SqlAssessmentV2 resources by Group. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var message = CreateListByGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, groupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SqlAssessmentV2ListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SqlAssessmentV2ListResult.DeserializeSqlAssessmentV2ListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/SqlAssessmentV2SummaryRestOperations.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/SqlAssessmentV2SummaryRestOperations.cs new file mode 100644 index 000000000000..1891ddae80a1 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/SqlAssessmentV2SummaryRestOperations.cs @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal partial class SqlAssessmentV2SummaryRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SqlAssessmentV2SummaryRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public SqlAssessmentV2SummaryRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListBySqlAssessmentV2RequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/summaries", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySqlAssessmentV2Request(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/summaries", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SqlAssessmentV2Summary resources by SqlAssessmentV2. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListBySqlAssessmentV2Async(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListBySqlAssessmentV2Request(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SqlAssessmentV2SummaryListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SqlAssessmentV2SummaryListResult.DeserializeSqlAssessmentV2SummaryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SqlAssessmentV2Summary resources by SqlAssessmentV2. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListBySqlAssessmentV2(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListBySqlAssessmentV2Request(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SqlAssessmentV2SummaryListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SqlAssessmentV2SummaryListResult.DeserializeSqlAssessmentV2SummaryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string summaryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/summaries/", false); + uri.AppendPath(summaryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string summaryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/groups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/sqlAssessments/", false); + uri.AppendPath(assessmentName, true); + uri.AppendPath("/summaries/", false); + uri.AppendPath(summaryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a SqlAssessmentV2Summary. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Gets the Name of the SQL Summary. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string summaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNullOrEmpty(summaryName, nameof(summaryName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, summaryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentSqlAssessmentV2SummaryData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrationAssessmentSqlAssessmentV2SummaryData.DeserializeMigrationAssessmentSqlAssessmentV2SummaryData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentSqlAssessmentV2SummaryData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a SqlAssessmentV2Summary. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// Gets the Name of the SQL Summary. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, string summaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNullOrEmpty(summaryName, nameof(summaryName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName, summaryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentSqlAssessmentV2SummaryData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrationAssessmentSqlAssessmentV2SummaryData.DeserializeMigrationAssessmentSqlAssessmentV2SummaryData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentSqlAssessmentV2SummaryData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySqlAssessmentV2NextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySqlAssessmentV2NextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SqlAssessmentV2Summary resources by SqlAssessmentV2. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListBySqlAssessmentV2NextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListBySqlAssessmentV2NextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SqlAssessmentV2SummaryListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SqlAssessmentV2SummaryListResult.DeserializeSqlAssessmentV2SummaryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SqlAssessmentV2Summary resources by SqlAssessmentV2. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Group ARM name. + /// SQL Assessment arm name. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListBySqlAssessmentV2NextPage(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + + using var message = CreateListBySqlAssessmentV2NextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SqlAssessmentV2SummaryListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SqlAssessmentV2SummaryListResult.DeserializeSqlAssessmentV2SummaryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/SqlCollectorRestOperations.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/SqlCollectorRestOperations.cs new file mode 100644 index 000000000000..bc838332ba8c --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/SqlCollectorRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal partial class SqlCollectorRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SqlCollectorRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public SqlCollectorRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByAssessmentProjectRequestUri(string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/sqlcollectors", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectRequest(string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/sqlcollectors", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SqlCollector resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectAsync(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SqlCollectorListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SqlCollectorListResult.DeserializeSqlCollectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SqlCollector resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProject(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SqlCollectorListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SqlCollectorListResult.DeserializeSqlCollectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string collectorName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/sqlcollectors/", false); + uri.AppendPath(collectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string collectorName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/sqlcollectors/", false); + uri.AppendPath(collectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a SqlCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Sql collector ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string collectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(collectorName, nameof(collectorName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, collectorName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentSqlCollectorData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrationAssessmentSqlCollectorData.DeserializeMigrationAssessmentSqlCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentSqlCollectorData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a SqlCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Sql collector ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string collectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(collectorName, nameof(collectorName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, collectorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentSqlCollectorData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrationAssessmentSqlCollectorData.DeserializeMigrationAssessmentSqlCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentSqlCollectorData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string projectName, string collectorName, MigrationAssessmentSqlCollectorData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/sqlcollectors/", false); + uri.AppendPath(collectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string projectName, string collectorName, MigrationAssessmentSqlCollectorData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/sqlcollectors/", false); + uri.AppendPath(collectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a SqlCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Sql collector ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string projectName, string collectorName, MigrationAssessmentSqlCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(collectorName, nameof(collectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, projectName, collectorName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a SqlCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Sql collector ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string projectName, string collectorName, MigrationAssessmentSqlCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(collectorName, nameof(collectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, projectName, collectorName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string projectName, string collectorName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/sqlcollectors/", false); + uri.AppendPath(collectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string projectName, string collectorName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/sqlcollectors/", false); + uri.AppendPath(collectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a SqlCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Sql collector ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string projectName, string collectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(collectorName, nameof(collectorName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName, collectorName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a SqlCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Sql collector ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string projectName, string collectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(collectorName, nameof(collectorName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName, collectorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByAssessmentProjectNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SqlCollector resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SqlCollectorListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SqlCollectorListResult.DeserializeSqlCollectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SqlCollector resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProjectNextPage(string nextLink, string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SqlCollectorListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SqlCollectorListResult.DeserializeSqlCollectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/VmwareCollectorsRestOperations.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/VmwareCollectorsRestOperations.cs new file mode 100644 index 000000000000..60af17ec7373 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Generated/RestOperations/VmwareCollectorsRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migration.Assessment.Models; + +namespace Azure.ResourceManager.Migration.Assessment +{ + internal partial class VmwareCollectorsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of VmwareCollectorsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public VmwareCollectorsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByAssessmentProjectRequestUri(string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/vmwarecollectors", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectRequest(string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/vmwarecollectors", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List VmwareCollector resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectAsync(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VMwareCollectorListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VMwareCollectorListResult.DeserializeVMwareCollectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List VmwareCollector resources by AssessmentProject. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProject(string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VMwareCollectorListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VMwareCollectorListResult.DeserializeVMwareCollectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string vmWareCollectorName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/vmwarecollectors/", false); + uri.AppendPath(vmWareCollectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string vmWareCollectorName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/vmwarecollectors/", false); + uri.AppendPath(vmWareCollectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a VmwareCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// VMware collector ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string vmWareCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(vmWareCollectorName, nameof(vmWareCollectorName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, vmWareCollectorName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentVMwareCollectorData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigrationAssessmentVMwareCollectorData.DeserializeMigrationAssessmentVMwareCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentVMwareCollectorData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a VmwareCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// VMware collector ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string vmWareCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(vmWareCollectorName, nameof(vmWareCollectorName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, vmWareCollectorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MigrationAssessmentVMwareCollectorData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigrationAssessmentVMwareCollectorData.DeserializeMigrationAssessmentVMwareCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigrationAssessmentVMwareCollectorData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string projectName, string vmWareCollectorName, MigrationAssessmentVMwareCollectorData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/vmwarecollectors/", false); + uri.AppendPath(vmWareCollectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string projectName, string vmWareCollectorName, MigrationAssessmentVMwareCollectorData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/vmwarecollectors/", false); + uri.AppendPath(vmWareCollectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a VmwareCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// VMware collector ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string projectName, string vmWareCollectorName, MigrationAssessmentVMwareCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(vmWareCollectorName, nameof(vmWareCollectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, projectName, vmWareCollectorName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a VmwareCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// VMware collector ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string projectName, string vmWareCollectorName, MigrationAssessmentVMwareCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(vmWareCollectorName, nameof(vmWareCollectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, projectName, vmWareCollectorName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string projectName, string vmWareCollectorName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/vmwarecollectors/", false); + uri.AppendPath(vmWareCollectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string projectName, string vmWareCollectorName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/vmwarecollectors/", false); + uri.AppendPath(vmWareCollectorName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a VmwareCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// VMware collector ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string projectName, string vmWareCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(vmWareCollectorName, nameof(vmWareCollectorName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName, vmWareCollectorName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a VmwareCollector. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// VMware collector ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string projectName, string vmWareCollectorName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(vmWareCollectorName, nameof(vmWareCollectorName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName, vmWareCollectorName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByAssessmentProjectNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByAssessmentProjectNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List VmwareCollector resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByAssessmentProjectNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VMwareCollectorListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VMwareCollectorListResult.DeserializeVMwareCollectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List VmwareCollector resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByAssessmentProjectNextPage(string nextLink, string subscriptionId, string resourceGroupName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByAssessmentProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VMwareCollectorListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VMwareCollectorListResult.DeserializeVMwareCollectorListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Properties/AssemblyInfo.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..342c45f03100 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/Properties/AssemblyInfo.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: Azure.Core.AzureResourceProviderNamespace("Migration.Assessment")] + +[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] +[assembly: InternalsVisibleTo("Azure.ResourceManager.Migration.Assessment.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/autorest.md b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/autorest.md new file mode 100644 index 000000000000..9ea2a42db3b0 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/src/autorest.md @@ -0,0 +1,261 @@ +# Generated code configuration + +Run `dotnet build /t:GenerateCode` to generate code. + +``` yaml +azure-arm: true +csharp: true +library-name: Migration.Assessment +namespace: Azure.ResourceManager.Migration.Assessment +require: https://github.com/Azure/azure-rest-api-specs/blob/56b8f400c8c9f20f8137fa12c37d25bcfdeb7725/specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/readme.md +tag: package-2023-03 +output-folder: $(this-folder)/Generated +clear-output-folder: true +sample-gen: + output-folder: $(this-folder)/../samples/Generated + clear-output-folder: true +skip-csproj: true +modelerfour: + flatten-payloads: false +use-model-reader-writer: true + +#mgmt-debug: +# show-serialized-names: true + +rename-mapping: + # Solve naming conflic with the data class of SqlAssessmentV2Summary + SqlAssessmentV2SummaryData: SqlAssessmentV2SummaryDetails + # Correct the violations of the naming rules (suffix) + AssessedDiskData: AssessedDataDisk + AvsSkuOptions: AvsSkuConfig + SqlPaaSTargetOptions: SqlPaaSTargetConfig + VmFamilyOptions: VmFamilyConfig + SqlAssessmentV2IaasSuitabilityData: SqlAssessmentV2IaasSuitabilityDetails + SqlAssessmentV2PaasSuitabilityData: SqlAssessmentV2PaasSuitabilityDetails + UltraDiskAssessmentOptions: UltraDiskAssessmentConfig + # Correct the violations of the naming rules + AzureAvsNodeType: AvsNodeType + AzureAvsSuitabilityExplanation: AvsSuitabilityExplanation + AzureAvsVmSuitabilityDetail: AvsVmSuitabilityDetail + AzureAvsVmSuitabilityExplanation: AvsVmSuitabilityExplanation + AzureManagedDiskSkuDTODiskRedundancy.LRS: Lrs + AzureManagedDiskSkuDTODiskRedundancy.ZRS: Zrs + AzureSqlPurchaseModel.DTU: Dtu + AzureVirtualMachineSkuDTO: AzureVmSkuDTO + CollectorAgentPropertiesBase.lastHeartbeatUtc: LastHeartbeatOn + DownloadUrl: AssessmentReportDownloadUri + EnvironmentType: AssessmentEnvironmentType + Error.updatedTimeStamp: UpdatedOn + ErrorSummary: AssessmentErrorSummary + UpdateGroupBody: MigrateGroupUpdateContent + GroupBodyProperties: MigrateGroupUpdateProperties + GroupUpdateOperation: MigrateGroupUpdateOperationType + MachineBootType.EFI: Efi + AssessmentProjectUpdate.properties.customerWorkspaceId: -|arm-id + AzureOfferCode.MSAZR0003P: MSAZR0003P + AzureOfferCode.MSAZR0022P: MSAZR0022P + AzureOfferCode.MSAZR0023P: MSAZR0023P + AzureOfferCode.MSAZR0025P: MSAZR0025P + AzureOfferCode.MSAZR0029P: MSAZR0029P + AzureOfferCode.MSAZR0036P: MSAZR0036P + AzureOfferCode.MSAZR0044P: MSAZR0044P + AzureOfferCode.MSAZR0059P: MSAZR0059P + AzureOfferCode.MSAZR0060P: MSAZR0060P + AzureOfferCode.MSAZR0062P: MSAZR0062P + AzureOfferCode.MSAZR0063P: MSAZR0063P + AzureOfferCode.MSAZR0064P: MSAZR0064P + AzureOfferCode.MSAZR0111P: MSAZR0111P + AzureOfferCode.MSAZR0120P: MSAZR0120P + AzureOfferCode.MSAZR0121P: MSAZR0121P + AzureOfferCode.MSAZR0122P: MSAZR0122P + AzureOfferCode.MSAZR0123P: MSAZR0123P + AzureOfferCode.MSAZR0124P: MSAZR0124P + AzureOfferCode.MSAZR0125P: MSAZR0125P + AzureOfferCode.MSAZR0126P: MSAZR0126P + AzureOfferCode.MSAZR0127P: MSAZR0127P + AzureOfferCode.MSAZR0128P: MSAZR0128P + AzureOfferCode.MSAZR0129P: MSAZR0129P + AzureOfferCode.MSAZR0130P: MSAZR0130P + AzureOfferCode.MSAZR0144P: MSAZR0144P + AzureOfferCode.MSAZR0148P: MSAZR0148P + AzureOfferCode.MSAZR0149P: MSAZR0149P + AzureOfferCode.MSAZR0243P: MSAZR0243P + AzureOfferCode.MSAZRDE0003P: MSAZRDE0003P + AzureOfferCode.MSAZRDE0044P: MSAZRDE0044P + AzureOfferCode.MSAZRUSGOV0003P: MSAZRUSGOV0003P + AzureOfferCode.MSMCAZR0044P: MSMCAZR0044P + AzureOfferCode.MSMCAZR0059P: MSMCAZR0059P + AzureOfferCode.MSMCAZR0060P: MSMCAZR0060P + AzureOfferCode.MSMCAZR0063P: MSMCAZR0063P + AzureOfferCode.MSMCAZR0120P: MSMCAZR0120P + AzureOfferCode.MSMCAZR0121P: MSMCAZR0121P + AzureOfferCode.MSMCAZR0125P: MSMCAZR0125P + AzureOfferCode.MSMCAZR0128P: MSMCAZR0128P + Percentile: PercentileOfUtilization + TimeRange: AssessmentTimeRange + ProjectStatus: AssessmentProjectStatus + SqlFCIMetadata: SqlFciMetadata + SqlFCIMetadataState: SqlFciMetadataState + SqlFCIState: SqlFciState + OptimizationLogic: SqlOptimizationLogic + AssessedMachine.properties.createdTimestamp: CreatedOn + AssessedMachine.properties.updatedTimestamp: UpdatedOn + AssessedSqlDatabaseV2.properties.createdTimestamp: CreatedOn + AssessedSqlDatabaseV2.properties.updatedTimestamp: UpdatedOn + AssessedSqlInstanceV2.properties.createdTimestamp: CreatedOn + AssessedSqlInstanceV2.properties.updatedTimestamp: UpdatedOn + AssessedSqlMachine.properties.createdTimestamp: CreatedOn + AssessedSqlMachine.properties.updatedTimestamp: UpdatedOn + Assessment.properties.pricesTimestamp: PricesQueriedOn + Assessment.properties.createdTimestamp: CreatedOn + Assessment.properties.updatedTimestamp: UpdatedOn + AssessmentProject.properties.createdTimestamp: CreateOn + AssessmentProject.properties.updatedTimestamp: UpdatedOn + AssessmentProjectSummary.properties.lastAssessmentTimestamp: LastAssessedOn + AvsAssessedMachine.properties.createdTimestamp: CreatedOn + AvsAssessedMachine.properties.updatedTimestamp: UpdatedOn + AvsAssessment.properties.pricesTimestamp: PricesQueriedOn + AvsAssessment.properties.createdTimestamp: CreatedOn + AvsAssessment.properties.updatedTimestamp: UpdatedOn + Group.properties.createdTimestamp: CreatedOn + Group.properties.updatedTimestamp: UpdatedOn + HypervCollector.properties.createdTimestamp: CreatedOn + HypervCollector.properties.updatedTimestamp: UpdatedOn + ImportCollector.properties.createdTimestamp: CreatedOn + ImportCollector.properties.updatedTimestamp: UpdatedOn + Machine.properties.createdTimestamp: CreatedOn + Machine.properties.updatedTimestamp: UpdatedOn + ServerCollector.properties.createdTimestamp: CreatedOn + ServerCollector.properties.updatedTimestamp: UpdatedOn + SqlAssessmentV2.properties.pricesTimestamp: PricesQueriedOn + SqlAssessmentV2.properties.createdTimestamp: CreatedOn + SqlAssessmentV2.properties.updatedTimestamp: UpdatedOn + SqlCollector.properties.createdTimestamp: CreatedOn + SqlCollector.properties.updatedTimestamp: UpdatedOn + VmwareCollector.properties.createdTimestamp: CreatedOn + VmwareCollector.properties.updatedTimestamp: UpdatedOn + SqlMigrationGuidelineCategory.FailoverCluterInstanceGuideLine: FailoverCluterInstanceGuideLine + AzureDiskSize.StandardSSD_E10: StandardSsdE10 + AzureDiskSize.StandardSSD_E15: StandardSsdE15 + AzureDiskSize.StandardSSD_E20: StandardSsdE20 + AzureDiskSize.StandardSSD_E30: StandardSsdE30 + AzureDiskSize.StandardSSD_E40: StandardSsdE40 + AzureDiskSize.StandardSSD_E50: StandardSsdE50 + AzureDiskSize.StandardSSD_E60: StandardSsdE60 + AzureDiskSize.StandardSSD_E70: StandardSsdE70 + AzureDiskSize.StandardSSD_E80: StandardSsdE80 + AzureDiskSize.StandardSSD_E1: StandardSsdE1 + AzureDiskSize.StandardSSD_E2: StandardSsdE2 + AzureDiskSize.StandardSSD_E3: StandardSsdE3 + AzureDiskSize.StandardSSD_E4: StandardSsdE4 + AzureDiskSize.StandardSSD_E6: StandardSsdE6 + +prepend-rp-prefix: + # Correct the violations of the naming rules + - Assessment + - AssessmentOptions + - AssessmentProject + - AssessmentProjectSummary + - AvsAssessedMachine + - AvsAssessment + - AvsAssessmentOptions + - Group + - HypervCollector + - ImportCollector + - Machine + - ServerCollector + - SqlAssessmentOptions + - SqlAssessmentV2 + - SqlAssessmentV2Summary + - SqlCollector + - VmwareCollector + - CloudSuitability + - ComputeTier + - Disk + - Error + - GroupStatus + - GroupType + - HardwareGeneration + - NetworkAdapter + - OsLicense + - ProvisioningState + - TargetType + - TimeRange + +format-by-name-rules: + 'tenantId': 'uuid' + 'ETag': 'etag' + 'location': 'azure-location' + '*Uri': 'Uri' + '*Uris': 'Uri' + '*ArmId': 'arm-id' + +acronym-mapping: + CPU: Cpu + CPUs: Cpus + Os: OS + Ip: IP + Ips: IPs|ips + IDs: Ids + VM: Vm + VMs: Vms + Vmos: VmOS + VMScaleSet: VmScaleSet + DNS: Dns + VPN: Vpn + NAT: Nat + WAN: Wan + Ipv4: IPv4|ipv4 + Ipv6: IPv6|ipv6 + Ipsec: IPsec|ipsec + SSO: Sso + URI: Uri + Etag: ETag|etag + Vmware: VMware + Hyperv: HyperV + DTO: Dto + SSD: Ssd + Db: DB + SqlMi: SqlMI + Ea: EA + +directive: + # Use double instead of float for all properties + - from: migrate.json + where: $.definitions..[?(@.format === 'float')] + transform: > + $.format = 'double' + # Correct the AzureLocation refs + - from: migrate.json + where: $.definitions + transform: > + delete $.AvsAssessmentOptionsProperties.properties.reservedInstanceSupportedLocations.items['$ref']; + $.AvsAssessmentOptionsProperties.properties.reservedInstanceSupportedLocations.items['type'] = 'string'; + $.AvsAssessmentOptionsProperties.properties.reservedInstanceSupportedLocations.items['x-ms-format'] = 'azure-location'; + delete $.AvsAssessmentProperties.properties.azureLocation['$ref']; + $.AvsAssessmentProperties.properties.azureLocation['type'] = 'string'; + $.AvsAssessmentProperties.properties.azureLocation['x-ms-format'] = 'azure-location'; + delete $.AvsSkuOptions.properties.targetLocations.items['$ref']; + $.AvsSkuOptions.properties.targetLocations.items['type'] = 'string'; + $.AvsSkuOptions.properties.targetLocations.items['x-ms-format'] = 'azure-location'; + $.MachineAssessmentProperties.properties.azureLocation['x-ms-format'] = 'azure-location'; + $.SqlAssessmentV2Properties.properties.azureLocation['x-ms-format'] = 'azure-location'; + delete $.SqlAssessmentOptionsProperties.properties.savingsPlanSupportedLocations.items['$ref']; + $.SqlAssessmentOptionsProperties.properties.savingsPlanSupportedLocations.items['type'] = 'string'; + $.SqlAssessmentOptionsProperties.properties.savingsPlanSupportedLocations.items['x-ms-format'] = 'azure-location'; + delete $.SqlAssessmentOptionsProperties.properties.savingsPlanSupportedLocationsForPaas.items['$ref']; + $.SqlAssessmentOptionsProperties.properties.savingsPlanSupportedLocationsForPaas.items['type'] = 'string'; + $.SqlAssessmentOptionsProperties.properties.savingsPlanSupportedLocationsForPaas.items['x-ms-format'] = 'azure-location'; + delete $.SqlAssessmentOptionsProperties.properties.reservedInstanceSupportedLocationsForIaas.items['$ref']; + $.SqlAssessmentOptionsProperties.properties.reservedInstanceSupportedLocationsForIaas.items['type'] = 'string'; + $.SqlAssessmentOptionsProperties.properties.reservedInstanceSupportedLocationsForIaas.items['x-ms-format'] = 'azure-location'; + delete $.SqlAssessmentOptionsProperties.properties.reservedInstanceSupportedLocations.items['$ref']; + $.SqlAssessmentOptionsProperties.properties.reservedInstanceSupportedLocations.items['type'] = 'string'; + $.SqlAssessmentOptionsProperties.properties.reservedInstanceSupportedLocations.items['x-ms-format'] = 'azure-location'; + delete $.SqlAssessmentV2Properties.properties.disasterRecoveryLocation['$ref']; + $.SqlAssessmentV2Properties.properties.disasterRecoveryLocation['type'] = 'string'; + $.SqlAssessmentV2Properties.properties.disasterRecoveryLocation['x-ms-format'] = 'azure-location'; + delete $.SqlPaaSTargetOptions.properties.targetLocations.items['$ref']; + $.SqlPaaSTargetOptions.properties.targetLocations.items['type'] = 'string'; + $.SqlPaaSTargetOptions.properties.targetLocations.items['x-ms-format'] = 'azure-location'; +``` diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/Azure.ResourceManager.Migration.Assessment.Tests.csproj b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/Azure.ResourceManager.Migration.Assessment.Tests.csproj new file mode 100644 index 000000000000..d1f119b0a6ee --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/Azure.ResourceManager.Migration.Assessment.Tests.csproj @@ -0,0 +1,5 @@ + + + + + diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/MigrationAssessmentManagementTestBase.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/MigrationAssessmentManagementTestBase.cs new file mode 100644 index 000000000000..a6c5a1b0f862 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/MigrationAssessmentManagementTestBase.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TestFramework; +using NUnit.Framework; +using System.Threading.Tasks; + +namespace Azure.ResourceManager.Migration.Assessment.Tests +{ + public class MigrationAssessmentManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected MigrationAssessmentManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected MigrationAssessmentManagementTestBase(bool isAsync) + : base(isAsync) + { + } + + [SetUp] + public async Task CreateCommonClient() + { + Client = GetArmClient(); + DefaultSubscription = await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false); + } + + protected async Task CreateResourceGroup(SubscriptionResource subscription, string rgNamePrefix, AzureLocation location) + { + string rgName = Recording.GenerateAssetName(rgNamePrefix); + ResourceGroupData input = new ResourceGroupData(location); + var lro = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, input); + return lro.Value; + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/MigrationAssessmentManagementTestEnvironment.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/MigrationAssessmentManagementTestEnvironment.cs new file mode 100644 index 000000000000..154e645a25ff --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/MigrationAssessmentManagementTestEnvironment.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.Identity; + +namespace Azure.ResourceManager.Migration.Assessment.Tests +{ + public class MigrationAssessmentManagementTestEnvironment : TestEnvironment + { + public override TokenCredential Credential => + new ChainedTokenCredential(new AzureCliCredential(), new VisualStudioCodeCredential()); + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/Tests/MigrationAssessmentCollectorTests.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/Tests/MigrationAssessmentCollectorTests.cs new file mode 100644 index 000000000000..0a6a354c432c --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/Tests/MigrationAssessmentCollectorTests.cs @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Tests +{ + public class MigrationAssessmentCollectorTests : MigrationAssessmentManagementTestBase + { + private static AzureLocation targetRegion; + private static string targetSubscriptionId; + private static Guid tenantId; + private static ResourceGroupResource rg; + private static MigrationAssessmentAssessmentProjectResource assessmentProjectResource; + private static CollectorAgentPropertiesBase agentProperties; + + public MigrationAssessmentCollectorTests(bool isAsync) : base(isAsync) + { + } + + [SetUp] + public async Task Setup() + { + targetRegion = AzureLocation.BrazilSouth; + targetSubscriptionId = DefaultSubscription.Data.SubscriptionId; + tenantId = Guid.Parse("50d65f49-5a31-4b70-b34a-a73bb29b77c5"); + rg = await DefaultSubscription.GetResourceGroups().GetAsync("sakanwar"); + + string assessmentProjName = Recording.GenerateAssetName("assessmentProj-"); + + var assessmentProjectData = new MigrationAssessmentAssessmentProjectData(targetRegion); + var assessmentProjectCollection = rg.GetMigrationAssessmentAssessmentProjects(); + + // Create Assessment Project + var response = + await assessmentProjectCollection.CreateOrUpdateAsync(WaitUntil.Completed, assessmentProjName, assessmentProjectData); + await response.WaitForCompletionAsync(); + assessmentProjectResource = response.Value; + Assert.IsTrue(response.HasCompleted); + Assert.IsNotNull(assessmentProjectResource); + + agentProperties = new CollectorAgentPropertiesBase() + { + Id = Recording.GenerateAssetName("agentId-"), + Version = "2.0.1993.19", + LastHeartbeatOn = DateTimeOffset.Parse("2022-07-07T14:25:35.708325Z"), + SpnDetails = new CollectorAgentSpnPropertiesBase() + { + Authority = $"https://login.windows.net/{tenantId}", + ApplicationId = "5db4fda9-7d3d-410e-ba13-a84ec7d2f01f", + Audience = Recording.GenerateAssetName("audience-"), + ObjectId = "2354347c-7ed1-44c3-8f39-b3a972e3ce0e", + TenantId = tenantId, + }, + }; + } + + [TestCase] + [RecordedTest] + public async Task TestHyperVCollectorOperations() + { + string rgName = rg.Id.Name; + var hyperVCollectorCollection = assessmentProjectResource.GetMigrationAssessmentHyperVCollectors(); + + // Create Hyper-V Collector + var hyperVCollectorData = new MigrationAssessmentHyperVCollectorData() + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + AgentProperties = agentProperties, + DiscoverySiteId = + string.Format($"/subscriptions/{targetSubscriptionId}/resourceGroups/{rgName}/providers/Microsoft.OffAzure/HyperVSites/{Recording.GenerateAssetName("site-")}"), + }; + string hyperVCollectorName = Recording.GenerateAssetName("hyperVCollector-"); + var hyperVCollectorResponse = + await hyperVCollectorCollection.CreateOrUpdateAsync(WaitUntil.Completed, hyperVCollectorName, hyperVCollectorData); + var hyperVCollectorResource = hyperVCollectorResponse.Value; + Assert.IsTrue(hyperVCollectorResponse.HasCompleted); + Assert.IsNotNull(hyperVCollectorResource); + + // Get Hyper-V Collector + hyperVCollectorResource = await hyperVCollectorCollection.GetAsync(hyperVCollectorName); + Assert.IsNotNull(hyperVCollectorResource); + Assert.AreEqual(hyperVCollectorResource.Data.Name, hyperVCollectorName); + + // Get All Hyper-V Collectors + var allHyperVCollectors = hyperVCollectorCollection.GetAllAsync().ToEnumerableAsync(); + Assert.IsNotNull(allHyperVCollectors); + Assert.GreaterOrEqual(allHyperVCollectors.Result.Count, 1); + + // Delete Hyper-V Collector + await hyperVCollectorResource.DeleteAsync(WaitUntil.Completed); + } + + [TestCase] + [RecordedTest] + public async Task TestVMwareCollectorOperations() + { + string rgName = rg.Id.Name; + var vmwareCollectorCollection = assessmentProjectResource.GetMigrationAssessmentVMwareCollectors(); + + // Create VMware Collector + var vmwareCollectorData = new MigrationAssessmentVMwareCollectorData() + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + AgentProperties = agentProperties, + DiscoverySiteId = + string.Format($"/subscriptions/{targetSubscriptionId}/resourceGroups/{rgName}/providers/Microsoft.OffAzure/VMwareSites/{Recording.GenerateAssetName("site-")}"), + }; + string vmwareCollectorName = Recording.GenerateAssetName("vmwareCollector-"); + var vmwareCollectorResponse = + await vmwareCollectorCollection.CreateOrUpdateAsync(WaitUntil.Completed, vmwareCollectorName, vmwareCollectorData); + var vmwareCollectorResource = vmwareCollectorResponse.Value; + Assert.IsTrue(vmwareCollectorResponse.HasCompleted); + Assert.IsNotNull(vmwareCollectorResource); + + // Get VMware Collector + vmwareCollectorResource = await vmwareCollectorCollection.GetAsync(vmwareCollectorName); + Assert.IsNotNull(vmwareCollectorResource); + Assert.AreEqual(vmwareCollectorResource.Data.Name, vmwareCollectorName); + + // Get All VMware Collectors + var allVMwareCollectors = vmwareCollectorCollection.GetAllAsync().ToEnumerableAsync(); + Assert.IsNotNull(allVMwareCollectors); + Assert.GreaterOrEqual(allVMwareCollectors.Result.Count, 1); + + // Delete VMware Collector + await vmwareCollectorResource.DeleteAsync(WaitUntil.Completed); + } + + [TestCase] + [RecordedTest] + public async Task TestServerCollectorOperations() + { + string rgName = rg.Id.Name; + var serverCollectorCollection = assessmentProjectResource.GetMigrationAssessmentServerCollectors(); + + // Create Server Collector + var serverCollectorData = new MigrationAssessmentServerCollectorData() + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + AgentProperties = agentProperties, + DiscoverySiteId = + string.Format($"/subscriptions/{targetSubscriptionId}/resourceGroups/{rgName}/providers/Microsoft.OffAzure/ServerSites/{Recording.GenerateAssetName("site-")}"), + }; + string serverCollectorName = Recording.GenerateAssetName("serverCollector-"); + var serverCollectorResponse = + await serverCollectorCollection.CreateOrUpdateAsync(WaitUntil.Completed, serverCollectorName, serverCollectorData); + var serverCollectorResource = serverCollectorResponse.Value; + Assert.IsTrue(serverCollectorResponse.HasCompleted); + Assert.IsNotNull(serverCollectorResource); + + // Get Server Collector + serverCollectorResource = await serverCollectorCollection.GetAsync(serverCollectorName); + Assert.IsNotNull(serverCollectorResource); + Assert.AreEqual(serverCollectorResource.Data.Name, serverCollectorName); + + // Get All Server Collectors + var allServerCollectors = serverCollectorCollection.GetAllAsync().ToEnumerableAsync(); + Assert.IsNotNull(allServerCollectors); + Assert.GreaterOrEqual(allServerCollectors.Result.Count, 1); + + // Delete Server Collector + await serverCollectorResource.DeleteAsync(WaitUntil.Completed); + } + + [TestCase] + [RecordedTest] + public async Task TestImportCollectorOperations() + { + string rgName = rg.Id.Name; + + var importCollectorCollection = assessmentProjectResource.GetMigrationAssessmentImportCollectors(); + + // Create Import Collector + var importCollectorData = new MigrationAssessmentImportCollectorData() + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + DiscoverySiteId = + string.Format($"/subscriptions/{targetSubscriptionId}/resourceGroups/{rgName}/providers/Microsoft.OffAzure/ImportSites/{Recording.GenerateAssetName("site-")}"), + }; + string importCollectorName = Recording.GenerateAssetName("importCollector-"); + var importCollectorResponse = + await importCollectorCollection.CreateOrUpdateAsync(WaitUntil.Completed, importCollectorName, importCollectorData); + var importCollectorResource = importCollectorResponse.Value; + Assert.IsTrue(importCollectorResponse.HasCompleted); + Assert.IsNotNull(importCollectorResource); + + // Get Import Collector + importCollectorResource = await importCollectorCollection.GetAsync(importCollectorName); + Assert.IsNotNull(importCollectorResource); + Assert.AreEqual(importCollectorResource.Data.Name, importCollectorName); + + // Get All Import Collectors + var allImportCollectors = importCollectorCollection.GetAllAsync().ToEnumerableAsync(); + Assert.IsNotNull(allImportCollectors); + Assert.GreaterOrEqual(allImportCollectors.Result.Count, 1); + + // Delete Import Collector + await importCollectorResource.DeleteAsync(WaitUntil.Completed); + } + + [TestCase] + [RecordedTest] + public async Task TestSqlCollectorOperations() + { + string rgName = rg.Id.Name; + var vmwareCollectorCollection = assessmentProjectResource.GetMigrationAssessmentVMwareCollectors(); + + // Create VMware Collector + var vmwareCollectorData = new MigrationAssessmentVMwareCollectorData() + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + AgentProperties = agentProperties, + DiscoverySiteId = + string.Format($"/subscriptions/{targetSubscriptionId}/resourceGroups/{rgName}/providers/Microsoft.OffAzure/VMwareSites/{Recording.GenerateAssetName("site-")}"), + }; + string vmwareCollectorName = Recording.GenerateAssetName("vmwareCollector-"); + var vmwareCollectorResponse = + await vmwareCollectorCollection.CreateOrUpdateAsync(WaitUntil.Completed, vmwareCollectorName, vmwareCollectorData); + var vmwareCollectorResource = vmwareCollectorResponse.Value; + Assert.IsTrue(vmwareCollectorResponse.HasCompleted); + Assert.IsNotNull(vmwareCollectorResource); + + var sqlAgentProperties = new CollectorAgentPropertiesBase() + { + Id = Recording.GenerateAssetName("agentId-"), + Version = "2.0.1993.19", + LastHeartbeatOn = DateTimeOffset.Parse("2022-07-07T14:25:35.708325Z"), + SpnDetails = new CollectorAgentSpnPropertiesBase() + { + Authority = $"https://login.windows.net/{tenantId}", + ApplicationId = "5db4fda9-7d3d-410e-ba13-a84ec7d2f01f", + Audience = Recording.GenerateAssetName("audience-"), + ObjectId = "2354347c-7ed1-44c3-8f39-b3a972e3ce0e", + TenantId = tenantId, + }, + }; + + var sqlCollectorCollection = assessmentProjectResource.GetMigrationAssessmentSqlCollectors(); + + // Create SQL Collector + var sqlCollectorData = new MigrationAssessmentSqlCollectorData() + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + AgentProperties = sqlAgentProperties, + DiscoverySiteId = + string.Format($"{vmwareCollectorResource.Id}/SqlSites/{Recording.GenerateAssetName("site-")}"), + }; + string sqlCollectorName = Recording.GenerateAssetName("sqlCollector-"); + var sqlCollectorResponse = + await sqlCollectorCollection.CreateOrUpdateAsync(WaitUntil.Completed, sqlCollectorName, sqlCollectorData); + var sqlCollectorResource = sqlCollectorResponse.Value; + Assert.IsTrue(sqlCollectorResponse.HasCompleted); + Assert.IsNotNull(sqlCollectorResource); + + // Get SQL Collector + sqlCollectorResource = await sqlCollectorCollection.GetAsync(sqlCollectorName); + Assert.IsNotNull(sqlCollectorResource); + Assert.AreEqual(sqlCollectorResource.Data.Name, sqlCollectorName); + + // Get All SQL Collectors + var allSqlCollectors = sqlCollectorCollection.GetAllAsync().ToEnumerableAsync(); + Assert.IsNotNull(allSqlCollectors); + Assert.GreaterOrEqual(allSqlCollectors.Result.Count, 1); + + // Delete SQL Collector + await sqlCollectorResource.DeleteAsync(WaitUntil.Completed); + await vmwareCollectorResource.DeleteAsync(WaitUntil.Completed); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/Tests/MigrationAssessmentCommonTests.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/Tests/MigrationAssessmentCommonTests.cs new file mode 100644 index 000000000000..714028fb37d4 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/Tests/MigrationAssessmentCommonTests.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Tests +{ + public class MigrationAssessmentCommonTests : MigrationAssessmentManagementTestBase + { + private static AzureLocation targetRegion; + private static string targetSubscriptionId; + private static ResourceGroupResource rg; + private static MigrationAssessmentAssessmentProjectResource assessmentProjectResource; + + public MigrationAssessmentCommonTests(bool isAsync) : base(isAsync) + { + } + + [SetUp] + public async Task Setup() + { + targetRegion = AzureLocation.BrazilSouth; + targetSubscriptionId = DefaultSubscription.Data.SubscriptionId; + rg = await CreateResourceGroup( + DefaultSubscription, + "SdkTest-Net-", + targetRegion); + + string assessmentProjName = Recording.GenerateAssetName("assessmentProj-"); + + var assessmentProjectData = new MigrationAssessmentAssessmentProjectData(targetRegion); + var assessmentProjectCollection = rg.GetMigrationAssessmentAssessmentProjects(); + + // Create Assessment Project + var response = + await assessmentProjectCollection.CreateOrUpdateAsync(WaitUntil.Completed, assessmentProjName, assessmentProjectData); + await response.WaitForCompletionAsync(); + assessmentProjectResource = response.Value; + Assert.IsTrue(response.HasCompleted); + Assert.IsNotNull(assessmentProjectResource); + } + + [TearDown] + public async Task Cleanup() + { + if (rg != null) + { + await rg.DeleteAsync(WaitUntil.Completed); + } + } + + [TestCase] + [RecordedTest] + public async Task TestAssessmentGroupOperations() + { + string rgName = rg.Id.Name; + var assessmentProjName = assessmentProjectResource.Id.Name; + var collection = assessmentProjectResource.GetMigrationAssessmentGroups(); + + // Create Assessment Group + var data = new MigrationAssessmentGroupData() + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + GroupType = MigrationAssessmentGroupType.Default, + }; + string groupName = Recording.GenerateAssetName("group-"); + var groupResponse = + await collection.CreateOrUpdateAsync(WaitUntil.Completed, groupName, data); + var groupResource = groupResponse.Value; + Assert.IsTrue(groupResponse.HasCompleted); + Assert.IsNotNull(groupResource); + + // Get Assessment Group + groupResource = await collection.GetAsync(groupName); + Assert.AreEqual(MigrationAssessmentGroupStatus.Completed, groupResource.Data.GroupStatus); + Assert.IsNotNull(groupResource.Id); + + // Get All Assessment Groups + var allGroups = collection.GetAllAsync().ToEnumerableAsync(); + Assert.IsNotNull(allGroups); + Assert.GreaterOrEqual(allGroups.Result.Count, 1); + + // Update Machines in Assessment Group + MigrateGroupUpdateContent content = new MigrateGroupUpdateContent() + { + ETag = new ETag("*"), + Properties = new MigrateGroupUpdateProperties() + { + OperationType = MigrateGroupUpdateOperationType.Add, + Machines = + { + string.Format($"/subscriptions/{targetSubscriptionId}/resourceGroups/{rgName}/providers/Microsoft.Migrate/assessmentprojects/{assessmentProjName}/machines/18895660-c5e5-4247-8cfc-cd24e1fe57f3") + }, + }, + }; + var updateMachinesResponse = await groupResource.UpdateMachinesAsync(WaitUntil.Completed, content); + var updatedGroupResource = updateMachinesResponse.Value; + Assert.IsTrue(updateMachinesResponse.HasCompleted); + Assert.IsNotNull(updatedGroupResource); + + // Delete Assessment Group + await groupResource.DeleteAsync(WaitUntil.Completed); + } + + [TestCase] + [RecordedTest] + public async Task TestAssessmentOptionsOperations() + { + string assessmentOptionsName = "default"; + MigrationAssessmentAssessmentOptionCollection collection = assessmentProjectResource.GetMigrationAssessmentAssessmentOptions(); + + // Get Assessment Options + var assessmentOptionResponse = await collection.GetAsync(assessmentOptionsName); + var assessmentOptionsResource = assessmentOptionResponse.Value; + Assert.IsNotNull(assessmentOptionsResource); + Assert.AreEqual(assessmentOptionsResource.Data.Name, assessmentOptionsName); + + // Get All Assessment Options + var allAssessmentOptions = await collection.GetAllAsync().ToEnumerableAsync(); + Assert.IsNotNull(allAssessmentOptions); + Assert.GreaterOrEqual(allAssessmentOptions.Count, 1); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/Tests/MigrationAssessmentPrivateTests.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/Tests/MigrationAssessmentPrivateTests.cs new file mode 100644 index 000000000000..3f4ca77fe5b4 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/Tests/MigrationAssessmentPrivateTests.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Linq; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.Resources.Models; +using Moq; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Tests +{ + public class MigrationAssessmentPrivateTests : MigrationAssessmentManagementTestBase + { + public MigrationAssessmentPrivateTests(bool isAsync) : base(isAsync) + { + } + + [TestCase] + [RecordedTest] + public async Task TestPrivateEndpointConnectionOperations() + { + AzureLocation targetRegion = AzureLocation.EastUS; + string targetSubscriptionId = DefaultSubscription.Data.SubscriptionId; + ResourceGroupResource rg = await DefaultSubscription.GetResourceGroups().GetAsync("sakanwar"); + + // Get Assessment Project + var response = await rg.GetMigrationAssessmentAssessmentProjectAsync("ccy-pe1950project"); + var assessmentProjectResource = response.Value; + Assert.IsNotNull(assessmentProjectResource); + + string privateEndpointConnectionName = "ccy-pe1950project1581pe.93ce5be1-e545-434b-93e5-d4a4d1a705f0"; + + var collectionResponse = assessmentProjectResource.GetMigrationAssessmentPrivateEndpointConnections(); + + // Get All Private Endpoint Connections + var privateEndpointConnectionCollection = await collectionResponse.GetAllAsync().ToEnumerableAsync(); + Assert.IsNotNull(privateEndpointConnectionCollection); + Assert.GreaterOrEqual(privateEndpointConnectionCollection.Count, 1); + + var privateEndpointConnection = privateEndpointConnectionCollection.FirstOrDefault(); + Assert.IsNotNull(privateEndpointConnection); + + // Create Private Endpoint Connection + var privateEndpointConnectionData = + new MigrationAssessmentPrivateEndpointConnectionData() + { + ConnectionState = new MigrationAssessmentPrivateLinkServiceConnectionState() + { + Status = MigrationAssessmentPrivateEndpointServiceConnectionStatus.Approved, + Description = "", + ActionsRequired = "", + }, + PrivateEndpoint = new SubResource(), + }; + + var privateEndpointConnectionResponse = + await collectionResponse.CreateOrUpdateAsync(WaitUntil.Completed, privateEndpointConnectionName, privateEndpointConnectionData); + var privateEndpointConnectionResource = privateEndpointConnectionResponse.Value; + Assert.IsTrue(privateEndpointConnectionResponse.HasCompleted); + Assert.IsNotNull(privateEndpointConnectionResource); + + // Get Private Endpoint Connection + privateEndpointConnectionResource = await collectionResponse.GetAsync(privateEndpointConnectionName); + Assert.IsNotNull(privateEndpointConnectionResource); + Assert.AreEqual(privateEndpointConnectionResource.Data.Name, privateEndpointConnectionName); + + // Delete Private Endpoint Connection + await privateEndpointConnectionResource.DeleteAsync(WaitUntil.Completed); + } + + [TestCase] + [RecordedTest] + public async Task TestPrivateLinkServiceOperations() + { + AzureLocation targetRegion = AzureLocation.CentralUS; + string targetSubscriptionId = DefaultSubscription.Data.SubscriptionId; + ResourceGroupResource rg = await DefaultSubscription.GetResourceGroups().GetAsync("sdktest"); + + // Get Assessment Project + var response = await rg.GetMigrationAssessmentAssessmentProjectAsync("privateendpoint-test4be2project"); + var assessmentProjectResource = response.Value; + Assert.IsNotNull(assessmentProjectResource); + + // Get All Private Link Services + var privateLinkServiceCollection = assessmentProjectResource.GetMigrationAssessmentPrivateLinkResources(); + var privateLinkServiceResponse = + await privateLinkServiceCollection.GetAllAsync().ToEnumerableAsync(); + Assert.IsNotNull(privateLinkServiceResponse); + Assert.GreaterOrEqual(privateLinkServiceResponse.Count, 1); + + string privateLinkResourceName = "Default"; + var privateLinkServiceResource = await privateLinkServiceCollection.GetAsync(privateLinkResourceName); + Assert.IsNotNull(privateLinkServiceResource); + Assert.AreEqual(privateLinkServiceResource.Value.Data.Name, privateLinkResourceName); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/Tests/MigrationAssessmentProjectTests.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/Tests/MigrationAssessmentProjectTests.cs new file mode 100644 index 000000000000..a119b378ec0e --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/Tests/MigrationAssessmentProjectTests.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Tests +{ + public class MigrationAssessmentProjectTests : MigrationAssessmentManagementTestBase + { + private static AzureLocation targetRegion; + private static string targetSubscriptionId; + private static ResourceGroupResource rg; + private static MigrationAssessmentAssessmentProjectResource assessmentProjectResource; + + public MigrationAssessmentProjectTests(bool isAsync) : base(isAsync) + { + } + + [SetUp] + public async Task Setup() + { + targetRegion = AzureLocation.BrazilSouth; + targetSubscriptionId = DefaultSubscription.Data.SubscriptionId; + rg = await CreateResourceGroup( + DefaultSubscription, + "SdkTest-Net-", + targetRegion); + + string assessmentProjName = Recording.GenerateAssetName("assessmentProj-"); + + var assessmentProjectData = new MigrationAssessmentAssessmentProjectData(targetRegion); + var assessmentProjectCollection = rg.GetMigrationAssessmentAssessmentProjects(); + + // Create Assessment Project + var response = + await assessmentProjectCollection.CreateOrUpdateAsync(WaitUntil.Completed, assessmentProjName, assessmentProjectData); + await response.WaitForCompletionAsync(); + assessmentProjectResource = response.Value; + Assert.IsTrue(response.HasCompleted); + Assert.IsNotNull(assessmentProjectResource); + } + + [TearDown] + public async Task Cleanup() + { + if (rg != null) + { + await rg.DeleteAsync(WaitUntil.Completed); + } + } + + [TestCase] + [RecordedTest] + public async Task TestAssessmentProjectOperations() + { + string rgName = rg.Id.Name; + var assessmentProjectCollection = rg.GetMigrationAssessmentAssessmentProjects(); + + string assessmentProjName = assessmentProjectResource.Data.Name; + + // Get Assessment Project + assessmentProjectResource = await assessmentProjectCollection.GetAsync(assessmentProjName); + Assert.AreEqual(MigrationAssessmentProvisioningState.Succeeded, assessmentProjectResource.Data.ProvisioningState); + Assert.IsNotNull(assessmentProjectResource.Id); + + // Update Assessment Project + var assessmentProjectPatch = new MigrationAssessmentAssessmentProjectPatch(); + assessmentProjectPatch.Tags.Add("Key1", "TestPatchValue"); + var response = await assessmentProjectResource.UpdateAsync(WaitUntil.Completed, assessmentProjectPatch); + assessmentProjectResource = response.Value; + string assessmentProjectTagValue = string.Empty; + Assert.IsTrue(assessmentProjectResource.Data.Tags.TryGetValue("Key1", out assessmentProjectTagValue)); + Assert.AreEqual(assessmentProjectTagValue, "TestPatchValue"); + + // Delete Assessment Project + await assessmentProjectResource.DeleteAsync(WaitUntil.Completed); + } + + [TestCase] + [RecordedTest] + public async Task TestAssessmentProjectSummaryOperations() + { + var collection = assessmentProjectResource.GetMigrationAssessmentAssessmentProjectSummaries(); + + // Get Assessment Project Summary + var assessmentProjectSummaryResource = await collection.GetAsync("default"); + Assert.IsNotNull(assessmentProjectSummaryResource); + + // Get All Assessment Project Summaries + var allAssessmentProjectSummaries = collection.GetAllAsync().ToEnumerableAsync(); + Assert.IsNotNull(allAssessmentProjectSummaries); + Assert.GreaterOrEqual(allAssessmentProjectSummaries.Result.Count, 1); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/Tests/MigrationAvsAssessmentTests.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/Tests/MigrationAvsAssessmentTests.cs new file mode 100644 index 000000000000..ec0b06e8ccef --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/Tests/MigrationAvsAssessmentTests.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Tests +{ + public class MigrationAvsAssessmentTests : MigrationAssessmentManagementTestBase + { + public MigrationAvsAssessmentTests(bool isAsync) : base(isAsync) + { + } + + [TestCase] + [RecordedTest] + public async Task TestAvsAssessmentOperations() + { + AzureLocation targetRegion = AzureLocation.BrazilSouth; + string targetSubscriptionId = DefaultSubscription.Data.SubscriptionId; + ResourceGroupResource rg = await DefaultSubscription.GetResourceGroups().GetAsync("venkatjakka-rvtools"); + + var response = + await rg.GetMigrationAssessmentAssessmentProjectAsync("anf-boliden1307project"); + var assessmentProjectResource = response.Value; + Assert.IsNotNull(assessmentProjectResource); + + var collection = await assessmentProjectResource.GetMigrationAssessmentGroupAsync("testgroup"); + + var assessmentCollection = collection.Value.GetMigrationAssessmentAvsAssessments(); + + // Create AVS Assessment + string assessmentName = "avs-asm0"; + MigrationAssessmentAvsAssessmentData asmData = new MigrationAssessmentAvsAssessmentData() + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + FailuresToTolerateAndRaidLevel = FttAndRaidLevel.Ftt1Raid5, + VcpuOversubscription = 4, + NodeType = AvsNodeType.AV36, + ReservedInstance = AzureReservedInstance.None, + MemOvercommit = 1.5, + DedupeCompression = 1.5, + IsStretchClusterEnabled = false, + AzureLocation = AzureLocation.BrazilSouth, + AzureOfferCode = AzureOfferCode.MSAZR0003P, + Currency = AzureCurrency.USD, + ScalingFactor = 2, + Percentile = PercentileOfUtilization.Percentile50, + TimeRange = AssessmentTimeRange.Month, + PerfDataStartOn = DateTimeOffset.Parse("2024-09-26T09:36:48.491Z"), + PerfDataEndOn = DateTimeOffset.Parse("2024-10-26T09:36:48.491Z"), + DiscountPercentage = 10, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased, + }; + + var assessmentResponse = await assessmentCollection.CreateOrUpdateAsync(WaitUntil.Completed, assessmentName, asmData); + var assessmentResource = assessmentResponse.Value; + Assert.IsTrue(assessmentResponse.HasCompleted); + Assert.IsNotNull(assessmentResource); + Assert.AreEqual(assessmentResource.Data.Name, assessmentName); + + // Get Assessment + assessmentResource = await assessmentCollection.GetAsync(assessmentName); + Assert.IsNotNull(assessmentResource); + Assert.AreEqual(assessmentResource.Data.Name, assessmentName); + + // Get All Assessments + var allAssessments = await assessmentCollection.GetAllAsync().ToEnumerableAsync(); + Assert.IsNotNull(allAssessments); + Assert.GreaterOrEqual(allAssessments.Count, 1); + + // Download Assessment Report + BinaryData body = BinaryData.FromObjectAsJson(new Dictionary() + { + }); + var downloadReportResponse = await assessmentResource.DownloadUrlAsync(WaitUntil.Completed, body); + Assert.IsNotNull(downloadReportResponse.Value.AssessmentReportUri); + + // Get Assessed Machines + var assessedMachines = await assessmentResource.GetMigrationAssessmentAvsAssessedMachines().ToEnumerableAsync(); + Assert.IsNotNull(assessedMachines); + Assert.GreaterOrEqual(assessedMachines.Count, 1); + + // Get an Assessed Machine + var assessedMachine = await assessmentResource.GetMigrationAssessmentAvsAssessedMachineAsync(assessedMachines.First().Data.Name); + Assert.IsNotNull(assessedMachine); + + // Delete Assessment + await assessmentResource.DeleteAsync(WaitUntil.Completed); + } + + [TestCase] + [RecordedTest] + public async Task TestAvsAssessmentOptionsOperations() + { + string assessmentOptionsName = "default"; + AzureLocation targetRegion = AzureLocation.BrazilSouth; + string targetSubscriptionId = DefaultSubscription.Data.SubscriptionId; + ResourceGroupResource rg = await DefaultSubscription.GetResourceGroups().GetAsync("venkatjakka-rvtools"); + + var response = + await rg.GetMigrationAssessmentAssessmentProjectAsync("anf-boliden1307project"); + var assessmentProjectResource = response.Value; + Assert.IsNotNull(assessmentProjectResource); + MigrationAssessmentAvsAssessmentOptionCollection collection = assessmentProjectResource.GetMigrationAssessmentAvsAssessmentOptions(); + + // Get Assessment Options + var assessmentOptionResponse = await collection.GetAsync(assessmentOptionsName); + var assessmentOptionsResource = assessmentOptionResponse.Value; + Assert.IsNotNull(assessmentOptionsResource); + Assert.AreEqual(assessmentOptionsResource.Data.Name, assessmentOptionsName); + + // Get All Assessment Options + var allAssessmentOptions = await collection.GetAllAsync().ToEnumerableAsync(); + Assert.IsNotNull(allAssessmentOptions); + Assert.GreaterOrEqual(allAssessmentOptions.Count, 1); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/Tests/MigrationMachineAssessmentTests.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/Tests/MigrationMachineAssessmentTests.cs new file mode 100644 index 000000000000..3df1c20afde5 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/Tests/MigrationMachineAssessmentTests.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Tests +{ + public class MigrationMachineAssessmentTests : MigrationAssessmentManagementTestBase + { + public MigrationMachineAssessmentTests(bool isAsync) : base(isAsync) + { + } + + [TestCase] + [RecordedTest] + public async Task TestMachineOperations() + { + AzureLocation targetRegion = AzureLocation.BrazilSouth; + string targetSubscriptionId = DefaultSubscription.Data.SubscriptionId; + ResourceGroupResource rg = await DefaultSubscription.GetResourceGroups().GetAsync("sdktest-net"); + + var response = + await rg.GetMigrationAssessmentAssessmentProjectAsync("sdktestproject"); + var assessmentProjectResource = response.Value; + Assert.IsNotNull(assessmentProjectResource); + + var machineCollection = assessmentProjectResource.GetMigrationAssessmentMachines(); + + // Get All Machines + var allMachines = await machineCollection.GetAllAsync().ToEnumerableAsync(); + Assert.IsNotNull(allMachines); + Assert.GreaterOrEqual(allMachines.Count, 1); + + // Get Machine + var machineResponse = await machineCollection.GetAsync(allMachines.First().Data.Name); + var machineResource = machineResponse.Value; + Assert.IsNotNull(machineResource); + } + + [TestCase] + [RecordedTest] + public async Task TestAssessmentOperations() + { + AzureLocation targetRegion = AzureLocation.BrazilSouth; + string targetSubscriptionId = DefaultSubscription.Data.SubscriptionId; + ResourceGroupResource rg = await DefaultSubscription.GetResourceGroups().GetAsync("sdktest-net"); + + var response = + await rg.GetMigrationAssessmentAssessmentProjectAsync("sdktestproject"); + var assessmentProjectResource = response.Value; + Assert.IsNotNull(assessmentProjectResource); + + var collection = await assessmentProjectResource.GetMigrationAssessmentGroupAsync("sdktestgroup"); + + var assessmentCollection = collection.Value.GetMigrationAssessmentAssessments(); + + // Create Assessment + string assessmentName = "asm1"; + MigrationAssessmentAssessmentData asmData = new MigrationAssessmentAssessmentData() + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + EASubscriptionId = null, + AzurePricingTier = AzurePricingTier.Standard, + AzureStorageRedundancy = AzureStorageRedundancy.Unknown, + ReservedInstance = AzureReservedInstance.None, + AzureHybridUseBenefit = AzureHybridUseBenefit.Unknown, + AzureDiskTypes = + { + AzureDiskType.Premium,AzureDiskType.StandardSsd + }, + AzureVmFamilies = + { + AzureVmFamily.DSeries,AzureVmFamily.Lsv2Series,AzureVmFamily.MSeries,AzureVmFamily.Mdsv2Series,AzureVmFamily.Msv2Series,AzureVmFamily.Mv2Series + }, + VmUptime = new VmUptime() + { + DaysPerMonth = 13, + HoursPerDay = 26, + }, + AzureLocation = AzureLocation.BrazilSouth, + AzureOfferCode = AzureOfferCode.SavingsPlan1Year, + Currency = AzureCurrency.USD, + ScalingFactor = 2, + Percentile = PercentileOfUtilization.Percentile50, + TimeRange = AssessmentTimeRange.Month, + PerfDataStartOn = DateTimeOffset.Parse("2024-09-26T09:36:48.491Z"), + PerfDataEndOn = DateTimeOffset.Parse("2024-10-26T09:36:48.491Z"), + DiscountPercentage = 10, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased, + }; + + var assessmentResponse = await assessmentCollection.CreateOrUpdateAsync(WaitUntil.Completed, assessmentName, asmData); + var assessmentResource = assessmentResponse.Value; + Assert.IsTrue(assessmentResponse.HasCompleted); + Assert.IsNotNull(assessmentResource); + Assert.AreEqual(assessmentResource.Data.Name, assessmentName); + + // Get Assessment + assessmentResource = await assessmentCollection.GetAsync(assessmentName); + Assert.IsNotNull(assessmentResource); + Assert.AreEqual(assessmentResource.Data.Name, assessmentName); + + // Get All Assessments + var allAssessments = await assessmentCollection.GetAllAsync().ToEnumerableAsync(); + Assert.IsNotNull(allAssessments); + Assert.GreaterOrEqual(allAssessments.Count, 1); + + // Download Assessment Report + BinaryData body = BinaryData.FromObjectAsJson(new Dictionary() + { + }); + var downloadReportResponse = await assessmentResource.DownloadUrlAsync(WaitUntil.Completed, body); + Assert.IsNotNull(downloadReportResponse.Value.AssessmentReportUri); + + // Get Assessed Machines + var assessedMachines = await assessmentResource.GetAssessedMachines().ToEnumerableAsync(); + Assert.IsNotNull(assessedMachines); + Assert.GreaterOrEqual(assessedMachines.Count, 1); + + // Get an Assessed Machine + var assessedMachine = await assessmentResource.GetAssessedMachineAsync(assessedMachines.First().Data.Name); + Assert.IsNotNull(assessedMachine); + + // Delete Assessment + await assessmentResource.DeleteAsync(WaitUntil.Completed); + } + } +} diff --git a/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/Tests/MigrationSqlAssessmentTests.cs b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/Tests/MigrationSqlAssessmentTests.cs new file mode 100644 index 000000000000..cd6b18c1ffe2 --- /dev/null +++ b/sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment/tests/Tests/MigrationSqlAssessmentTests.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.Migration.Assessment.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migration.Assessment.Tests +{ + public class MigrationSqlAssessmentTests : MigrationAssessmentManagementTestBase + { + public MigrationSqlAssessmentTests(bool isAsync) : base(isAsync) + { + } + + [TestCase] + [RecordedTest] + public async Task TestSqlAssessmentOperations() + { + AzureLocation targetRegion = AzureLocation.BrazilSouth; + string targetSubscriptionId = DefaultSubscription.Data.SubscriptionId; + ResourceGroupResource rg = await DefaultSubscription.GetResourceGroups().GetAsync("dhlodhiCCY"); + + var response = + await rg.GetMigrationAssessmentAssessmentProjectAsync("sql-ecy-05197632project"); + var assessmentProjectResource = response.Value; + Assert.IsNotNull(assessmentProjectResource); + + var collection = await assessmentProjectResource.GetMigrationAssessmentGroupAsync("suyashtest"); + + var assessmentCollection = collection.Value.GetMigrationAssessmentSqlAssessmentV2s(); + + // Create Sql Assessment + string assessmentName = "Sql-asm0"; + MigrationAssessmentSqlAssessmentV2Data asmData = new MigrationAssessmentSqlAssessmentV2Data() + { + ProvisioningState = MigrationAssessmentProvisioningState.Succeeded, + OSLicense = MigrationAssessmentOSLicense.Unknown, + EnvironmentType = AssessmentEnvironmentType.Production, + OptimizationLogic = SqlOptimizationLogic.MinimizeCost, + ReservedInstanceForVm = AzureReservedInstance.None, + GroupType = MigrationAssessmentGroupType.Default, + AssessmentType = AssessmentType.SqlAssessment, + SqlServerLicense = SqlServerLicense.Unknown, + ReservedInstance = AzureReservedInstance.None, + AzureSecurityOfferingType = AzureSecurityOfferingType.NO, + EnableHadrAssessment = false, + IsInternetAccessAvailable = true, + AzureSqlVmSettings = new SqlVmSettings() + { + InstanceSeries = new List() + { + AzureVmFamily.MSeries + } + }, + MultiSubnetIntent = MultiSubnetIntent.None, + AsyncCommitModeIntent = AsyncCommitModeIntent.None, + AzureSqlDatabaseSettings = new SqlDBSettings() + { + AzureSqlComputeTier = MigrationAssessmentComputeTier.Automatic, + AzureSqlDataBaseType = AzureSqlDataBaseType.Automatic, + AzureSqlServiceTier = AzureSqlServiceTier.Automatic, + AzureSqlPurchaseModel = AzureSqlPurchaseModel.VCore, + }, + AzureSqlManagedInstanceSettings = new SqlMISettings() + { + AzureSqlInstanceType = AzureSqlInstanceType.Automatic, + AzureSqlServiceTier = AzureSqlServiceTier.Automatic + }, + Currency = AzureCurrency.USD, + AzureLocation = AzureLocation.SouthCentralUS, + AzureOfferCode = AzureOfferCode.MSAZR0023P, + AzureOfferCodeForVm = AzureOfferCode.MSAZR0023P, + ScalingFactor = 2, + Percentile = PercentileOfUtilization.Percentile50, + TimeRange = AssessmentTimeRange.Month, + PerfDataStartOn = DateTimeOffset.Parse("2024-09-26T09:36:48.491Z"), + PerfDataEndOn = DateTimeOffset.Parse("2024-10-26T09:36:48.491Z"), + DiscountPercentage = 10, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased + }; + + var assessmentResponse = await assessmentCollection.CreateOrUpdateAsync(WaitUntil.Completed, assessmentName, asmData); + var assessmentResource = assessmentResponse.Value; + Assert.IsTrue(assessmentResponse.HasCompleted); + Assert.IsNotNull(assessmentResource); + Assert.AreEqual(assessmentResource.Data.Name, assessmentName); + + // Get Assessment + assessmentResource = await assessmentCollection.GetAsync(assessmentName); + Assert.IsNotNull(assessmentResource); + Assert.AreEqual(assessmentResource.Data.Name, assessmentName); + + // Get All Assessments + var allAssessments = await assessmentCollection.GetAllAsync().ToEnumerableAsync(); + Assert.IsNotNull(allAssessments); + Assert.GreaterOrEqual(allAssessments.Count, 1); + + // add wait period of 10 mins + await Task.Delay(360000); + + // Download Assessment Report + BinaryData body = BinaryData.FromObjectAsJson(new Dictionary() + { + }); + var downloadReportResponse = await assessmentResource.DownloadUrlAsync(WaitUntil.Completed, body); + Assert.IsNotNull(downloadReportResponse.Value.AssessmentReportUri); + + // Get Assessed Machines + var assessedMachines = await assessmentResource.GetAssessedSqlMachines().ToEnumerableAsync(); + Assert.IsNotNull(assessedMachines); + Assert.GreaterOrEqual(assessedMachines.Count, 1); + + // Get an Assessed Machine + var assessedMachine = await assessmentResource.GetAssessedSqlMachineAsync(assessedMachines.First().Data.Name); + Assert.IsNotNull(assessedMachine); + + // Get Assessed DBs + var assessedDBs = await assessmentResource.GetAssessedSqlDatabaseV2s().ToEnumerableAsync(); + Assert.IsNotNull(assessedDBs); + Assert.GreaterOrEqual(assessedDBs.Count, 1); + + // Get an Assessed DB + var assessedDB = await assessmentResource.GetAssessedSqlDatabaseV2Async(assessedDBs.First().Data.Name); + Assert.IsNotNull(assessedDB); + + // Get Assessed Instances + var assessedInstances = await assessmentResource.GetAssessedSqlInstanceV2s().ToEnumerableAsync(); + Assert.IsNotNull(assessedInstances); + Assert.GreaterOrEqual(assessedInstances.Count, 1); + + // Get an Assessed Machine + var assessedInstance = await assessmentResource.GetAssessedSqlInstanceV2Async(assessedInstances.First().Data.Name); + Assert.IsNotNull(assessedInstance); + + // Get Assessed Machines + var recommendedEntities = await assessmentResource.GetAssessedSqlRecommendedEntities().ToEnumerableAsync(); + Assert.IsNotNull(recommendedEntities); + Assert.GreaterOrEqual(recommendedEntities.Count, 1); + + // Get an Assessed Machine + var recommendedEntity = await assessmentResource.GetAssessedSqlRecommendedEntityAsync(recommendedEntities.First().Data.Name); + Assert.IsNotNull(recommendedEntity); + + // Get Assessment Summary + var assessmentSummary = await assessmentResource.GetMigrationAssessmentSqlAssessmentV2SummaryAsync("default"); + Assert.IsNotNull(assessmentSummary); + + // Delete Assessment + await assessmentResource.DeleteAsync(WaitUntil.Completed); + } + + [TestCase] + [RecordedTest] + public async Task TestSqlAssessmentOptionsOperations() + { + string assessmentOptionsName = "default"; + AzureLocation targetRegion = AzureLocation.BrazilSouth; + string targetSubscriptionId = DefaultSubscription.Data.SubscriptionId; + ResourceGroupResource rg = await DefaultSubscription.GetResourceGroups().GetAsync("dhlodhiCCY"); + + var response = + await rg.GetMigrationAssessmentAssessmentProjectAsync("sql-ecy-05197632project"); + var assessmentProjectResource = response.Value; + Assert.IsNotNull(assessmentProjectResource); + MigrationAssessmentSqlAssessmentOptionCollection collection = assessmentProjectResource.GetMigrationAssessmentSqlAssessmentOptions(); + + // Get Assessment Options + var assessmentOptionResponse = await collection.GetAsync(assessmentOptionsName); + var assessmentOptionsResource = assessmentOptionResponse.Value; + Assert.IsNotNull(assessmentOptionsResource); + Assert.AreEqual(assessmentOptionsResource.Data.Name, assessmentOptionsName); + + // Get All Assessment Options + var allAssessmentOptions = await collection.GetAllAsync().ToEnumerableAsync(); + Assert.IsNotNull(allAssessmentOptions); + Assert.GreaterOrEqual(allAssessmentOptions.Count, 1); + } + } +} diff --git a/sdk/migrationassessment/ci.mgmt.yml b/sdk/migrationassessment/ci.mgmt.yml new file mode 100644 index 000000000000..f3e7aefdb852 --- /dev/null +++ b/sdk/migrationassessment/ci.mgmt.yml @@ -0,0 +1,23 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: none +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/migration.assessment/ci.mgmt.yml + - sdk/migration.assessment/Azure.ResourceManager.Migration.Assessment/ + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: migration.assessment + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.Migration.Assessment + safeName: AzureResourceManagerMigrationAssessment diff --git a/sdk/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml index d8bf790b5988..3e346003fe35 100644 --- a/sdk/resourcemanager/ci.mgmt.yml +++ b/sdk/resourcemanager/ci.mgmt.yml @@ -126,6 +126,8 @@ trigger: - sdk/marketplace/Azure.ResourceManager.Marketplace - sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering - sdk/mediaservices/Azure.ResourceManager.Media + - sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment + - sdk/migrationassessment/Azure.ResourceManager.MigrationAssessment - sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap - sdk/mixedreality/Azure.ResourceManager.MixedReality - sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork @@ -332,6 +334,8 @@ pr: - sdk/marketplace/Azure.ResourceManager.Marketplace - sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering - sdk/mediaservices/Azure.ResourceManager.Media + - sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment + - sdk/migrationassessment/Azure.ResourceManager.MigrationAssessment - sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap - sdk/mixedreality/Azure.ResourceManager.MixedReality - sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork