diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/Azure.ResourceManager.Migrate.sln b/sdk/migrate/Azure.ResourceManager.Migrate/Azure.ResourceManager.Migrate.sln new file mode 100644 index 000000000000..0827a60383b3 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/Azure.ResourceManager.Migrate.sln @@ -0,0 +1,51 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30309.148 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{733B502E-2067-486E-A44C-82F27F7EECBA}") = "Azure.ResourceManager.Migrate", "src\Azure.ResourceManager.Migrate.csproj", "{15296D5A-891C-45D7-B711-063B649074AC}" +EndProject +Project("{733B502E-2067-486E-A44C-82F27F7EECBA}") = "Azure.ResourceManager.Migrate.Tests", "tests\Azure.ResourceManager.Migrate.Tests.csproj", "{DD6007F1-BFD1-49CD-A160-BF2E1CFA6388}" +EndProject +Global + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {08ED6E9B-2D58-48FA-B496-75DC2E9F6614} + 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 + {15296D5A-891C-45D7-B711-063B649074AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {15296D5A-891C-45D7-B711-063B649074AC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {15296D5A-891C-45D7-B711-063B649074AC}.Debug|x64.ActiveCfg = Debug|Any CPU + {15296D5A-891C-45D7-B711-063B649074AC}.Debug|x64.Build.0 = Debug|Any CPU + {15296D5A-891C-45D7-B711-063B649074AC}.Debug|x86.ActiveCfg = Debug|Any CPU + {15296D5A-891C-45D7-B711-063B649074AC}.Debug|x86.Build.0 = Debug|Any CPU + {15296D5A-891C-45D7-B711-063B649074AC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {15296D5A-891C-45D7-B711-063B649074AC}.Release|Any CPU.Build.0 = Release|Any CPU + {15296D5A-891C-45D7-B711-063B649074AC}.Release|x64.ActiveCfg = Release|Any CPU + {15296D5A-891C-45D7-B711-063B649074AC}.Release|x64.Build.0 = Release|Any CPU + {15296D5A-891C-45D7-B711-063B649074AC}.Release|x86.ActiveCfg = Release|Any CPU + {15296D5A-891C-45D7-B711-063B649074AC}.Release|x86.Build.0 = Release|Any CPU + {DD6007F1-BFD1-49CD-A160-BF2E1CFA6388}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DD6007F1-BFD1-49CD-A160-BF2E1CFA6388}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DD6007F1-BFD1-49CD-A160-BF2E1CFA6388}.Debug|x64.ActiveCfg = Debug|Any CPU + {DD6007F1-BFD1-49CD-A160-BF2E1CFA6388}.Debug|x64.Build.0 = Debug|Any CPU + {DD6007F1-BFD1-49CD-A160-BF2E1CFA6388}.Debug|x86.ActiveCfg = Debug|Any CPU + {DD6007F1-BFD1-49CD-A160-BF2E1CFA6388}.Debug|x86.Build.0 = Debug|Any CPU + {DD6007F1-BFD1-49CD-A160-BF2E1CFA6388}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DD6007F1-BFD1-49CD-A160-BF2E1CFA6388}.Release|Any CPU.Build.0 = Release|Any CPU + {DD6007F1-BFD1-49CD-A160-BF2E1CFA6388}.Release|x64.ActiveCfg = Release|Any CPU + {DD6007F1-BFD1-49CD-A160-BF2E1CFA6388}.Release|x64.Build.0 = Release|Any CPU + {DD6007F1-BFD1-49CD-A160-BF2E1CFA6388}.Release|x86.ActiveCfg = Release|Any CPU + {DD6007F1-BFD1-49CD-A160-BF2E1CFA6388}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/CHANGELOG.md b/sdk/migrate/Azure.ResourceManager.Migrate/CHANGELOG.md new file mode 100644 index 000000000000..349f18ed58f2 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/CHANGELOG.md @@ -0,0 +1,15 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### General New Features + + - 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 follows the [Azure SDK Design Guidelines for .NET](https://azure.github.io/azure-sdk/dotnet_introduction.html) which provide a number of core capabilities that are shared amongst all Azure SDKs, including the intuitive Azure Identity library, an HTTP Pipeline with custom policies, error-handling, distributed tracing, and much more. + +This is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, please submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). \ No newline at end of file diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/Directory.Build.props b/sdk/migrate/Azure.ResourceManager.Migrate/Directory.Build.props new file mode 100644 index 000000000000..1a9611bd4924 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/README.md b/sdk/migrate/Azure.ResourceManager.Migrate/README.md new file mode 100644 index 000000000000..1dc1bd48da7c --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/README.md @@ -0,0 +1,76 @@ +# Azure migrate Management client library for .NET + +This package follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html) which provide a number of core capabilities that are shared amongst all Azure SDKs, including the intuitive Azure Identity library, an HTTP Pipeline with custom policies, error-handling, distributed tracing, and much more. + +## Getting started + +### Install the package + +Install the Azure migrate management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.Migrate --prerelease +``` + +### Prerequisites + +* You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) + +### Authenticate the Client + +To create an authenticated client and start interacting with Azure resources, please 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 Azure .NET SDK 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://docs.microsoft.com/samples/browse/?branch=master&languages=csharp&term=managing%20using%20Azure%20.NET%20SDK) + +## 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 on Azure SDK, please refer to [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 +(e.g., label, comment). Simply follow the instructions provided by the +bot. You will only need to do this 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 additional 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/migrate/Azure.ResourceManager.Migrate/api/Azure.ResourceManager.Migrate.netstandard2.0.cs b/sdk/migrate/Azure.ResourceManager.Migrate/api/Azure.ResourceManager.Migrate.netstandard2.0.cs new file mode 100644 index 000000000000..f12f59c3ee63 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/api/Azure.ResourceManager.Migrate.netstandard2.0.cs @@ -0,0 +1,1602 @@ +namespace Azure.ResourceManager.Migrate +{ + 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(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 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 + { + internal AssessedMachineData() { } + public Azure.ETag? ETag { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AssessedMachineProperties Properties { get { throw null; } } + } + public partial class AssessedMachineResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AssessedMachineResource() { } + public virtual Azure.ResourceManager.Migrate.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; } + } + public partial class AssessmentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AssessmentCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string assessmentName, Azure.ResourceManager.Migrate.AssessmentData 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.Migrate.AssessmentData 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; } + 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 AssessmentData : Azure.ResourceManager.Models.ResourceData + { + public AssessmentData(Azure.ResourceManager.Migrate.Models.AssessmentProperties properties) { } + public Azure.ETag? ETag { get { throw null; } set { } } + public Azure.ResourceManager.Migrate.Models.AssessmentProperties Properties { get { throw null; } set { } } + } + public partial class AssessmentResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AssessmentResource() { } + public virtual Azure.ResourceManager.Migrate.AssessmentData 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.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.Migrate.AssessedMachineCollection GetAssessedMachines() { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetReportDownloadUrl(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetReportDownloadUrlAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.AssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.AssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class GroupCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected GroupCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string groupName, Azure.ResourceManager.Migrate.GroupData 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.Migrate.GroupData 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; } + 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 GroupData : Azure.ResourceManager.Models.ResourceData + { + public GroupData(Azure.ResourceManager.Migrate.Models.GroupProperties properties) { } + public Azure.ETag? ETag { get { throw null; } set { } } + public Azure.ResourceManager.Migrate.Models.GroupProperties Properties { get { throw null; } set { } } + } + public partial class GroupResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected GroupResource() { } + public virtual Azure.ResourceManager.Migrate.GroupData 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 Azure.Response GetAssessment(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAssessmentAsync(string assessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migrate.AssessmentCollection GetAssessments() { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.GroupData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.GroupData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response UpdateMachines(Azure.ResourceManager.Migrate.Models.UpdateGroupBody groupUpdateProperties = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateMachinesAsync(Azure.ResourceManager.Migrate.Models.UpdateGroupBody groupUpdateProperties = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class HyperVCollectorCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected HyperVCollectorCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string hyperVCollectorName, Azure.ResourceManager.Migrate.HyperVCollectorData 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.Migrate.HyperVCollectorData 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; } + 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 HyperVCollectorData : Azure.ResourceManager.Models.ResourceData + { + public HyperVCollectorData() { } + public Azure.ETag? ETag { get { throw null; } set { } } + public Azure.ResourceManager.Migrate.Models.CollectorProperties Properties { get { throw null; } set { } } + } + public partial class HyperVCollectorResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected HyperVCollectorResource() { } + public virtual Azure.ResourceManager.Migrate.HyperVCollectorData 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; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.HyperVCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.HyperVCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ImportCollectorCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ImportCollectorCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string importCollectorName, Azure.ResourceManager.Migrate.ImportCollectorData 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.Migrate.ImportCollectorData 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; } + 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 ImportCollectorData : Azure.ResourceManager.Models.ResourceData + { + public ImportCollectorData() { } + public Azure.ETag? ETag { get { throw null; } set { } } + public Azure.ResourceManager.Migrate.Models.ImportCollectorProperties Properties { get { throw null; } set { } } + } + public partial class ImportCollectorResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ImportCollectorResource() { } + public virtual Azure.ResourceManager.Migrate.ImportCollectorData 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; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.ImportCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.ImportCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MachineCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MachineCollection() { } + 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(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 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 MachineData : Azure.ResourceManager.Models.ResourceData + { + internal MachineData() { } + public Azure.ETag? ETag { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.MachineProperties Properties { get { throw null; } } + } + public partial class MachineResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MachineResource() { } + public virtual Azure.ResourceManager.Migrate.MachineData 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; } + } + public static partial class MigrateExtensions + { + public static Azure.ResourceManager.Migrate.AssessedMachineResource GetAssessedMachineResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migrate.AssessmentResource GetAssessmentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migrate.GroupResource GetGroupResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migrate.HyperVCollectorResource GetHyperVCollectorResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migrate.ImportCollectorResource GetImportCollectorResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migrate.MachineResource GetMachineResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migrate.MigratePrivateEndpointConnectionResource GetMigratePrivateEndpointConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migrate.MigratePrivateLinkResource GetMigratePrivateLinkResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetProject(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetProjectAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Migrate.ProjectResource GetProjectResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migrate.ProjectCollection GetProjects(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetProjects(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetProjectsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Migrate.ServerCollectorResource GetServerCollectorResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migrate.VMwareCollectorResource GetVMwareCollectorResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MigratePrivateEndpointConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigratePrivateEndpointConnectionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.Migrate.MigratePrivateEndpointConnectionData 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.Migrate.MigratePrivateEndpointConnectionData 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; } + 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 MigratePrivateEndpointConnectionData : Azure.ResourceManager.Models.ResourceData + { + public MigratePrivateEndpointConnectionData(Azure.ResourceManager.Migrate.Models.PrivateEndpointConnectionProperties properties) { } + public Azure.ETag? ETag { get { throw null; } set { } } + public Azure.ResourceManager.Migrate.Models.PrivateEndpointConnectionProperties Properties { get { throw null; } set { } } + } + public partial class MigratePrivateEndpointConnectionResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigratePrivateEndpointConnectionResource() { } + public virtual Azure.ResourceManager.Migrate.MigratePrivateEndpointConnectionData 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; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.MigratePrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.MigratePrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MigratePrivateLinkResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MigratePrivateLinkResource() { } + public virtual Azure.ResourceManager.Migrate.MigratePrivateLinkResourceData 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; } + } + public partial class MigratePrivateLinkResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MigratePrivateLinkResourceCollection() { } + 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; } + 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 MigratePrivateLinkResourceData : Azure.ResourceManager.Models.ResourceData + { + internal MigratePrivateLinkResourceData() { } + public Azure.ResourceManager.Migrate.Models.MigratePrivateLinkResourceProperties Properties { get { throw null; } } + } + public partial class ProjectCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ProjectCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string projectName, Azure.ResourceManager.Migrate.ProjectData 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.Migrate.ProjectData 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; } + 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 ProjectData : Azure.ResourceManager.Models.ResourceData + { + public ProjectData() { } + public Azure.ETag? ETag { get { throw null; } set { } } + public Azure.Core.AzureLocation? Location { get { throw null; } set { } } + public Azure.ResourceManager.Migrate.Models.ProjectProperties Properties { get { throw null; } set { } } + public System.BinaryData Tags { get { throw null; } set { } } + } + public partial class ProjectResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ProjectResource() { } + public virtual Azure.ResourceManager.Migrate.ProjectData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AssessmentOptions(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AssessmentOptionsAsync(string assessmentOptionsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable AssessmentOptionsList(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable AssessmentOptionsListAsync(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 Azure.Pageable GetAssessments(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAssessmentsAsync(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 GetGroup(string groupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetGroupAsync(string groupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migrate.GroupCollection GetGroups() { throw null; } + public virtual Azure.Response GetHyperVCollector(string hyperVCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetHyperVCollectorAsync(string hyperVCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migrate.HyperVCollectorCollection GetHyperVCollectors() { throw null; } + public virtual Azure.Response GetImportCollector(string importCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetImportCollectorAsync(string importCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migrate.ImportCollectorCollection GetImportCollectors() { throw null; } + public virtual Azure.Response GetMachine(string machineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMachineAsync(string machineName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migrate.MachineCollection GetMachines() { throw null; } + public virtual Azure.Response GetMigratePrivateEndpointConnection(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigratePrivateEndpointConnectionAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migrate.MigratePrivateEndpointConnectionCollection GetMigratePrivateEndpointConnections() { throw null; } + public virtual Azure.Response GetMigratePrivateLinkResource(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMigratePrivateLinkResourceAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migrate.MigratePrivateLinkResourceCollection GetMigratePrivateLinkResources() { throw null; } + public virtual Azure.Response GetServerCollector(string serverCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetServerCollectorAsync(string serverCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migrate.ServerCollectorCollection GetServerCollectors() { throw null; } + public virtual Azure.Response GetVMwareCollector(string vmWareCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetVMwareCollectorAsync(string vmWareCollectorName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migrate.VMwareCollectorCollection GetVMwareCollectors() { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.Migrate.ProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.Migrate.ProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ServerCollectorCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ServerCollectorCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string serverCollectorName, Azure.ResourceManager.Migrate.ServerCollectorData 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.Migrate.ServerCollectorData 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; } + 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 ServerCollectorData : Azure.ResourceManager.Models.ResourceData + { + public ServerCollectorData() { } + public Azure.ETag? ETag { get { throw null; } set { } } + public Azure.ResourceManager.Migrate.Models.CollectorProperties Properties { get { throw null; } set { } } + } + public partial class ServerCollectorResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ServerCollectorResource() { } + public virtual Azure.ResourceManager.Migrate.ServerCollectorData 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; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.ServerCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.ServerCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class VMwareCollectorCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected VMwareCollectorCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string vmWareCollectorName, Azure.ResourceManager.Migrate.VMwareCollectorData 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.Migrate.VMwareCollectorData 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; } + 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 VMwareCollectorData : Azure.ResourceManager.Models.ResourceData + { + public VMwareCollectorData() { } + public Azure.ETag? ETag { get { throw null; } set { } } + public Azure.ResourceManager.Migrate.Models.CollectorProperties Properties { get { throw null; } set { } } + } + public partial class VMwareCollectorResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected VMwareCollectorResource() { } + public virtual Azure.ResourceManager.Migrate.VMwareCollectorData 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; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.VMwareCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.VMwareCollectorData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class AssessedDisk + { + 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 Azure.ResourceManager.Migrate.Models.AzureDiskSize? RecommendedDiskSize { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AzureDiskType? RecommendedDiskType { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.CloudSuitability? Suitability { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityDetail? SuitabilityDetail { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityExplanation? SuitabilityExplanation { get { throw null; } } + } + public partial class AssessedMachineProperties + { + internal AssessedMachineProperties() { } + public Azure.ResourceManager.Migrate.Models.MachineBootType? BootType { get { throw null; } } + public double? ConfidenceRatingInPercentage { get { throw null; } } + public System.DateTimeOffset? CreatedTimestamp { get { throw null; } } + public string DatacenterMachineArmId { get { throw null; } } + public string 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 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 System.Collections.Generic.IReadOnlyDictionary NetworkAdapters { get { throw null; } } + public int? NumberOfCores { get { throw null; } } + public int? NumberOfCoresForRecommendedSize { 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.Migrate.Models.AzureVmSize? RecommendedSize { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.CloudSuitability? Suitability { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityDetail? SuitabilityDetail { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation? SuitabilityExplanation { get { throw null; } } + public System.DateTimeOffset? UpdatedTimestamp { get { throw null; } } + } + public partial class AssessedNetworkAdapter + { + 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.Migrate.Models.CloudSuitability? Suitability { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AzureNetworkAdapterSuitabilityDetail? SuitabilityDetail { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AzureNetworkAdapterSuitabilityExplanation? SuitabilityExplanation { get { throw null; } } + } + public partial class AssessmentOptions + { + internal AssessmentOptions() { } + public string Id { get { throw null; } } + public string Name { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AssessmentOptionsProperties Properties { get { throw null; } } + } + public partial class AssessmentOptionsProperties + { + internal AssessmentOptionsProperties() { } + 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 VmFamilies { get { throw null; } } + } + public partial class AssessmentProperties + { + public AssessmentProperties(Azure.ResourceManager.Migrate.Models.AzureLocation azureLocation, Azure.ResourceManager.Migrate.Models.AzureOfferCode azureOfferCode, Azure.ResourceManager.Migrate.Models.AzurePricingTier azurePricingTier, Azure.ResourceManager.Migrate.Models.AzureStorageRedundancy azureStorageRedundancy, double scalingFactor, Azure.ResourceManager.Migrate.Models.Percentile percentile, Azure.ResourceManager.Migrate.Models.TimeRange timeRange, Azure.ResourceManager.Migrate.Models.AssessmentStage stage, Azure.ResourceManager.Migrate.Models.Currency currency, Azure.ResourceManager.Migrate.Models.AzureHybridUseBenefit azureHybridUseBenefit, double discountPercentage, Azure.ResourceManager.Migrate.Models.AssessmentSizingCriterion sizingCriterion, Azure.ResourceManager.Migrate.Models.ReservedInstance reservedInstance, System.Collections.Generic.IEnumerable azureVmFamilies, Azure.ResourceManager.Migrate.Models.AzureDiskType azureDiskType, Azure.ResourceManager.Migrate.Models.VmUptime vmUptime) { } + public Azure.ResourceManager.Migrate.Models.AzureDiskType AzureDiskType { get { throw null; } set { } } + public Azure.ResourceManager.Migrate.Models.AzureHybridUseBenefit AzureHybridUseBenefit { get { throw null; } set { } } + public Azure.ResourceManager.Migrate.Models.AzureLocation AzureLocation { get { throw null; } set { } } + public Azure.ResourceManager.Migrate.Models.AzureOfferCode AzureOfferCode { get { throw null; } set { } } + public Azure.ResourceManager.Migrate.Models.AzurePricingTier AzurePricingTier { get { throw null; } set { } } + public Azure.ResourceManager.Migrate.Models.AzureStorageRedundancy AzureStorageRedundancy { get { throw null; } set { } } + public System.Collections.Generic.IList AzureVmFamilies { get { throw null; } } + public double? ConfidenceRatingInPercentage { get { throw null; } } + public System.DateTimeOffset? CreatedTimestamp { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.Currency Currency { get { throw null; } set { } } + public double DiscountPercentage { get { throw null; } set { } } + public string EaSubscriptionId { 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 int? NumberOfMachines { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.Percentile Percentile { get { throw null; } set { } } + public System.DateTimeOffset? PerfDataEndOn { get { throw null; } } + public System.DateTimeOffset? PerfDataStartOn { get { throw null; } } + public System.DateTimeOffset? PricesTimestamp { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.ReservedInstance ReservedInstance { get { throw null; } set { } } + public double ScalingFactor { get { throw null; } set { } } + public Azure.ResourceManager.Migrate.Models.AssessmentSizingCriterion SizingCriterion { get { throw null; } set { } } + public Azure.ResourceManager.Migrate.Models.AssessmentStage Stage { get { throw null; } set { } } + public Azure.ResourceManager.Migrate.Models.AssessmentStatus? Status { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.TimeRange TimeRange { get { throw null; } set { } } + public System.DateTimeOffset? UpdatedTimestamp { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.VmUptime VmUptime { get { throw null; } set { } } + } + [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.Migrate.Models.AssessmentSizingCriterion AsOnPremises { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSizingCriterion PerformanceBased { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.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.Migrate.Models.AssessmentSizingCriterion left, Azure.ResourceManager.Migrate.Models.AssessmentSizingCriterion right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AssessmentSizingCriterion (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AssessmentSizingCriterion left, Azure.ResourceManager.Migrate.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.Migrate.Models.AssessmentStage Approved { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStage InProgress { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStage UnderReview { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.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.Migrate.Models.AssessmentStage left, Azure.ResourceManager.Migrate.Models.AssessmentStage right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AssessmentStage (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AssessmentStage left, Azure.ResourceManager.Migrate.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.Migrate.Models.AssessmentStatus Completed { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus Created { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus Invalid { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus OutDated { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus OutOfSync { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus Running { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus Updated { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.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.Migrate.Models.AssessmentStatus left, Azure.ResourceManager.Migrate.Models.AssessmentStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AssessmentStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AssessmentStatus left, Azure.ResourceManager.Migrate.Models.AssessmentStatus 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.Migrate.Models.AzureDiskSize PremiumP10 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize PremiumP15 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize PremiumP20 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize PremiumP30 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize PremiumP4 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize PremiumP40 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize PremiumP50 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize PremiumP6 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize PremiumP60 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize PremiumP70 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize PremiumP80 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize StandardS10 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize StandardS15 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize StandardS20 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize StandardS30 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize StandardS4 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize StandardS40 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize StandardS50 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize StandardS6 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize StandardS60 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize StandardS70 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize StandardS80 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize StandardSSDE10 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize StandardSSDE15 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize StandardSSDE20 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize StandardSSDE30 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize StandardSSDE4 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize StandardSSDE40 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize StandardSSDE50 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize StandardSSDE6 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize StandardSSDE60 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize StandardSSDE70 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize StandardSSDE80 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSize Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.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.Migrate.Models.AzureDiskSize left, Azure.ResourceManager.Migrate.Models.AzureDiskSize right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AzureDiskSize (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AzureDiskSize left, Azure.ResourceManager.Migrate.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.Migrate.Models.AzureDiskSuitabilityDetail DiskGigabytesConsumedMissing { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityDetail DiskGigabytesConsumedOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityDetail DiskGigabytesProvisionedMissing { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityDetail DiskGigabytesProvisionedOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityDetail MegabytesPerSecondOfReadMissing { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityDetail MegabytesPerSecondOfReadOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityDetail MegabytesPerSecondOfWriteMissing { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityDetail MegabytesPerSecondOfWriteOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityDetail None { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityDetail NumberOfReadOperationsPerSecondMissing { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityDetail NumberOfReadOperationsPerSecondOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityDetail NumberOfWriteOperationsPerSecondMissing { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityDetail NumberOfWriteOperationsPerSecondOutOfRange { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.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.Migrate.Models.AzureDiskSuitabilityDetail left, Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityDetail right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityDetail (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityDetail left, Azure.ResourceManager.Migrate.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.Migrate.Models.AzureDiskSuitabilityExplanation DiskSizeGreaterThanSupported { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityExplanation InternalErrorOccurredForDiskEvaluation { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityExplanation NoDiskSizeFoundForSelectedRedundancy { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityExplanation NoDiskSizeFoundInSelectedLocation { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityExplanation NoEaPriceFoundForDiskSize { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityExplanation NoSuitableDiskSizeForIops { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityExplanation NoSuitableDiskSizeForThroughput { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityExplanation NotApplicable { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityExplanation Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.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.Migrate.Models.AzureDiskSuitabilityExplanation left, Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityExplanation right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityExplanation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AzureDiskSuitabilityExplanation left, Azure.ResourceManager.Migrate.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.Migrate.Models.AzureDiskType Premium { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskType Standard { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskType StandardOrPremium { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskType StandardSSD { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureDiskType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.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.Migrate.Models.AzureDiskType left, Azure.ResourceManager.Migrate.Models.AzureDiskType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AzureDiskType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AzureDiskType left, Azure.ResourceManager.Migrate.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.Migrate.Models.AzureHybridUseBenefit No { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureHybridUseBenefit Unknown { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureHybridUseBenefit Yes { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.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.Migrate.Models.AzureHybridUseBenefit left, Azure.ResourceManager.Migrate.Models.AzureHybridUseBenefit right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AzureHybridUseBenefit (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AzureHybridUseBenefit left, Azure.ResourceManager.Migrate.Models.AzureHybridUseBenefit right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureLocation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureLocation(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.AzureLocation AustraliaEast { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation AustraliaSoutheast { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation BrazilSouth { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation CanadaCentral { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation CanadaEast { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation CentralIndia { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation CentralUs { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation ChinaEast { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation ChinaNorth { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation EastAsia { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation EastUs { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation EastUs2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation GermanyCentral { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation GermanyNortheast { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation JapanEast { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation JapanWest { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation KoreaCentral { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation KoreaSouth { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation NorthCentralUs { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation NorthEurope { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation SouthCentralUs { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation SoutheastAsia { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation SouthIndia { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation UkSouth { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation UkWest { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation Unknown { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation USDoDCentral { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation USDoDEast { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation USGovArizona { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation USGovIowa { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation USGovTexas { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation USGovVirginia { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation WestCentralUs { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation WestEurope { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation WestIndia { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation WestUs { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureLocation WestUs2 { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.AzureLocation 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.Migrate.Models.AzureLocation left, Azure.ResourceManager.Migrate.Models.AzureLocation right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AzureLocation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AzureLocation left, Azure.ResourceManager.Migrate.Models.AzureLocation 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.Migrate.Models.AzureNetworkAdapterSuitabilityDetail MegabytesOfDataTransmittedMissing { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureNetworkAdapterSuitabilityDetail MegabytesOfDataTransmittedOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureNetworkAdapterSuitabilityDetail None { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.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.Migrate.Models.AzureNetworkAdapterSuitabilityDetail left, Azure.ResourceManager.Migrate.Models.AzureNetworkAdapterSuitabilityDetail right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AzureNetworkAdapterSuitabilityDetail (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AzureNetworkAdapterSuitabilityDetail left, Azure.ResourceManager.Migrate.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.Migrate.Models.AzureNetworkAdapterSuitabilityExplanation InternalErrorOccurred { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureNetworkAdapterSuitabilityExplanation NotApplicable { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureNetworkAdapterSuitabilityExplanation Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.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.Migrate.Models.AzureNetworkAdapterSuitabilityExplanation left, Azure.ResourceManager.Migrate.Models.AzureNetworkAdapterSuitabilityExplanation right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AzureNetworkAdapterSuitabilityExplanation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AzureNetworkAdapterSuitabilityExplanation left, Azure.ResourceManager.Migrate.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.Migrate.Models.AzureOfferCode EA { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0003P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0022P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0023P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0025P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0029P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0036P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0044P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0059P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0060P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0062P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0063P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0064P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0111P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0120P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0121P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0122P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0123P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0124P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0125P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0126P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0127P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0128P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0129P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0130P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0144P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0148P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazr0149P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazrde0003P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazrde0044P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msazrusgov0003P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msmcazr0044P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msmcazr0059P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msmcazr0060P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msmcazr0063P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msmcazr0120P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msmcazr0121P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msmcazr0125P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Msmcazr0128P { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureOfferCode Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.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.Migrate.Models.AzureOfferCode left, Azure.ResourceManager.Migrate.Models.AzureOfferCode right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AzureOfferCode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AzureOfferCode left, Azure.ResourceManager.Migrate.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.Migrate.Models.AzurePricingTier Basic { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzurePricingTier Standard { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.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.Migrate.Models.AzurePricingTier left, Azure.ResourceManager.Migrate.Models.AzurePricingTier right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AzurePricingTier (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AzurePricingTier left, Azure.ResourceManager.Migrate.Models.AzurePricingTier 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.Migrate.Models.AzureStorageRedundancy GeoRedundant { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureStorageRedundancy LocallyRedundant { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureStorageRedundancy ReadAccessGeoRedundant { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureStorageRedundancy Unknown { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureStorageRedundancy ZoneRedundant { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.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.Migrate.Models.AzureStorageRedundancy left, Azure.ResourceManager.Migrate.Models.AzureStorageRedundancy right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AzureStorageRedundancy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AzureStorageRedundancy left, Azure.ResourceManager.Migrate.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.Migrate.Models.AzureVmFamily Av2Series { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmFamily BasicA0A4 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmFamily DCSeries { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmFamily DSeries { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmFamily DSSeries { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmFamily DSv2Series { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmFamily Dsv3Series { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmFamily Dv2Series { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmFamily Dv3Series { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmFamily Esv3Series { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmFamily Ev3Series { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmFamily FSeries { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmFamily FsSeries { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmFamily Fsv2Series { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmFamily GSeries { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmFamily GSSeries { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmFamily HSeries { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmFamily LsSeries { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmFamily MSeries { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmFamily StandardA0A7 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmFamily StandardA8A11 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmFamily Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.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.Migrate.Models.AzureVmFamily left, Azure.ResourceManager.Migrate.Models.AzureVmFamily right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AzureVmFamily (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AzureVmFamily left, Azure.ResourceManager.Migrate.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.Migrate.Models.AzureVmSize BasicA0 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize BasicA1 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize BasicA2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize BasicA3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize BasicA4 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardA0 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardA1 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardA10 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardA11 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardA1V2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardA2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardA2MV2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardA2V2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardA3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardA4 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardA4MV2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardA4V2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardA5 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardA6 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardA7 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardA8 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardA8MV2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardA8V2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardA9 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD1 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD11 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD11V2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD12 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD12V2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD13 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD13V2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD14 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD14V2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD15V2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD16SV3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD16V3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD1V2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD2SV3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD2V2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD2V3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD32SV3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD32V3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD3V2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD4 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD4SV3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD4V2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD4V3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD5V2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD64SV3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD64V3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD8SV3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardD8V3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardDS1 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardDS11 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardDS11V2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardDS12 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardDS12V2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardDS13 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardDS13V2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardDS14 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardDS14V2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardDS15V2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardDS1V2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardDS2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardDS2V2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardDS3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardDS3V2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardDS4 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardDS4V2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardDS5V2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardE16SV3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardE16V3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardE2SV3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardE2V3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardE32SV3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardE32V3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardE4SV3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardE4V3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardE64SV3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardE64V3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardE8SV3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardE8V3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardF1 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardF16 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardF16S { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardF16SV2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardF1S { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardF2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardF2S { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardF2SV2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardF32SV2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardF4 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardF4S { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardF4SV2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardF64SV2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardF72SV2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardF8 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardF8S { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardF8SV2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardG1 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardG2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardG3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardG4 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardG5 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardGS1 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardGS2 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardGS3 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardGS4 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardGS5 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardH16 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardH16M { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardH16Mr { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardH16R { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardH8 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardH8M { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardL16S { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardL32S { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardL4S { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardL8S { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardM128Ms { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardM128S { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardM64Ms { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize StandardM64S { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSize Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.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.Migrate.Models.AzureVmSize left, Azure.ResourceManager.Migrate.Models.AzureVmSize right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AzureVmSize (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AzureVmSize left, Azure.ResourceManager.Migrate.Models.AzureVmSize right) { throw null; } + public override string ToString() { 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.Migrate.Models.AzureVmSuitabilityDetail CannotReportBandwidthCosts { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityDetail CannotReportComputeCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityDetail CannotReportStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityDetail None { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityDetail PercentageOfCoresUtilizedMissing { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityDetail PercentageOfCoresUtilizedOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityDetail PercentageOfMemoryUtilizedMissing { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityDetail PercentageOfMemoryUtilizedOutOfRange { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityDetail RecommendedSizeHasLessNetworkAdapters { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.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.Migrate.Models.AzureVmSuitabilityDetail left, Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityDetail right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityDetail (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityDetail left, Azure.ResourceManager.Migrate.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.Migrate.Models.AzureVmSuitabilityExplanation BootTypeNotSupported { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation BootTypeUnknown { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation CheckCentOSVersion { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation CheckCoreOSLinuxVersion { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation CheckDebianLinuxVersion { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation CheckOpenSuseLinuxVersion { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation CheckOracleLinuxVersion { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation CheckRedHatLinuxVersion { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation CheckSuseLinuxVersion { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation CheckUbuntuLinuxVersion { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation CheckWindowsServer2008R2Version { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation EndorsedWithConditionsLinuxDistributions { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation GuestOperatingSystemArchitectureNotSupported { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation GuestOperatingSystemNotSupported { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation GuestOperatingSystemUnknown { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation InternalErrorOccurredDuringComputeEvaluation { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation InternalErrorOccurredDuringNetworkEvaluation { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation InternalErrorOccurredDuringStorageEvaluation { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation MoreDisksThanSupported { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation NoGuestOperatingSystemConditionallySupported { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation NoSuitableVmSizeFound { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation NotApplicable { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation NoVmSizeForBasicPricingTier { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation NoVmSizeForSelectedAzureLocation { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation NoVmSizeForSelectedPricingTier { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation NoVmSizeForStandardPricingTier { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation NoVmSizeSupportsNetworkPerformance { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation NoVmSizeSupportsStoragePerformance { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation OneOrMoreAdaptersNotSuitable { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation OneOrMoreDisksNotSuitable { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation UnendorsedLinuxDistributions { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation Unknown { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation WindowsClientVersionsConditionallySupported { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation WindowsOSNoLongerUnderMSSupport { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation WindowsServerVersionConditionallySupported { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation WindowsServerVersionsSupportedWithCaveat { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.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.Migrate.Models.AzureVmSuitabilityExplanation left, Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation left, Azure.ResourceManager.Migrate.Models.AzureVmSuitabilityExplanation right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CloudSuitability : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CloudSuitability(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.CloudSuitability ConditionallySuitable { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CloudSuitability NotSuitable { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CloudSuitability ReadinessUnknown { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CloudSuitability Suitable { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CloudSuitability Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.CloudSuitability 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.Migrate.Models.CloudSuitability left, Azure.ResourceManager.Migrate.Models.CloudSuitability right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.CloudSuitability (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.CloudSuitability left, Azure.ResourceManager.Migrate.Models.CloudSuitability right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CollectorAgentProperties + { + public CollectorAgentProperties() { } + public string Id { get { throw null; } } + public System.DateTimeOffset? LastHeartbeatUtc { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.CollectorBodyAgentSpnProperties SpnDetails { get { throw null; } set { } } + public string Version { get { throw null; } } + } + public partial class CollectorBodyAgentSpnProperties + { + public CollectorBodyAgentSpnProperties() { } + 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 { } } + } + public partial class CollectorProperties + { + public CollectorProperties() { } + public Azure.ResourceManager.Migrate.Models.CollectorAgentProperties AgentProperties { get { throw null; } set { } } + public string CreatedTimestamp { get { throw null; } } + public string DiscoverySiteId { get { throw null; } set { } } + public string UpdatedTimestamp { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct Currency : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Currency(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.Currency ARS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency AUD { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency BRL { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency CAD { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency CHF { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency CNY { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency DKK { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency EUR { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency GBP { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency HKD { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency IdR { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency INR { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency JPY { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency KRW { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency MXN { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency MYR { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency NOK { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency NZD { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency RUB { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency SAR { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency SEK { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency TRY { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency TWD { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency Unknown { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency USD { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Currency ZAR { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.Currency 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.Migrate.Models.Currency left, Azure.ResourceManager.Migrate.Models.Currency right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.Currency (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.Currency left, Azure.ResourceManager.Migrate.Models.Currency right) { throw null; } + public override string ToString() { throw null; } + } + public partial class Disk + { + internal Disk() { } + public string DisplayName { get { throw null; } } + public double? GigabytesAllocated { get { throw null; } } + } + public partial class DownloadUri + { + internal DownloadUri() { } + public System.Uri AssessmentReportUri { get { throw null; } } + public System.DateTimeOffset? ExpireOn { get { throw null; } } + } + public partial class GroupBodyProperties + { + public GroupBodyProperties() { } + public System.Collections.Generic.IList Machines { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.GroupUpdateOperation? OperationType { get { throw null; } set { } } + } + public partial class GroupProperties + { + public GroupProperties() { } + public bool? AreAssessmentsRunning { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Assessments { get { throw null; } } + public System.DateTimeOffset? CreatedTimestamp { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.GroupStatus? GroupStatus { get { throw null; } } + public string GroupType { get { throw null; } set { } } + public int? MachineCount { get { throw null; } } + public System.DateTimeOffset? UpdatedTimestamp { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct GroupStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public GroupStatus(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.GroupStatus Completed { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.GroupStatus Created { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.GroupStatus Invalid { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.GroupStatus Running { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.GroupStatus Updated { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.GroupStatus 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.Migrate.Models.GroupStatus left, Azure.ResourceManager.Migrate.Models.GroupStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.GroupStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.GroupStatus left, Azure.ResourceManager.Migrate.Models.GroupStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct GroupUpdateOperation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public GroupUpdateOperation(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.GroupUpdateOperation Add { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.GroupUpdateOperation Remove { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.GroupUpdateOperation 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.Migrate.Models.GroupUpdateOperation left, Azure.ResourceManager.Migrate.Models.GroupUpdateOperation right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.GroupUpdateOperation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.GroupUpdateOperation left, Azure.ResourceManager.Migrate.Models.GroupUpdateOperation right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ImportCollectorProperties + { + public ImportCollectorProperties() { } + public string CreatedTimestamp { get { throw null; } } + public string DiscoverySiteId { get { throw null; } set { } } + public string UpdatedTimestamp { get { 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.Migrate.Models.MachineBootType Bios { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MachineBootType EFI { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MachineBootType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.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.Migrate.Models.MachineBootType left, Azure.ResourceManager.Migrate.Models.MachineBootType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.MachineBootType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.MachineBootType left, Azure.ResourceManager.Migrate.Models.MachineBootType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MachineProperties + { + internal MachineProperties() { } + public Azure.ResourceManager.Migrate.Models.MachineBootType? BootType { get { throw null; } } + public System.DateTimeOffset? CreatedTimestamp { get { throw null; } } + public string DatacenterManagementServerArmId { get { throw null; } } + public string DatacenterManagementServerName { get { throw null; } } + public string Description { get { throw null; } } + public string DiscoveryMachineArmId { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Disks { get { throw null; } } + public string DisplayName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Groups { get { throw null; } } + public float? 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 System.DateTimeOffset? UpdatedTimestamp { get { throw null; } } + } + public partial class MigratePrivateLinkResourceProperties + { + internal MigratePrivateLinkResourceProperties() { } + public string GroupId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredMembers { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredZoneNames { get { throw null; } } + } + public partial class MigratePrivateLinkServiceConnectionState + { + public MigratePrivateLinkServiceConnectionState() { } + public string ActionsRequired { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.Migrate.Models.PrivateLinkServiceConnectionStateStatus? Status { get { throw null; } set { } } + } + public partial class NetworkAdapter + { + internal NetworkAdapter() { } + public string DisplayName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList IPAddresses { get { throw null; } } + public string MacAddress { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct Percentile : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Percentile(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.Percentile Percentile50 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Percentile Percentile90 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Percentile Percentile95 { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.Percentile Percentile99 { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.Percentile 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.Migrate.Models.Percentile left, Azure.ResourceManager.Migrate.Models.Percentile right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.Percentile (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.Percentile left, Azure.ResourceManager.Migrate.Models.Percentile right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PrivateEndpointConnectionProperties + { + public PrivateEndpointConnectionProperties() { } + public Azure.ResourceManager.Migrate.Models.MigratePrivateLinkServiceConnectionState ConnectionState { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier PrivateEndpointId { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.PrivateEndpointConnectionPropertiesProvisioningState? ProvisioningState { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PrivateEndpointConnectionPropertiesProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PrivateEndpointConnectionPropertiesProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.PrivateEndpointConnectionPropertiesProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.PrivateEndpointConnectionPropertiesProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.PrivateEndpointConnectionPropertiesProvisioningState InProgress { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.PrivateEndpointConnectionPropertiesProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.PrivateEndpointConnectionPropertiesProvisioningState 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.Migrate.Models.PrivateEndpointConnectionPropertiesProvisioningState left, Azure.ResourceManager.Migrate.Models.PrivateEndpointConnectionPropertiesProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.PrivateEndpointConnectionPropertiesProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.PrivateEndpointConnectionPropertiesProvisioningState left, Azure.ResourceManager.Migrate.Models.PrivateEndpointConnectionPropertiesProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PrivateLinkServiceConnectionStateStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PrivateLinkServiceConnectionStateStatus(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.PrivateLinkServiceConnectionStateStatus Approved { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.PrivateLinkServiceConnectionStateStatus Disconnected { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.PrivateLinkServiceConnectionStateStatus Pending { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.PrivateLinkServiceConnectionStateStatus Rejected { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.PrivateLinkServiceConnectionStateStatus 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.Migrate.Models.PrivateLinkServiceConnectionStateStatus left, Azure.ResourceManager.Migrate.Models.PrivateLinkServiceConnectionStateStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.PrivateLinkServiceConnectionStateStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.PrivateLinkServiceConnectionStateStatus left, Azure.ResourceManager.Migrate.Models.PrivateLinkServiceConnectionStateStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ProjectProperties + { + public ProjectProperties() { } + public string AssessmentSolutionId { get { throw null; } set { } } + public System.DateTimeOffset? CreatedTimestamp { get { throw null; } } + public string CustomerStorageAccountArmId { get { throw null; } set { } } + public string CustomerWorkspaceId { get { throw null; } set { } } + public string CustomerWorkspaceLocation { get { throw null; } set { } } + public System.DateTimeOffset? LastAssessmentTimestamp { get { throw null; } } + public int? NumberOfAssessments { get { throw null; } } + public int? NumberOfGroups { get { throw null; } } + public int? NumberOfMachines { get { throw null; } } + public System.Collections.Generic.IReadOnlyList PrivateEndpointConnections { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.ProjectStatus? ProjectStatus { get { throw null; } set { } } + public Azure.ResourceManager.Migrate.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string PublicNetworkAccess { get { throw null; } set { } } + public string ServiceEndpoint { get { throw null; } } + public System.DateTimeOffset? UpdatedTimestamp { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProjectStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProjectStatus(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.ProjectStatus Active { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.ProjectStatus Inactive { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.ProjectStatus 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.Migrate.Models.ProjectStatus left, Azure.ResourceManager.Migrate.Models.ProjectStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.ProjectStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.ProjectStatus left, Azure.ResourceManager.Migrate.Models.ProjectStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.ProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.ProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.ProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.ProvisioningState Moving { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.ProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.ProvisioningState 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.Migrate.Models.ProvisioningState left, Azure.ResourceManager.Migrate.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.ProvisioningState left, Azure.ResourceManager.Migrate.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ReservedInstance : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ReservedInstance(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.ReservedInstance None { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.ReservedInstance RI1Year { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.ReservedInstance RI3Year { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.ReservedInstance 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.Migrate.Models.ReservedInstance left, Azure.ResourceManager.Migrate.Models.ReservedInstance right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.ReservedInstance (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.ReservedInstance left, Azure.ResourceManager.Migrate.Models.ReservedInstance right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TimeRange : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TimeRange(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.TimeRange Custom { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.TimeRange Day { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.TimeRange Month { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.TimeRange Week { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.TimeRange 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.Migrate.Models.TimeRange left, Azure.ResourceManager.Migrate.Models.TimeRange right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.TimeRange (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.TimeRange left, Azure.ResourceManager.Migrate.Models.TimeRange right) { throw null; } + public override string ToString() { throw null; } + } + public partial class UpdateGroupBody + { + public UpdateGroupBody() { } + public Azure.ETag? ETag { get { throw null; } set { } } + public Azure.ResourceManager.Migrate.Models.GroupBodyProperties Properties { get { throw null; } set { } } + } + public partial class VmFamily + { + internal VmFamily() { } + public System.Collections.Generic.IReadOnlyList Category { get { throw null; } } + public string FamilyName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList TargetLocations { get { throw null; } } + } + public partial class VmUptime + { + public VmUptime() { } + public int? DaysPerMonth { get { throw null; } set { } } + public int? HoursPerDay { get { throw null; } set { } } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Azure.ResourceManager.Migrate.csproj b/sdk/migrate/Azure.ResourceManager.Migrate/src/Azure.ResourceManager.Migrate.csproj new file mode 100644 index 000000000000..2a1c9ade562d --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Azure.ResourceManager.Migrate.csproj @@ -0,0 +1,8 @@ + + + 1.0.0-beta.1 + Azure.ResourceManager.Migrate + Azure Resource Manager client SDK for Azure resource provider migrate + azure;management;arm;resource manager;migrate + + diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/AssessedMachineCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/AssessedMachineCollection.cs new file mode 100644 index 000000000000..2880236e9091 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/AssessedMachineCollection.cs @@ -0,0 +1,275 @@ +// 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.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// 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 _assessedMachineClientDiagnostics; + private readonly AssessedMachinesRestOperations _assessedMachineRestClient; + + /// 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) + { + _assessedMachineClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", AssessedMachineResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AssessedMachineResource.ResourceType, out string assessedMachineApiVersion); + _assessedMachineRestClient = new AssessedMachinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, assessedMachineApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != AssessmentResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, AssessmentResource.ResourceType), nameof(id)); + } + + /// + /// Get an assessed machine with its size & cost estimate that was evaluated in the specified assessment. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName} + /// Operation Id: AssessedMachines_Get + /// + /// Unique name of an assessed machine evaluated as part of an assessment. + /// 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 = _assessedMachineClientDiagnostics.CreateScope("AssessedMachineCollection.Get"); + scope.Start(); + try + { + var response = await _assessedMachineRestClient.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 an assessed machine with its size & cost estimate that was evaluated in the specified assessment. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName} + /// Operation Id: AssessedMachines_Get + /// + /// Unique name of an assessed machine evaluated as part of an assessment. + /// 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 = _assessedMachineClientDiagnostics.CreateScope("AssessedMachineCollection.Get"); + scope.Start(); + try + { + var response = _assessedMachineRestClient.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; + } + } + + /// + /// Get list of machines that assessed as part of the specified assessment. Returns a json array of objects of type 'assessedMachine' as specified in the Models section. + /// + /// Whenever an assessment is created or updated, it goes under computation. During this phase, the 'status' field of Assessment object reports 'Computing'. + /// During the period when the assessment is under computation, the list of assessed machines is empty and no assessed machines are returned by this call. + /// + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines + /// Operation Id: AssessedMachines_ListByAssessment + /// + /// 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) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _assessedMachineClientDiagnostics.CreateScope("AssessedMachineCollection.GetAll"); + scope.Start(); + try + { + var response = await _assessedMachineRestClient.ListByAssessmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new AssessedMachineResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _assessedMachineClientDiagnostics.CreateScope("AssessedMachineCollection.GetAll"); + scope.Start(); + try + { + var response = await _assessedMachineRestClient.ListByAssessmentNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new AssessedMachineResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); + } + + /// + /// Get list of machines that assessed as part of the specified assessment. Returns a json array of objects of type 'assessedMachine' as specified in the Models section. + /// + /// Whenever an assessment is created or updated, it goes under computation. During this phase, the 'status' field of Assessment object reports 'Computing'. + /// During the period when the assessment is under computation, the list of assessed machines is empty and no assessed machines are returned by this call. + /// + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines + /// Operation Id: AssessedMachines_ListByAssessment + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _assessedMachineClientDiagnostics.CreateScope("AssessedMachineCollection.GetAll"); + scope.Start(); + try + { + var response = _assessedMachineRestClient.ListByAssessment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new AssessedMachineResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _assessedMachineClientDiagnostics.CreateScope("AssessedMachineCollection.GetAll"); + scope.Start(); + try + { + var response = _assessedMachineRestClient.ListByAssessmentNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new AssessedMachineResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); + } + + /// + /// 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: AssessedMachines_Get + /// + /// Unique name of an assessed machine evaluated as part of an assessment. + /// 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 = _assessedMachineClientDiagnostics.CreateScope("AssessedMachineCollection.Exists"); + scope.Start(); + try + { + var response = await _assessedMachineRestClient.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: AssessedMachines_Get + /// + /// Unique name of an assessed machine evaluated as part of an assessment. + /// 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 = _assessedMachineClientDiagnostics.CreateScope("AssessedMachineCollection.Exists"); + scope.Start(); + try + { + var response = _assessedMachineRestClient.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; + } + } + + 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/migrate/Azure.ResourceManager.Migrate/src/Generated/AssessedMachineData.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/AssessedMachineData.cs new file mode 100644 index 000000000000..b3e01a1a30fd --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/AssessedMachineData.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure; +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + /// A class representing the AssessedMachine data model. + public partial class AssessedMachineData : ResourceData + { + /// Initializes a new instance of AssessedMachineData. + internal AssessedMachineData() + { + } + + /// Initializes a new instance of AssessedMachineData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// For optimistic concurrency control. + /// Properties of an assessed machine. + internal AssessedMachineData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ETag? eTag, AssessedMachineProperties properties) : base(id, name, resourceType, systemData) + { + ETag = eTag; + Properties = properties; + } + + /// For optimistic concurrency control. + public ETag? ETag { get; } + /// Properties of an assessed machine. + public AssessedMachineProperties Properties { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/AssessedMachineResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/AssessedMachineResource.cs new file mode 100644 index 000000000000..0b4703adbc26 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/AssessedMachineResource.cs @@ -0,0 +1,137 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// 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. + 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 _assessedMachineClientDiagnostics; + private readonly AssessedMachinesRestOperations _assessedMachineRestClient; + private readonly AssessedMachineData _data; + + /// 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) + { + _assessedMachineClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string assessedMachineApiVersion); + _assessedMachineRestClient = new AssessedMachinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, assessedMachineApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/groups/assessments/assessedMachines"; + + /// 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 an assessed machine with its size & cost estimate that was evaluated in the specified assessment. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName} + /// Operation Id: AssessedMachines_Get + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _assessedMachineClientDiagnostics.CreateScope("AssessedMachineResource.Get"); + scope.Start(); + try + { + var response = await _assessedMachineRestClient.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 an assessed machine with its size & cost estimate that was evaluated in the specified assessment. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName} + /// Operation Id: AssessedMachines_Get + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _assessedMachineClientDiagnostics.CreateScope("AssessedMachineResource.Get"); + scope.Start(); + try + { + var response = _assessedMachineRestClient.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/migrate/Azure.ResourceManager.Migrate/src/Generated/AssessmentCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/AssessmentCollection.cs new file mode 100644 index 000000000000..edc7f6a5c766 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/AssessmentCollection.cs @@ -0,0 +1,319 @@ +// 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.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// 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 GetAssessments method from an instance of . + /// + public partial class AssessmentCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _assessmentClientDiagnostics; + private readonly AssessmentsRestOperations _assessmentRestClient; + + /// Initializes a new instance of the class for mocking. + protected AssessmentCollection() + { + } + + /// 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 AssessmentCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _assessmentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", AssessmentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AssessmentResource.ResourceType, out string assessmentApiVersion); + _assessmentRestClient = new AssessmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, assessmentApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != GroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, GroupResource.ResourceType), nameof(id)); + } + + /// + /// Create a new assessment with the given name and the specified settings. Since name of an assessment in a project is a unique identifier, if an assessment with the name provided already exists, then the existing assessment is updated. + /// + /// Any PUT operation, resulting in either create or update on an assessment, will cause the assessment to go in a "InProgress" state. This will be indicated by the field 'computationState' on the Assessment object. During this time no other PUT operation will be allowed on that assessment object, nor will a Delete operation. Once the computation for the assessment is complete, the field 'computationState' will be updated to 'Ready', and then other PUT or DELETE operations can happen on the assessment. + /// + /// When assessment is under computation, any PUT will lead to a 400 - Bad Request error. + /// + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// Operation Id: Assessments_Create + /// + /// 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. + /// Unique name of an assessment within a project. + /// New or Updated Assessment object. + /// 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, AssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _assessmentClientDiagnostics.CreateScope("AssessmentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _assessmentRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, data, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(Response.FromValue(new AssessmentResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a new assessment with the given name and the specified settings. Since name of an assessment in a project is a unique identifier, if an assessment with the name provided already exists, then the existing assessment is updated. + /// + /// Any PUT operation, resulting in either create or update on an assessment, will cause the assessment to go in a "InProgress" state. This will be indicated by the field 'computationState' on the Assessment object. During this time no other PUT operation will be allowed on that assessment object, nor will a Delete operation. Once the computation for the assessment is complete, the field 'computationState' will be updated to 'Ready', and then other PUT or DELETE operations can happen on the assessment. + /// + /// When assessment is under computation, any PUT will lead to a 400 - Bad Request error. + /// + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// Operation Id: Assessments_Create + /// + /// 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. + /// Unique name of an assessment within a project. + /// New or Updated Assessment object. + /// 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, AssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _assessmentClientDiagnostics.CreateScope("AssessmentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _assessmentRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, assessmentName, data, cancellationToken); + var operation = new MigrateArmOperation(Response.FromValue(new AssessmentResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get an existing assessment with the specified name. Returns a json object of type 'assessment' as specified in Models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// Operation Id: Assessments_Get + /// + /// Unique name of an assessment within a project. + /// 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 = _assessmentClientDiagnostics.CreateScope("AssessmentCollection.Get"); + scope.Start(); + try + { + var response = await _assessmentRestClient.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 AssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get an existing assessment with the specified name. Returns a json object of type 'assessment' as specified in Models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// Operation Id: Assessments_Get + /// + /// Unique name of an assessment within a project. + /// 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 = _assessmentClientDiagnostics.CreateScope("AssessmentCollection.Get"); + scope.Start(); + try + { + var response = _assessmentRestClient.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 AssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get all assessments created for the specified group. + /// + /// Returns a json array of objects of type 'assessment' as specified in Models section. + /// + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments + /// Operation Id: Assessments_ListByGroup + /// + /// 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) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _assessmentClientDiagnostics.CreateScope("AssessmentCollection.GetAll"); + scope.Start(); + try + { + var response = await _assessmentRestClient.ListByGroupAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new AssessmentResource(Client, value)), null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// + /// Get all assessments created for the specified group. + /// + /// Returns a json array of objects of type 'assessment' as specified in Models section. + /// + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments + /// Operation Id: Assessments_ListByGroup + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _assessmentClientDiagnostics.CreateScope("AssessmentCollection.GetAll"); + scope.Start(); + try + { + var response = _assessmentRestClient.ListByGroup(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new AssessmentResource(Client, value)), null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + + /// + /// 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: Assessments_Get + /// + /// Unique name of an assessment within a project. + /// 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 = _assessmentClientDiagnostics.CreateScope("AssessmentCollection.Exists"); + scope.Start(); + try + { + var response = await _assessmentRestClient.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: Assessments_Get + /// + /// Unique name of an assessment within a project. + /// 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 = _assessmentClientDiagnostics.CreateScope("AssessmentCollection.Exists"); + scope.Start(); + try + { + var response = _assessmentRestClient.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; + } + } + + 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/migrate/Azure.ResourceManager.Migrate/src/Generated/AssessmentData.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/AssessmentData.cs new file mode 100644 index 000000000000..3734eb447c7e --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/AssessmentData.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + /// A class representing the Assessment data model. + public partial class AssessmentData : ResourceData + { + /// Initializes a new instance of AssessmentData. + /// Properties of the assessment. + /// is null. + public AssessmentData(AssessmentProperties properties) + { + if (properties == null) + { + throw new ArgumentNullException(nameof(properties)); + } + + Properties = properties; + } + + /// Initializes a new instance of AssessmentData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// For optimistic concurrency control. + /// Properties of the assessment. + internal AssessmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ETag? eTag, AssessmentProperties properties) : base(id, name, resourceType, systemData) + { + ETag = eTag; + Properties = properties; + } + + /// For optimistic concurrency control. + public ETag? ETag { get; set; } + /// Properties of the assessment. + public AssessmentProperties Properties { get; set; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/AssessmentResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/AssessmentResource.cs new file mode 100644 index 000000000000..5ba01d358306 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/AssessmentResource.cs @@ -0,0 +1,347 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Migrate.Models; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// A Class representing an Assessment 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 GetAssessmentResource method. + /// Otherwise you can get one from its parent resource using the GetAssessment method. + /// + public partial class AssessmentResource : ArmResource + { + /// Generate the resource identifier of a instance. + 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 _assessmentClientDiagnostics; + private readonly AssessmentsRestOperations _assessmentRestClient; + private readonly AssessmentData _data; + + /// Initializes a new instance of the class for mocking. + protected AssessmentResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AssessmentResource(ArmClient client, AssessmentData 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 AssessmentResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _assessmentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string assessmentApiVersion); + _assessmentRestClient = new AssessmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, assessmentApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/groups/assessments"; + + /// 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 AssessmentData 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 Assessment. + /// An object representing collection of AssessedMachineResources and their operations over a AssessedMachineResource. + public virtual AssessedMachineCollection GetAssessedMachines() + { + return GetCachedClient(Client => new AssessedMachineCollection(Client, Id)); + } + + /// + /// Get an assessed machine with its size & cost estimate that was evaluated in the specified assessment. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName} + /// Operation Id: AssessedMachines_Get + /// + /// Unique name of an assessed machine evaluated as part of an assessment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetAssessedMachineAsync(string assessedMachineName, CancellationToken cancellationToken = default) + { + return await GetAssessedMachines().GetAsync(assessedMachineName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get an assessed machine with its size & cost estimate that was evaluated in the specified assessment. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName} + /// Operation Id: AssessedMachines_Get + /// + /// Unique name of an assessed machine evaluated as part of an assessment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetAssessedMachine(string assessedMachineName, CancellationToken cancellationToken = default) + { + return GetAssessedMachines().Get(assessedMachineName, cancellationToken); + } + + /// + /// Get an existing assessment with the specified name. Returns a json object of type 'assessment' as specified in Models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// Operation Id: Assessments_Get + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _assessmentClientDiagnostics.CreateScope("AssessmentResource.Get"); + scope.Start(); + try + { + var response = await _assessmentRestClient.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 AssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get an existing assessment with the specified name. Returns a json object of type 'assessment' as specified in Models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// Operation Id: Assessments_Get + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _assessmentClientDiagnostics.CreateScope("AssessmentResource.Get"); + scope.Start(); + try + { + var response = _assessmentRestClient.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 AssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete an assessment from the project. The machines remain in the assessment. Deleting a non-existent assessment results in a no-operation. + /// + /// When an assessment is under computation, as indicated by the 'computationState' field, it cannot be deleted. Any such attempt will return a 400 - Bad Request. + /// + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// Operation Id: Assessments_Delete + /// + /// 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 = _assessmentClientDiagnostics.CreateScope("AssessmentResource.Delete"); + scope.Start(); + try + { + var response = await _assessmentRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(response); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete an assessment from the project. The machines remain in the assessment. Deleting a non-existent assessment results in a no-operation. + /// + /// When an assessment is under computation, as indicated by the 'computationState' field, it cannot be deleted. Any such attempt will return a 400 - Bad Request. + /// + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// Operation Id: Assessments_Delete + /// + /// 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 = _assessmentClientDiagnostics.CreateScope("AssessmentResource.Delete"); + scope.Start(); + try + { + var response = _assessmentRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MigrateArmOperation(response); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a new assessment with the given name and the specified settings. Since name of an assessment in a project is a unique identifier, if an assessment with the name provided already exists, then the existing assessment is updated. + /// + /// Any PUT operation, resulting in either create or update on an assessment, will cause the assessment to go in a "InProgress" state. This will be indicated by the field 'computationState' on the Assessment object. During this time no other PUT operation will be allowed on that assessment object, nor will a Delete operation. Once the computation for the assessment is complete, the field 'computationState' will be updated to 'Ready', and then other PUT or DELETE operations can happen on the assessment. + /// + /// When assessment is under computation, any PUT will lead to a 400 - Bad Request error. + /// + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// Operation Id: Assessments_Create + /// + /// 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. + /// New or Updated Assessment object. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, AssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _assessmentClientDiagnostics.CreateScope("AssessmentResource.Update"); + scope.Start(); + try + { + var response = await _assessmentRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(Response.FromValue(new AssessmentResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a new assessment with the given name and the specified settings. Since name of an assessment in a project is a unique identifier, if an assessment with the name provided already exists, then the existing assessment is updated. + /// + /// Any PUT operation, resulting in either create or update on an assessment, will cause the assessment to go in a "InProgress" state. This will be indicated by the field 'computationState' on the Assessment object. During this time no other PUT operation will be allowed on that assessment object, nor will a Delete operation. Once the computation for the assessment is complete, the field 'computationState' will be updated to 'Ready', and then other PUT or DELETE operations can happen on the assessment. + /// + /// When assessment is under computation, any PUT will lead to a 400 - Bad Request error. + /// + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// Operation Id: Assessments_Create + /// + /// 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. + /// New or Updated Assessment object. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, AssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _assessmentClientDiagnostics.CreateScope("AssessmentResource.Update"); + scope.Start(); + try + { + var response = _assessmentRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MigrateArmOperation(Response.FromValue(new AssessmentResource(Client, response), response.GetRawResponse())); + 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: Assessments_GetReportDownloadUrl + /// + /// The cancellation token to use. + public virtual async Task> GetReportDownloadUrlAsync(CancellationToken cancellationToken = default) + { + using var scope = _assessmentClientDiagnostics.CreateScope("AssessmentResource.GetReportDownloadUrl"); + scope.Start(); + try + { + var response = await _assessmentRestClient.GetReportDownloadUrlAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + 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: Assessments_GetReportDownloadUrl + /// + /// The cancellation token to use. + public virtual Response GetReportDownloadUrl(CancellationToken cancellationToken = default) + { + using var scope = _assessmentClientDiagnostics.CreateScope("AssessmentResource.GetReportDownloadUrl"); + scope.Start(); + try + { + var response = _assessmentRestClient.GetReportDownloadUrl(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/MigrateExtensions.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/MigrateExtensions.cs new file mode 100644 index 000000000000..6a6fbbf06cb1 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/MigrateExtensions.cs @@ -0,0 +1,314 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Migrate +{ + /// A class to add extension methods to Azure.ResourceManager.Migrate. + public static partial class MigrateExtensions + { + private static SubscriptionResourceExtensionClient GetExtensionClient(SubscriptionResource subscriptionResource) + { + return subscriptionResource.GetCachedClient((client) => + { + return new SubscriptionResourceExtensionClient(client, subscriptionResource.Id); + } + ); + } + + /// + /// Get all the projects in the subscription. + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Migrate/assessmentProjects + /// Operation Id: Projects_ListBySubscription + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetProjectsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + return GetExtensionClient(subscriptionResource).GetProjectsAsync(cancellationToken); + } + + /// + /// Get all the projects in the subscription. + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Migrate/assessmentProjects + /// Operation Id: Projects_ListBySubscription + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetProjects(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + return GetExtensionClient(subscriptionResource).GetProjects(cancellationToken); + } + + private static ResourceGroupResourceExtensionClient GetExtensionClient(ResourceGroupResource resourceGroupResource) + { + return resourceGroupResource.GetCachedClient((client) => + { + return new ResourceGroupResourceExtensionClient(client, resourceGroupResource.Id); + } + ); + } + + /// Gets a collection of ProjectResources in the ResourceGroupResource. + /// The instance the method will execute against. + /// An object representing collection of ProjectResources and their operations over a ProjectResource. + public static ProjectCollection GetProjects(this ResourceGroupResource resourceGroupResource) + { + return GetExtensionClient(resourceGroupResource).GetProjects(); + } + + /// + /// Get the project with the specified name. + /// Request Path: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// Operation Id: Projects_Get + /// + /// The instance the method will execute against. + /// Name of the Azure Migrate project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public static async Task> GetProjectAsync(this ResourceGroupResource resourceGroupResource, string projectName, CancellationToken cancellationToken = default) + { + return await resourceGroupResource.GetProjects().GetAsync(projectName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the project with the specified name. + /// Request Path: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// Operation Id: Projects_Get + /// + /// The instance the method will execute against. + /// Name of the Azure Migrate project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public static Response GetProject(this ResourceGroupResource resourceGroupResource, string projectName, CancellationToken cancellationToken = default) + { + return resourceGroupResource.GetProjects().Get(projectName, cancellationToken); + } + + #region ProjectResource + /// + /// 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 instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static ProjectResource GetProjectResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + ProjectResource.ValidateResourceId(id); + return new ProjectResource(client, id); + } + ); + } + #endregion + + #region MachineResource + /// + /// 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 instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static MachineResource GetMachineResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + MachineResource.ValidateResourceId(id); + return new MachineResource(client, id); + } + ); + } + #endregion + + #region GroupResource + /// + /// 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 instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static GroupResource GetGroupResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + GroupResource.ValidateResourceId(id); + return new GroupResource(client, id); + } + ); + } + #endregion + + #region AssessmentResource + /// + /// 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 instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static AssessmentResource GetAssessmentResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + AssessmentResource.ValidateResourceId(id); + return new AssessmentResource(client, id); + } + ); + } + #endregion + + #region AssessedMachineResource + /// + /// 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 instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static AssessedMachineResource GetAssessedMachineResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + AssessedMachineResource.ValidateResourceId(id); + return new AssessedMachineResource(client, id); + } + ); + } + #endregion + + #region HyperVCollectorResource + /// + /// 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 instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static HyperVCollectorResource GetHyperVCollectorResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + HyperVCollectorResource.ValidateResourceId(id); + return new HyperVCollectorResource(client, id); + } + ); + } + #endregion + + #region ServerCollectorResource + /// + /// 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 instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static ServerCollectorResource GetServerCollectorResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + ServerCollectorResource.ValidateResourceId(id); + return new ServerCollectorResource(client, id); + } + ); + } + #endregion + + #region VMwareCollectorResource + /// + /// 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 instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static VMwareCollectorResource GetVMwareCollectorResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + VMwareCollectorResource.ValidateResourceId(id); + return new VMwareCollectorResource(client, id); + } + ); + } + #endregion + + #region ImportCollectorResource + /// + /// 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 instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static ImportCollectorResource GetImportCollectorResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + ImportCollectorResource.ValidateResourceId(id); + return new ImportCollectorResource(client, id); + } + ); + } + #endregion + + #region MigratePrivateEndpointConnectionResource + /// + /// 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 instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static MigratePrivateEndpointConnectionResource GetMigratePrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + MigratePrivateEndpointConnectionResource.ValidateResourceId(id); + return new MigratePrivateEndpointConnectionResource(client, id); + } + ); + } + #endregion + + #region MigratePrivateLinkResource + /// + /// 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 instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static MigratePrivateLinkResource GetMigratePrivateLinkResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + MigratePrivateLinkResource.ValidateResourceId(id); + return new MigratePrivateLinkResource(client, id); + } + ); + } + #endregion + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs new file mode 100644 index 000000000000..c1f2138d3ec1 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Migrate +{ + /// A class to add extension methods to ResourceGroupResource. + internal partial class ResourceGroupResourceExtensionClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ResourceGroupResourceExtensionClient() + { + } + + /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ProjectResources in the ResourceGroupResource. + /// An object representing collection of ProjectResources and their operations over a ProjectResource. + public virtual ProjectCollection GetProjects() + { + return GetCachedClient(Client => new ProjectCollection(Client, Id)); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs new file mode 100644 index 000000000000..9c8e53214b29 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Migrate +{ + /// A class to add extension methods to SubscriptionResource. + internal partial class SubscriptionResourceExtensionClient : ArmResource + { + private ClientDiagnostics _projectClientDiagnostics; + private ProjectsRestOperations _projectRestClient; + + /// Initializes a new instance of the class for mocking. + protected SubscriptionResourceExtensionClient() + { + } + + /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics ProjectClientDiagnostics => _projectClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Migrate", ProjectResource.ResourceType.Namespace, Diagnostics); + private ProjectsRestOperations ProjectRestClient => _projectRestClient ??= new ProjectsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ProjectResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Get all the projects in the subscription. + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Migrate/assessmentProjects + /// Operation Id: Projects_ListBySubscription + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetProjectsAsync(CancellationToken cancellationToken = default) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = ProjectClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetProjects"); + scope.Start(); + try + { + var response = await ProjectRestClient.ListBySubscriptionAsync(Id.SubscriptionId, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new ProjectResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = ProjectClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetProjects"); + scope.Start(); + try + { + var response = await ProjectRestClient.ListBySubscriptionNextPageAsync(nextLink, Id.SubscriptionId, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new ProjectResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); + } + + /// + /// Get all the projects in the subscription. + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Migrate/assessmentProjects + /// Operation Id: Projects_ListBySubscription + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetProjects(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = ProjectClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetProjects"); + scope.Start(); + try + { + var response = ProjectRestClient.ListBySubscription(Id.SubscriptionId, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new ProjectResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = ProjectClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetProjects"); + scope.Start(); + try + { + var response = ProjectRestClient.ListBySubscriptionNextPage(nextLink, Id.SubscriptionId, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new ProjectResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/GroupCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/GroupCollection.cs new file mode 100644 index 000000000000..204189c769a1 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/GroupCollection.cs @@ -0,0 +1,309 @@ +// 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.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// 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 GetGroups method from an instance of . + /// + public partial class GroupCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _groupClientDiagnostics; + private readonly GroupsRestOperations _groupRestClient; + + /// Initializes a new instance of the class for mocking. + protected GroupCollection() + { + } + + /// 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 GroupCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _groupClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", GroupResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(GroupResource.ResourceType, out string groupApiVersion); + _groupRestClient = new GroupsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, groupApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ProjectResource.ResourceType), nameof(id)); + } + + /// + /// Create a new group by sending a json object of type 'group' as given in Models section as part of the Request Body. The group name in a project is unique. + /// + /// This operation is Idempotent. + /// + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// Operation Id: Groups_Create + /// + /// 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. + /// Unique name of a group within a project. + /// New or Updated Group object. + /// 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, GroupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _groupClientDiagnostics.CreateScope("GroupCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _groupRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, groupName, data, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(Response.FromValue(new GroupResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a new group by sending a json object of type 'group' as given in Models section as part of the Request Body. The group name in a project is unique. + /// + /// This operation is Idempotent. + /// + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// Operation Id: Groups_Create + /// + /// 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. + /// Unique name of a group within a project. + /// New or Updated Group object. + /// 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, GroupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _groupClientDiagnostics.CreateScope("GroupCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _groupRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, groupName, data, cancellationToken); + var operation = new MigrateArmOperation(Response.FromValue(new GroupResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get information related to a specific group in the project. Returns a json object of type 'group' as specified in the models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// Operation Id: Groups_Get + /// + /// Unique name of a group within a project. + /// 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 = _groupClientDiagnostics.CreateScope("GroupCollection.Get"); + scope.Start(); + try + { + var response = await _groupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, groupName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get information related to a specific group in the project. Returns a json object of type 'group' as specified in the models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// Operation Id: Groups_Get + /// + /// Unique name of a group within a project. + /// 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 = _groupClientDiagnostics.CreateScope("GroupCollection.Get"); + scope.Start(); + try + { + var response = _groupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, groupName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get all groups created in the project. Returns a json array of objects of type 'group' as specified in the Models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups + /// Operation Id: Groups_ListByProject + /// + /// 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) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _groupClientDiagnostics.CreateScope("GroupCollection.GetAll"); + scope.Start(); + try + { + var response = await _groupRestClient.ListByProjectAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new GroupResource(Client, value)), null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// + /// Get all groups created in the project. Returns a json array of objects of type 'group' as specified in the Models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups + /// Operation Id: Groups_ListByProject + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _groupClientDiagnostics.CreateScope("GroupCollection.GetAll"); + scope.Start(); + try + { + var response = _groupRestClient.ListByProject(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new GroupResource(Client, value)), null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + + /// + /// Checks to see if the resource exists in azure. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// Operation Id: Groups_Get + /// + /// Unique name of a group within a project. + /// 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 = _groupClientDiagnostics.CreateScope("GroupCollection.Exists"); + scope.Start(); + try + { + var response = await _groupRestClient.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: Groups_Get + /// + /// Unique name of a group within a project. + /// 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 = _groupClientDiagnostics.CreateScope("GroupCollection.Exists"); + scope.Start(); + try + { + var response = _groupRestClient.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; + } + } + + 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/migrate/Azure.ResourceManager.Migrate/src/Generated/GroupData.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/GroupData.cs new file mode 100644 index 000000000000..ca24c56127bb --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/GroupData.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + /// A class representing the Group data model. + public partial class GroupData : ResourceData + { + /// Initializes a new instance of GroupData. + /// Properties of the group. + /// is null. + public GroupData(GroupProperties properties) + { + if (properties == null) + { + throw new ArgumentNullException(nameof(properties)); + } + + Properties = properties; + } + + /// Initializes a new instance of GroupData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// For optimistic concurrency control. + /// Properties of the group. + internal GroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ETag? eTag, GroupProperties properties) : base(id, name, resourceType, systemData) + { + ETag = eTag; + Properties = properties; + } + + /// For optimistic concurrency control. + public ETag? ETag { get; set; } + /// Properties of the group. + public GroupProperties Properties { get; set; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/GroupResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/GroupResource.cs new file mode 100644 index 000000000000..42dc841adaf6 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/GroupResource.cs @@ -0,0 +1,345 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Migrate.Models; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// A Class representing a Group 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 GetGroupResource method. + /// Otherwise you can get one from its parent resource using the GetGroup method. + /// + public partial class GroupResource : ArmResource + { + /// Generate the resource identifier of a instance. + 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 _groupClientDiagnostics; + private readonly GroupsRestOperations _groupRestClient; + private readonly GroupData _data; + + /// Initializes a new instance of the class for mocking. + protected GroupResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal GroupResource(ArmClient client, GroupData 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 GroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _groupClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string groupApiVersion); + _groupRestClient = new GroupsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, groupApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/groups"; + + /// 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 GroupData 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 AssessmentResources in the Group. + /// An object representing collection of AssessmentResources and their operations over a AssessmentResource. + public virtual AssessmentCollection GetAssessments() + { + return GetCachedClient(Client => new AssessmentCollection(Client, Id)); + } + + /// + /// Get an existing assessment with the specified name. Returns a json object of type 'assessment' as specified in Models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// Operation Id: Assessments_Get + /// + /// Unique name of an assessment within a project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetAssessmentAsync(string assessmentName, CancellationToken cancellationToken = default) + { + return await GetAssessments().GetAsync(assessmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get an existing assessment with the specified name. Returns a json object of type 'assessment' as specified in Models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName}/assessments/{assessmentName} + /// Operation Id: Assessments_Get + /// + /// Unique name of an assessment within a project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetAssessment(string assessmentName, CancellationToken cancellationToken = default) + { + return GetAssessments().Get(assessmentName, cancellationToken); + } + + /// + /// Get information related to a specific group in the project. Returns a json object of type 'group' as specified in the models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// Operation Id: Groups_Get + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _groupClientDiagnostics.CreateScope("GroupResource.Get"); + scope.Start(); + try + { + var response = await _groupRestClient.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 GroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get information related to a specific group in the project. Returns a json object of type 'group' as specified in the models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// Operation Id: Groups_Get + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _groupClientDiagnostics.CreateScope("GroupResource.Get"); + scope.Start(); + try + { + var response = _groupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete the group from the project. The machines remain in the project. Deleting a non-existent group results in a no-operation. + /// + /// A group is an aggregation mechanism for machines in a project. Therefore, deleting group does not delete machines in it. + /// + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// Operation Id: Groups_Delete + /// + /// 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 = _groupClientDiagnostics.CreateScope("GroupResource.Delete"); + scope.Start(); + try + { + var response = await _groupRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(response); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete the group from the project. The machines remain in the project. Deleting a non-existent group results in a no-operation. + /// + /// A group is an aggregation mechanism for machines in a project. Therefore, deleting group does not delete machines in it. + /// + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// Operation Id: Groups_Delete + /// + /// 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 = _groupClientDiagnostics.CreateScope("GroupResource.Delete"); + scope.Start(); + try + { + var response = _groupRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MigrateArmOperation(response); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a new group by sending a json object of type 'group' as given in Models section as part of the Request Body. The group name in a project is unique. + /// + /// This operation is Idempotent. + /// + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// Operation Id: Groups_Create + /// + /// 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. + /// New or Updated Group object. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, GroupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _groupClientDiagnostics.CreateScope("GroupResource.Update"); + scope.Start(); + try + { + var response = await _groupRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(Response.FromValue(new GroupResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a new group by sending a json object of type 'group' as given in Models section as part of the Request Body. The group name in a project is unique. + /// + /// This operation is Idempotent. + /// + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// Operation Id: Groups_Create + /// + /// 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. + /// New or Updated Group object. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, GroupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _groupClientDiagnostics.CreateScope("GroupResource.Update"); + scope.Start(); + try + { + var response = _groupRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MigrateArmOperation(Response.FromValue(new GroupResource(Client, response), response.GetRawResponse())); + 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: Groups_UpdateMachines + /// + /// Machines list to be added or removed from group. + /// The cancellation token to use. + public virtual async Task> UpdateMachinesAsync(UpdateGroupBody groupUpdateProperties = null, CancellationToken cancellationToken = default) + { + using var scope = _groupClientDiagnostics.CreateScope("GroupResource.UpdateMachines"); + scope.Start(); + try + { + var response = await _groupRestClient.UpdateMachinesAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, groupUpdateProperties, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new GroupResource(Client, response.Value), response.GetRawResponse()); + } + 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: Groups_UpdateMachines + /// + /// Machines list to be added or removed from group. + /// The cancellation token to use. + public virtual Response UpdateMachines(UpdateGroupBody groupUpdateProperties = null, CancellationToken cancellationToken = default) + { + using var scope = _groupClientDiagnostics.CreateScope("GroupResource.UpdateMachines"); + scope.Start(); + try + { + var response = _groupRestClient.UpdateMachines(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, groupUpdateProperties, cancellationToken); + return Response.FromValue(new GroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/HyperVCollectorCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/HyperVCollectorCollection.cs new file mode 100644 index 000000000000..f88423e9df7a --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/HyperVCollectorCollection.cs @@ -0,0 +1,303 @@ +// 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.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// 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 GetHyperVCollectors method from an instance of . + /// + public partial class HyperVCollectorCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _hyperVCollectorClientDiagnostics; + private readonly HyperVCollectorsRestOperations _hyperVCollectorRestClient; + + /// Initializes a new instance of the class for mocking. + protected HyperVCollectorCollection() + { + } + + /// 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 HyperVCollectorCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _hyperVCollectorClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", HyperVCollectorResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(HyperVCollectorResource.ResourceType, out string hyperVCollectorApiVersion); + _hyperVCollectorRestClient = new HyperVCollectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hyperVCollectorApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ProjectResource.ResourceType), nameof(id)); + } + + /// + /// Create or Update Hyper-V collector + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hyperVCollectorName} + /// Operation Id: HyperVCollectors_Create + /// + /// 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. + /// Unique name of a Hyper-V collector within a project. + /// New or Updated Hyper-V collector. + /// 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, HyperVCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(hyperVCollectorName, nameof(hyperVCollectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _hyperVCollectorClientDiagnostics.CreateScope("HyperVCollectorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _hyperVCollectorRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, hyperVCollectorName, data, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(Response.FromValue(new HyperVCollectorResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or Update Hyper-V collector + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hyperVCollectorName} + /// Operation Id: HyperVCollectors_Create + /// + /// 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. + /// Unique name of a Hyper-V collector within a project. + /// New or Updated Hyper-V collector. + /// 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, HyperVCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(hyperVCollectorName, nameof(hyperVCollectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _hyperVCollectorClientDiagnostics.CreateScope("HyperVCollectorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _hyperVCollectorRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, hyperVCollectorName, data, cancellationToken); + var operation = new MigrateArmOperation(Response.FromValue(new HyperVCollectorResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Hyper-V collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hyperVCollectorName} + /// Operation Id: HyperVCollectors_Get + /// + /// Unique name of a Hyper-V collector within a project. + /// 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 = _hyperVCollectorClientDiagnostics.CreateScope("HyperVCollectorCollection.Get"); + scope.Start(); + try + { + var response = await _hyperVCollectorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, hyperVCollectorName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new HyperVCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Hyper-V collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hyperVCollectorName} + /// Operation Id: HyperVCollectors_Get + /// + /// Unique name of a Hyper-V collector within a project. + /// 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 = _hyperVCollectorClientDiagnostics.CreateScope("HyperVCollectorCollection.Get"); + scope.Start(); + try + { + var response = _hyperVCollectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, hyperVCollectorName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new HyperVCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a list of Hyper-V collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors + /// Operation Id: HyperVCollectors_ListByProject + /// + /// 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) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _hyperVCollectorClientDiagnostics.CreateScope("HyperVCollectorCollection.GetAll"); + scope.Start(); + try + { + var response = await _hyperVCollectorRestClient.ListByProjectAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new HyperVCollectorResource(Client, value)), null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// + /// Get a list of Hyper-V collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors + /// Operation Id: HyperVCollectors_ListByProject + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _hyperVCollectorClientDiagnostics.CreateScope("HyperVCollectorCollection.GetAll"); + scope.Start(); + try + { + var response = _hyperVCollectorRestClient.ListByProject(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new HyperVCollectorResource(Client, value)), null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + + /// + /// Checks to see if the resource exists in azure. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hyperVCollectorName} + /// Operation Id: HyperVCollectors_Get + /// + /// Unique name of a Hyper-V collector within a project. + /// 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 = _hyperVCollectorClientDiagnostics.CreateScope("HyperVCollectorCollection.Exists"); + scope.Start(); + try + { + var response = await _hyperVCollectorRestClient.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: HyperVCollectors_Get + /// + /// Unique name of a Hyper-V collector within a project. + /// 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 = _hyperVCollectorClientDiagnostics.CreateScope("HyperVCollectorCollection.Exists"); + scope.Start(); + try + { + var response = _hyperVCollectorRestClient.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; + } + } + + 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/migrate/Azure.ResourceManager.Migrate/src/Generated/HyperVCollectorData.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/HyperVCollectorData.cs new file mode 100644 index 000000000000..ca7e9e0b5d01 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/HyperVCollectorData.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure; +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + /// A class representing the HyperVCollector data model. + public partial class HyperVCollectorData : ResourceData + { + /// Initializes a new instance of HyperVCollectorData. + public HyperVCollectorData() + { + } + + /// Initializes a new instance of HyperVCollectorData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// + internal HyperVCollectorData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ETag? eTag, CollectorProperties properties) : base(id, name, resourceType, systemData) + { + ETag = eTag; + Properties = properties; + } + + /// Gets or sets the e tag. + public ETag? ETag { get; set; } + /// Gets or sets the properties. + public CollectorProperties Properties { get; set; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/HyperVCollectorResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/HyperVCollectorResource.cs new file mode 100644 index 000000000000..4fa12bfb7eb7 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/HyperVCollectorResource.cs @@ -0,0 +1,249 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// A Class representing a HyperVCollector 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 GetHyperVCollectorResource method. + /// Otherwise you can get one from its parent resource using the GetHyperVCollector method. + /// + public partial class HyperVCollectorResource : ArmResource + { + /// Generate the resource identifier of a instance. + 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 _hyperVCollectorClientDiagnostics; + private readonly HyperVCollectorsRestOperations _hyperVCollectorRestClient; + private readonly HyperVCollectorData _data; + + /// Initializes a new instance of the class for mocking. + protected HyperVCollectorResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal HyperVCollectorResource(ArmClient client, HyperVCollectorData 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 HyperVCollectorResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _hyperVCollectorClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string hyperVCollectorApiVersion); + _hyperVCollectorRestClient = new HyperVCollectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hyperVCollectorApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/hypervcollectors"; + + /// 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 HyperVCollectorData 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 Hyper-V collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hyperVCollectorName} + /// Operation Id: HyperVCollectors_Get + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _hyperVCollectorClientDiagnostics.CreateScope("HyperVCollectorResource.Get"); + scope.Start(); + try + { + var response = await _hyperVCollectorRestClient.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 HyperVCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Hyper-V collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hyperVCollectorName} + /// Operation Id: HyperVCollectors_Get + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _hyperVCollectorClientDiagnostics.CreateScope("HyperVCollectorResource.Get"); + scope.Start(); + try + { + var response = _hyperVCollectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new HyperVCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Hyper-V collector from the project. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hyperVCollectorName} + /// Operation Id: HyperVCollectors_Delete + /// + /// 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 = _hyperVCollectorClientDiagnostics.CreateScope("HyperVCollectorResource.Delete"); + scope.Start(); + try + { + var response = await _hyperVCollectorRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(response); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Hyper-V collector from the project. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hyperVCollectorName} + /// Operation Id: HyperVCollectors_Delete + /// + /// 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 = _hyperVCollectorClientDiagnostics.CreateScope("HyperVCollectorResource.Delete"); + scope.Start(); + try + { + var response = _hyperVCollectorRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MigrateArmOperation(response); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or Update Hyper-V collector + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hyperVCollectorName} + /// Operation Id: HyperVCollectors_Create + /// + /// 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. + /// New or Updated Hyper-V collector. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, HyperVCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _hyperVCollectorClientDiagnostics.CreateScope("HyperVCollectorResource.Update"); + scope.Start(); + try + { + var response = await _hyperVCollectorRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(Response.FromValue(new HyperVCollectorResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or Update Hyper-V collector + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hyperVCollectorName} + /// Operation Id: HyperVCollectors_Create + /// + /// 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. + /// New or Updated Hyper-V collector. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, HyperVCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _hyperVCollectorClientDiagnostics.CreateScope("HyperVCollectorResource.Update"); + scope.Start(); + try + { + var response = _hyperVCollectorRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MigrateArmOperation(Response.FromValue(new HyperVCollectorResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ImportCollectorCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ImportCollectorCollection.cs new file mode 100644 index 000000000000..5123c549c119 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ImportCollectorCollection.cs @@ -0,0 +1,303 @@ +// 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.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// 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 GetImportCollectors method from an instance of . + /// + public partial class ImportCollectorCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _importCollectorClientDiagnostics; + private readonly ImportCollectorsRestOperations _importCollectorRestClient; + + /// Initializes a new instance of the class for mocking. + protected ImportCollectorCollection() + { + } + + /// 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 ImportCollectorCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _importCollectorClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", ImportCollectorResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ImportCollectorResource.ResourceType, out string importCollectorApiVersion); + _importCollectorRestClient = new ImportCollectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, importCollectorApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ProjectResource.ResourceType), nameof(id)); + } + + /// + /// Create or Update Import collector + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// Operation Id: ImportCollectors_Create + /// + /// 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. + /// Unique name of a Import collector within a project. + /// New or Updated Import collector. + /// 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, ImportCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importCollectorName, nameof(importCollectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _importCollectorClientDiagnostics.CreateScope("ImportCollectorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _importCollectorRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importCollectorName, data, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(Response.FromValue(new ImportCollectorResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or Update Import collector + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// Operation Id: ImportCollectors_Create + /// + /// 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. + /// Unique name of a Import collector within a project. + /// New or Updated Import collector. + /// 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, ImportCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(importCollectorName, nameof(importCollectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _importCollectorClientDiagnostics.CreateScope("ImportCollectorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _importCollectorRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importCollectorName, data, cancellationToken); + var operation = new MigrateArmOperation(Response.FromValue(new ImportCollectorResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Import collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// Operation Id: ImportCollectors_Get + /// + /// Unique name of a Import collector within a project. + /// 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 = _importCollectorClientDiagnostics.CreateScope("ImportCollectorCollection.Get"); + scope.Start(); + try + { + var response = await _importCollectorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importCollectorName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ImportCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Import collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// Operation Id: ImportCollectors_Get + /// + /// Unique name of a Import collector within a project. + /// 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 = _importCollectorClientDiagnostics.CreateScope("ImportCollectorCollection.Get"); + scope.Start(); + try + { + var response = _importCollectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importCollectorName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ImportCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a list of Import collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors + /// Operation Id: ImportCollectors_ListByProject + /// + /// 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) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _importCollectorClientDiagnostics.CreateScope("ImportCollectorCollection.GetAll"); + scope.Start(); + try + { + var response = await _importCollectorRestClient.ListByProjectAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new ImportCollectorResource(Client, value)), null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// + /// Get a list of Import collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors + /// Operation Id: ImportCollectors_ListByProject + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _importCollectorClientDiagnostics.CreateScope("ImportCollectorCollection.GetAll"); + scope.Start(); + try + { + var response = _importCollectorRestClient.ListByProject(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new ImportCollectorResource(Client, value)), null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + + /// + /// Checks to see if the resource exists in azure. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// Operation Id: ImportCollectors_Get + /// + /// Unique name of a Import collector within a project. + /// 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 = _importCollectorClientDiagnostics.CreateScope("ImportCollectorCollection.Exists"); + scope.Start(); + try + { + var response = await _importCollectorRestClient.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: ImportCollectors_Get + /// + /// Unique name of a Import collector within a project. + /// 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 = _importCollectorClientDiagnostics.CreateScope("ImportCollectorCollection.Exists"); + scope.Start(); + try + { + var response = _importCollectorRestClient.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; + } + } + + 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/migrate/Azure.ResourceManager.Migrate/src/Generated/ImportCollectorData.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ImportCollectorData.cs new file mode 100644 index 000000000000..d67e097207bb --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ImportCollectorData.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure; +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + /// A class representing the ImportCollector data model. + public partial class ImportCollectorData : ResourceData + { + /// Initializes a new instance of ImportCollectorData. + public ImportCollectorData() + { + } + + /// Initializes a new instance of ImportCollectorData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// + internal ImportCollectorData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ETag? eTag, ImportCollectorProperties properties) : base(id, name, resourceType, systemData) + { + ETag = eTag; + Properties = properties; + } + + /// Gets or sets the e tag. + public ETag? ETag { get; set; } + /// Gets or sets the properties. + public ImportCollectorProperties Properties { get; set; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ImportCollectorResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ImportCollectorResource.cs new file mode 100644 index 000000000000..bf745deec371 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ImportCollectorResource.cs @@ -0,0 +1,249 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// A Class representing an ImportCollector 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 GetImportCollectorResource method. + /// Otherwise you can get one from its parent resource using the GetImportCollector method. + /// + public partial class ImportCollectorResource : ArmResource + { + /// Generate the resource identifier of a instance. + 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 _importCollectorClientDiagnostics; + private readonly ImportCollectorsRestOperations _importCollectorRestClient; + private readonly ImportCollectorData _data; + + /// Initializes a new instance of the class for mocking. + protected ImportCollectorResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ImportCollectorResource(ArmClient client, ImportCollectorData 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 ImportCollectorResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _importCollectorClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string importCollectorApiVersion); + _importCollectorRestClient = new ImportCollectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, importCollectorApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/importcollectors"; + + /// 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 ImportCollectorData 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 Import collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// Operation Id: ImportCollectors_Get + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _importCollectorClientDiagnostics.CreateScope("ImportCollectorResource.Get"); + scope.Start(); + try + { + var response = await _importCollectorRestClient.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 ImportCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Import collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// Operation Id: ImportCollectors_Get + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _importCollectorClientDiagnostics.CreateScope("ImportCollectorResource.Get"); + scope.Start(); + try + { + var response = _importCollectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ImportCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Import collector from the project. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// Operation Id: ImportCollectors_Delete + /// + /// 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 = _importCollectorClientDiagnostics.CreateScope("ImportCollectorResource.Delete"); + scope.Start(); + try + { + var response = await _importCollectorRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(response); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Import collector from the project. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// Operation Id: ImportCollectors_Delete + /// + /// 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 = _importCollectorClientDiagnostics.CreateScope("ImportCollectorResource.Delete"); + scope.Start(); + try + { + var response = _importCollectorRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MigrateArmOperation(response); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or Update Import collector + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// Operation Id: ImportCollectors_Create + /// + /// 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. + /// New or Updated Import collector. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ImportCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _importCollectorClientDiagnostics.CreateScope("ImportCollectorResource.Update"); + scope.Start(); + try + { + var response = await _importCollectorRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(Response.FromValue(new ImportCollectorResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or Update Import collector + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// Operation Id: ImportCollectors_Create + /// + /// 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. + /// New or Updated Import collector. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ImportCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _importCollectorClientDiagnostics.CreateScope("ImportCollectorResource.Update"); + scope.Start(); + try + { + var response = _importCollectorRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MigrateArmOperation(Response.FromValue(new ImportCollectorResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/MigrateArmOperation.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/MigrateArmOperation.cs new file mode 100644 index 000000000000..74c9a8b5c325 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/MigrateArmOperation.cs @@ -0,0 +1,69 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Migrate +{ +#pragma warning disable SA1649 // File name should match first type name + internal class MigrateArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + + /// Initializes a new instance of MigrateArmOperation for mocking. + protected MigrateArmOperation() + { + } + + internal MigrateArmOperation(Response response) + { + _operation = OperationInternal.Succeeded(response); + } + + internal MigrateArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia); + _operation = new OperationInternal(clientDiagnostics, nextLinkOperation, response, "MigrateArmOperation", fallbackStrategy: new ExponentialDelayStrategy()); + } + + /// +#pragma warning disable CA1822 + public override string Id => throw new NotImplementedException(); +#pragma warning restore CA1822 + + /// + 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/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/MigrateArmOperationOfT.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/MigrateArmOperationOfT.cs new file mode 100644 index 000000000000..3d8cf8ded6d6 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/MigrateArmOperationOfT.cs @@ -0,0 +1,75 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Migrate +{ +#pragma warning disable SA1649 // File name should match first type name + internal class MigrateArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + + /// Initializes a new instance of MigrateArmOperation for mocking. + protected MigrateArmOperation() + { + } + + internal MigrateArmOperation(Response response) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + } + + internal MigrateArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(source, pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia); + _operation = new OperationInternal(clientDiagnostics, nextLinkOperation, response, "MigrateArmOperation", fallbackStrategy: new ExponentialDelayStrategy()); + } + + /// +#pragma warning disable CA1822 + public override string Id => throw new NotImplementedException(); +#pragma warning restore CA1822 + + /// + 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/migrate/Azure.ResourceManager.Migrate/src/Generated/MachineCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/MachineCollection.cs new file mode 100644 index 000000000000..ede34e5c51a4 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/MachineCollection.cs @@ -0,0 +1,267 @@ +// 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.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// 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 GetMachines method from an instance of . + /// + public partial class MachineCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _machineClientDiagnostics; + private readonly MachinesRestOperations _machineRestClient; + + /// Initializes a new instance of the class for mocking. + protected MachineCollection() + { + } + + /// 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 MachineCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _machineClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", MachineResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MachineResource.ResourceType, out string machineApiVersion); + _machineRestClient = new MachinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, machineApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ProjectResource.ResourceType), nameof(id)); + } + + /// + /// Get the machine with the specified name. Returns a json object of type 'machine' defined in Models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/machines/{machineName} + /// Operation Id: Machines_Get + /// + /// Unique name of a machine in private datacenter. + /// 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 = _machineClientDiagnostics.CreateScope("MachineCollection.Get"); + scope.Start(); + try + { + var response = await _machineRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, machineName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the machine with the specified name. Returns a json object of type 'machine' defined in Models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/machines/{machineName} + /// Operation Id: Machines_Get + /// + /// Unique name of a machine in private datacenter. + /// 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 = _machineClientDiagnostics.CreateScope("MachineCollection.Get"); + scope.Start(); + try + { + var response = _machineRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, machineName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get data of all the machines available in the project. Returns a json array of objects of type 'machine' defined in Models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/machines + /// Operation Id: Machines_ListByProject + /// + /// 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) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _machineClientDiagnostics.CreateScope("MachineCollection.GetAll"); + scope.Start(); + try + { + var response = await _machineRestClient.ListByProjectAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new MachineResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _machineClientDiagnostics.CreateScope("MachineCollection.GetAll"); + scope.Start(); + try + { + var response = await _machineRestClient.ListByProjectNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new MachineResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); + } + + /// + /// Get data of all the machines available in the project. Returns a json array of objects of type 'machine' defined in Models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/machines + /// Operation Id: Machines_ListByProject + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _machineClientDiagnostics.CreateScope("MachineCollection.GetAll"); + scope.Start(); + try + { + var response = _machineRestClient.ListByProject(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new MachineResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _machineClientDiagnostics.CreateScope("MachineCollection.GetAll"); + scope.Start(); + try + { + var response = _machineRestClient.ListByProjectNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new MachineResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); + } + + /// + /// Checks to see if the resource exists in azure. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/machines/{machineName} + /// Operation Id: Machines_Get + /// + /// Unique name of a machine in private datacenter. + /// 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 = _machineClientDiagnostics.CreateScope("MachineCollection.Exists"); + scope.Start(); + try + { + var response = await _machineRestClient.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: Machines_Get + /// + /// Unique name of a machine in private datacenter. + /// 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 = _machineClientDiagnostics.CreateScope("MachineCollection.Exists"); + scope.Start(); + try + { + var response = _machineRestClient.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; + } + } + + 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/migrate/Azure.ResourceManager.Migrate/src/Generated/MachineData.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/MachineData.cs new file mode 100644 index 000000000000..0930296662f6 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/MachineData.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure; +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + /// A class representing the Machine data model. + public partial class MachineData : ResourceData + { + /// Initializes a new instance of MachineData. + internal MachineData() + { + } + + /// Initializes a new instance of MachineData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// For optimistic concurrency control. + /// Properties of the machine. + internal MachineData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ETag? eTag, MachineProperties properties) : base(id, name, resourceType, systemData) + { + ETag = eTag; + Properties = properties; + } + + /// For optimistic concurrency control. + public ETag? ETag { get; } + /// Properties of the machine. + public MachineProperties Properties { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/MachineResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/MachineResource.cs new file mode 100644 index 000000000000..fff79c07bb07 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/MachineResource.cs @@ -0,0 +1,137 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// A Class representing a Machine 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 GetMachineResource method. + /// Otherwise you can get one from its parent resource using the GetMachine method. + /// + public partial class MachineResource : ArmResource + { + /// Generate the resource identifier of a instance. + 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 _machineClientDiagnostics; + private readonly MachinesRestOperations _machineRestClient; + private readonly MachineData _data; + + /// Initializes a new instance of the class for mocking. + protected MachineResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MachineResource(ArmClient client, MachineData 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 MachineResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _machineClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string machineApiVersion); + _machineRestClient = new MachinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, machineApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/machines"; + + /// 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 MachineData 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 the machine with the specified name. Returns a json object of type 'machine' defined in Models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/machines/{machineName} + /// Operation Id: Machines_Get + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _machineClientDiagnostics.CreateScope("MachineResource.Get"); + scope.Start(); + try + { + var response = await _machineRestClient.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 MachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the machine with the specified name. Returns a json object of type 'machine' defined in Models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/machines/{machineName} + /// Operation Id: Machines_Get + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _machineClientDiagnostics.CreateScope("MachineResource.Get"); + scope.Start(); + try + { + var response = _machineRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MachineResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/MigratePrivateEndpointConnectionCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/MigratePrivateEndpointConnectionCollection.cs new file mode 100644 index 000000000000..d3426883e375 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/MigratePrivateEndpointConnectionCollection.cs @@ -0,0 +1,303 @@ +// 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.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// 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 GetMigratePrivateEndpointConnections method from an instance of . + /// + public partial class MigratePrivateEndpointConnectionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _migratePrivateEndpointConnectionPrivateEndpointConnectionClientDiagnostics; + private readonly PrivateEndpointConnectionRestOperations _migratePrivateEndpointConnectionPrivateEndpointConnectionRestClient; + + /// Initializes a new instance of the class for mocking. + protected MigratePrivateEndpointConnectionCollection() + { + } + + /// 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 MigratePrivateEndpointConnectionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migratePrivateEndpointConnectionPrivateEndpointConnectionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", MigratePrivateEndpointConnectionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MigratePrivateEndpointConnectionResource.ResourceType, out string migratePrivateEndpointConnectionPrivateEndpointConnectionApiVersion); + _migratePrivateEndpointConnectionPrivateEndpointConnectionRestClient = new PrivateEndpointConnectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migratePrivateEndpointConnectionPrivateEndpointConnectionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ProjectResource.ResourceType), nameof(id)); + } + + /// + /// Update a specific private endpoint connection in the project. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentprojects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// Operation Id: PrivateEndpointConnection_Update + /// + /// 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. + /// Unique name of a private endpoint connection within a project. + /// New or Updated Private Endpoint Connection object. + /// 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, MigratePrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migratePrivateEndpointConnectionPrivateEndpointConnectionClientDiagnostics.CreateScope("MigratePrivateEndpointConnectionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _migratePrivateEndpointConnectionPrivateEndpointConnectionRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(Response.FromValue(new MigratePrivateEndpointConnectionResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a specific private endpoint connection in the project. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentprojects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// Operation Id: PrivateEndpointConnection_Update + /// + /// 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. + /// Unique name of a private endpoint connection within a project. + /// New or Updated Private Endpoint Connection object. + /// 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, MigratePrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migratePrivateEndpointConnectionPrivateEndpointConnectionClientDiagnostics.CreateScope("MigratePrivateEndpointConnectionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _migratePrivateEndpointConnectionPrivateEndpointConnectionRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data, cancellationToken); + var operation = new MigrateArmOperation(Response.FromValue(new MigratePrivateEndpointConnectionResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get information related to a specific private endpoint connection in the project. Returns a json object of type 'privateEndpointConnections' as specified in the models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentprojects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// Operation Id: PrivateEndpointConnection_Get + /// + /// Unique name of a private endpoint connection within a project. + /// 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 = _migratePrivateEndpointConnectionPrivateEndpointConnectionClientDiagnostics.CreateScope("MigratePrivateEndpointConnectionCollection.Get"); + scope.Start(); + try + { + var response = await _migratePrivateEndpointConnectionPrivateEndpointConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigratePrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get information related to a specific private endpoint connection in the project. Returns a json object of type 'privateEndpointConnections' as specified in the models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentprojects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// Operation Id: PrivateEndpointConnection_Get + /// + /// Unique name of a private endpoint connection within a project. + /// 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 = _migratePrivateEndpointConnectionPrivateEndpointConnectionClientDiagnostics.CreateScope("MigratePrivateEndpointConnectionCollection.Get"); + scope.Start(); + try + { + var response = _migratePrivateEndpointConnectionPrivateEndpointConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigratePrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get all private endpoint connections in the project. Returns a json array of objects of type 'privateEndpointConnections' as specified in the Models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentprojects/{projectName}/privateEndpointConnections + /// Operation Id: PrivateEndpointConnection_ListByProject + /// + /// 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) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _migratePrivateEndpointConnectionPrivateEndpointConnectionClientDiagnostics.CreateScope("MigratePrivateEndpointConnectionCollection.GetAll"); + scope.Start(); + try + { + var response = await _migratePrivateEndpointConnectionPrivateEndpointConnectionRestClient.ListByProjectAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new MigratePrivateEndpointConnectionResource(Client, value)), null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// + /// Get all private endpoint connections in the project. Returns a json array of objects of type 'privateEndpointConnections' as specified in the Models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentprojects/{projectName}/privateEndpointConnections + /// Operation Id: PrivateEndpointConnection_ListByProject + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _migratePrivateEndpointConnectionPrivateEndpointConnectionClientDiagnostics.CreateScope("MigratePrivateEndpointConnectionCollection.GetAll"); + scope.Start(); + try + { + var response = _migratePrivateEndpointConnectionPrivateEndpointConnectionRestClient.ListByProject(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new MigratePrivateEndpointConnectionResource(Client, value)), null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + + /// + /// Checks to see if the resource exists in azure. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentprojects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// Operation Id: PrivateEndpointConnection_Get + /// + /// Unique name of a private endpoint connection within a project. + /// 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 = _migratePrivateEndpointConnectionPrivateEndpointConnectionClientDiagnostics.CreateScope("MigratePrivateEndpointConnectionCollection.Exists"); + scope.Start(); + try + { + var response = await _migratePrivateEndpointConnectionPrivateEndpointConnectionRestClient.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: PrivateEndpointConnection_Get + /// + /// Unique name of a private endpoint connection within a project. + /// 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 = _migratePrivateEndpointConnectionPrivateEndpointConnectionClientDiagnostics.CreateScope("MigratePrivateEndpointConnectionCollection.Exists"); + scope.Start(); + try + { + var response = _migratePrivateEndpointConnectionPrivateEndpointConnectionRestClient.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; + } + } + + 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/migrate/Azure.ResourceManager.Migrate/src/Generated/MigratePrivateEndpointConnectionData.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/MigratePrivateEndpointConnectionData.cs new file mode 100644 index 000000000000..1e94be35a410 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/MigratePrivateEndpointConnectionData.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + /// A class representing the MigratePrivateEndpointConnection data model. + public partial class MigratePrivateEndpointConnectionData : ResourceData + { + /// Initializes a new instance of MigratePrivateEndpointConnectionData. + /// Properties of the private endpoint endpoint connection. + /// is null. + public MigratePrivateEndpointConnectionData(PrivateEndpointConnectionProperties properties) + { + if (properties == null) + { + throw new ArgumentNullException(nameof(properties)); + } + + Properties = properties; + } + + /// Initializes a new instance of MigratePrivateEndpointConnectionData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// For optimistic concurrency control. + /// Properties of the private endpoint endpoint connection. + internal MigratePrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ETag? eTag, PrivateEndpointConnectionProperties properties) : base(id, name, resourceType, systemData) + { + ETag = eTag; + Properties = properties; + } + + /// For optimistic concurrency control. + public ETag? ETag { get; set; } + /// Properties of the private endpoint endpoint connection. + public PrivateEndpointConnectionProperties Properties { get; set; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/MigratePrivateEndpointConnectionResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/MigratePrivateEndpointConnectionResource.cs new file mode 100644 index 000000000000..69af3fc1aa32 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/MigratePrivateEndpointConnectionResource.cs @@ -0,0 +1,251 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// A Class representing a MigratePrivateEndpointConnection 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 GetMigratePrivateEndpointConnectionResource method. + /// Otherwise you can get one from its parent resource using the GetMigratePrivateEndpointConnection method. + /// + public partial class MigratePrivateEndpointConnectionResource : ArmResource + { + /// Generate the resource identifier of a instance. + 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 _migratePrivateEndpointConnectionPrivateEndpointConnectionClientDiagnostics; + private readonly PrivateEndpointConnectionRestOperations _migratePrivateEndpointConnectionPrivateEndpointConnectionRestClient; + private readonly MigratePrivateEndpointConnectionData _data; + + /// Initializes a new instance of the class for mocking. + protected MigratePrivateEndpointConnectionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MigratePrivateEndpointConnectionResource(ArmClient client, MigratePrivateEndpointConnectionData 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 MigratePrivateEndpointConnectionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migratePrivateEndpointConnectionPrivateEndpointConnectionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string migratePrivateEndpointConnectionPrivateEndpointConnectionApiVersion); + _migratePrivateEndpointConnectionPrivateEndpointConnectionRestClient = new PrivateEndpointConnectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migratePrivateEndpointConnectionPrivateEndpointConnectionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentprojects/privateEndpointConnections"; + + /// 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 MigratePrivateEndpointConnectionData 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 information related to a specific private endpoint connection in the project. Returns a json object of type 'privateEndpointConnections' as specified in the models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentprojects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// Operation Id: PrivateEndpointConnection_Get + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _migratePrivateEndpointConnectionPrivateEndpointConnectionClientDiagnostics.CreateScope("MigratePrivateEndpointConnectionResource.Get"); + scope.Start(); + try + { + var response = await _migratePrivateEndpointConnectionPrivateEndpointConnectionRestClient.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 MigratePrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get information related to a specific private endpoint connection in the project. Returns a json object of type 'privateEndpointConnections' as specified in the models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentprojects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// Operation Id: PrivateEndpointConnection_Get + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _migratePrivateEndpointConnectionPrivateEndpointConnectionClientDiagnostics.CreateScope("MigratePrivateEndpointConnectionResource.Get"); + scope.Start(); + try + { + var response = _migratePrivateEndpointConnectionPrivateEndpointConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigratePrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete the private endpoint connection from the project. T. + /// + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentprojects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// Operation Id: PrivateEndpointConnection_Delete + /// + /// 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 = _migratePrivateEndpointConnectionPrivateEndpointConnectionClientDiagnostics.CreateScope("MigratePrivateEndpointConnectionResource.Delete"); + scope.Start(); + try + { + var response = await _migratePrivateEndpointConnectionPrivateEndpointConnectionRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(response); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete the private endpoint connection from the project. T. + /// + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentprojects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// Operation Id: PrivateEndpointConnection_Delete + /// + /// 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 = _migratePrivateEndpointConnectionPrivateEndpointConnectionClientDiagnostics.CreateScope("MigratePrivateEndpointConnectionResource.Delete"); + scope.Start(); + try + { + var response = _migratePrivateEndpointConnectionPrivateEndpointConnectionRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MigrateArmOperation(response); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a specific private endpoint connection in the project. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentprojects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// Operation Id: PrivateEndpointConnection_Update + /// + /// 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. + /// New or Updated Private Endpoint Connection object. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, MigratePrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migratePrivateEndpointConnectionPrivateEndpointConnectionClientDiagnostics.CreateScope("MigratePrivateEndpointConnectionResource.Update"); + scope.Start(); + try + { + var response = await _migratePrivateEndpointConnectionPrivateEndpointConnectionRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(Response.FromValue(new MigratePrivateEndpointConnectionResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a specific private endpoint connection in the project. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentprojects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// Operation Id: PrivateEndpointConnection_Update + /// + /// 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. + /// New or Updated Private Endpoint Connection object. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, MigratePrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _migratePrivateEndpointConnectionPrivateEndpointConnectionClientDiagnostics.CreateScope("MigratePrivateEndpointConnectionResource.Update"); + scope.Start(); + try + { + var response = _migratePrivateEndpointConnectionPrivateEndpointConnectionRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MigrateArmOperation(Response.FromValue(new MigratePrivateEndpointConnectionResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/MigratePrivateLinkResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/MigratePrivateLinkResource.cs new file mode 100644 index 000000000000..02c0da647d94 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/MigratePrivateLinkResource.cs @@ -0,0 +1,137 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// A Class representing a MigratePrivateLinkResource 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 GetMigratePrivateLinkResource method. + /// Otherwise you can get one from its parent resource using the GetMigratePrivateLinkResource method. + /// + public partial class MigratePrivateLinkResource : ArmResource + { + /// Generate the resource identifier of a instance. + 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 _migratePrivateLinkResourcePrivateLinkResourceClientDiagnostics; + private readonly PrivateLinkResourceRestOperations _migratePrivateLinkResourcePrivateLinkResourceRestClient; + private readonly MigratePrivateLinkResourceData _data; + + /// Initializes a new instance of the class for mocking. + protected MigratePrivateLinkResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MigratePrivateLinkResource(ArmClient client, MigratePrivateLinkResourceData 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 MigratePrivateLinkResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migratePrivateLinkResourcePrivateLinkResourceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string migratePrivateLinkResourcePrivateLinkResourceApiVersion); + _migratePrivateLinkResourcePrivateLinkResourceRestClient = new PrivateLinkResourceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migratePrivateLinkResourcePrivateLinkResourceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentprojects/privateLinkResources"; + + /// 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 MigratePrivateLinkResourceData 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 information related to a specific private Link Resource in the project. Returns a json object of type 'privateLinkResources' as specified in the models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentprojects/{projectName}/privateLinkResources/{privateLinkResourceName} + /// Operation Id: PrivateLinkResource_Get + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _migratePrivateLinkResourcePrivateLinkResourceClientDiagnostics.CreateScope("MigratePrivateLinkResource.Get"); + scope.Start(); + try + { + var response = await _migratePrivateLinkResourcePrivateLinkResourceRestClient.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 MigratePrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get information related to a specific private Link Resource in the project. Returns a json object of type 'privateLinkResources' as specified in the models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentprojects/{projectName}/privateLinkResources/{privateLinkResourceName} + /// Operation Id: PrivateLinkResource_Get + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _migratePrivateLinkResourcePrivateLinkResourceClientDiagnostics.CreateScope("MigratePrivateLinkResource.Get"); + scope.Start(); + try + { + var response = _migratePrivateLinkResourcePrivateLinkResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigratePrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/MigratePrivateLinkResourceCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/MigratePrivateLinkResourceCollection.cs new file mode 100644 index 000000000000..5800dddb62e0 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/MigratePrivateLinkResourceCollection.cs @@ -0,0 +1,237 @@ +// 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.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// 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 GetMigratePrivateLinkResources method from an instance of . + /// + public partial class MigratePrivateLinkResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _migratePrivateLinkResourcePrivateLinkResourceClientDiagnostics; + private readonly PrivateLinkResourceRestOperations _migratePrivateLinkResourcePrivateLinkResourceRestClient; + + /// Initializes a new instance of the class for mocking. + protected MigratePrivateLinkResourceCollection() + { + } + + /// 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 MigratePrivateLinkResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _migratePrivateLinkResourcePrivateLinkResourceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", MigratePrivateLinkResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MigratePrivateLinkResource.ResourceType, out string migratePrivateLinkResourcePrivateLinkResourceApiVersion); + _migratePrivateLinkResourcePrivateLinkResourceRestClient = new PrivateLinkResourceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, migratePrivateLinkResourcePrivateLinkResourceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ProjectResource.ResourceType), nameof(id)); + } + + /// + /// Get information related to a specific private Link Resource in the project. Returns a json object of type 'privateLinkResources' as specified in the models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentprojects/{projectName}/privateLinkResources/{privateLinkResourceName} + /// Operation Id: PrivateLinkResource_Get + /// + /// Unique name of a private link resource within a project. + /// 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 = _migratePrivateLinkResourcePrivateLinkResourceClientDiagnostics.CreateScope("MigratePrivateLinkResourceCollection.Get"); + scope.Start(); + try + { + var response = await _migratePrivateLinkResourcePrivateLinkResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigratePrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get information related to a specific private Link Resource in the project. Returns a json object of type 'privateLinkResources' as specified in the models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentprojects/{projectName}/privateLinkResources/{privateLinkResourceName} + /// Operation Id: PrivateLinkResource_Get + /// + /// Unique name of a private link resource within a project. + /// 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 = _migratePrivateLinkResourcePrivateLinkResourceClientDiagnostics.CreateScope("MigratePrivateLinkResourceCollection.Get"); + scope.Start(); + try + { + var response = _migratePrivateLinkResourcePrivateLinkResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MigratePrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get all private link resources created in the project. Returns a json array of objects of type 'privateLinkResources' as specified in the Models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentprojects/{projectName}/privateLinkResources + /// Operation Id: PrivateLinkResource_ListByProject + /// + /// 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) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _migratePrivateLinkResourcePrivateLinkResourceClientDiagnostics.CreateScope("MigratePrivateLinkResourceCollection.GetAll"); + scope.Start(); + try + { + var response = await _migratePrivateLinkResourcePrivateLinkResourceRestClient.ListByProjectAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new MigratePrivateLinkResource(Client, value)), null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// + /// Get all private link resources created in the project. Returns a json array of objects of type 'privateLinkResources' as specified in the Models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentprojects/{projectName}/privateLinkResources + /// Operation Id: PrivateLinkResource_ListByProject + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _migratePrivateLinkResourcePrivateLinkResourceClientDiagnostics.CreateScope("MigratePrivateLinkResourceCollection.GetAll"); + scope.Start(); + try + { + var response = _migratePrivateLinkResourcePrivateLinkResourceRestClient.ListByProject(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new MigratePrivateLinkResource(Client, value)), null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + + /// + /// Checks to see if the resource exists in azure. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentprojects/{projectName}/privateLinkResources/{privateLinkResourceName} + /// Operation Id: PrivateLinkResource_Get + /// + /// Unique name of a private link resource within a project. + /// 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 = _migratePrivateLinkResourcePrivateLinkResourceClientDiagnostics.CreateScope("MigratePrivateLinkResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _migratePrivateLinkResourcePrivateLinkResourceRestClient.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: PrivateLinkResource_Get + /// + /// Unique name of a private link resource within a project. + /// 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 = _migratePrivateLinkResourcePrivateLinkResourceClientDiagnostics.CreateScope("MigratePrivateLinkResourceCollection.Exists"); + scope.Start(); + try + { + var response = _migratePrivateLinkResourcePrivateLinkResourceRestClient.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; + } + } + + 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/migrate/Azure.ResourceManager.Migrate/src/Generated/MigratePrivateLinkResourceData.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/MigratePrivateLinkResourceData.cs new file mode 100644 index 000000000000..93370a6a2455 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/MigratePrivateLinkResourceData.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + /// A class representing the MigratePrivateLinkResource data model. + public partial class MigratePrivateLinkResourceData : ResourceData + { + /// Initializes a new instance of MigratePrivateLinkResourceData. + internal MigratePrivateLinkResourceData() + { + } + + /// Initializes a new instance of MigratePrivateLinkResourceData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Properties of the private link resource. + internal MigratePrivateLinkResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MigratePrivateLinkResourceProperties properties) : base(id, name, resourceType, systemData) + { + Properties = properties; + } + + /// Properties of the private link resource. + public MigratePrivateLinkResourceProperties Properties { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedDisk.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedDisk.Serialization.cs new file mode 100644 index 000000000000..df9a412e58df --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedDisk.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class AssessedDisk + { + internal static AssessedDisk DeserializeAssessedDisk(JsonElement element) + { + Optional name = default; + Optional displayName = default; + Optional gigabytesProvisioned = default; + Optional megabytesPerSecondOfRead = default; + Optional megabytesPerSecondOfWrite = default; + Optional numberOfReadOperationsPerSecond = default; + Optional numberOfWriteOperationsPerSecond = default; + Optional monthlyStorageCost = default; + Optional recommendedDiskType = default; + Optional recommendedDiskSize = default; + Optional gigabytesForRecommendedDiskSize = default; + Optional suitability = default; + Optional suitabilityExplanation = default; + Optional suitabilityDetail = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName")) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("gigabytesProvisioned")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + gigabytesProvisioned = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("megabytesPerSecondOfRead")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + megabytesPerSecondOfRead = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("megabytesPerSecondOfWrite")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + megabytesPerSecondOfWrite = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("numberOfReadOperationsPerSecond")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + numberOfReadOperationsPerSecond = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("numberOfWriteOperationsPerSecond")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + numberOfWriteOperationsPerSecond = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyStorageCost")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + monthlyStorageCost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("recommendedDiskType")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + recommendedDiskType = new AzureDiskType(property.Value.GetString()); + continue; + } + if (property.NameEquals("recommendedDiskSize")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + recommendedDiskSize = new AzureDiskSize(property.Value.GetString()); + continue; + } + if (property.NameEquals("gigabytesForRecommendedDiskSize")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + gigabytesForRecommendedDiskSize = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("suitability")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + suitability = new CloudSuitability(property.Value.GetString()); + continue; + } + if (property.NameEquals("suitabilityExplanation")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + suitabilityExplanation = new AzureDiskSuitabilityExplanation(property.Value.GetString()); + continue; + } + if (property.NameEquals("suitabilityDetail")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + suitabilityDetail = new AzureDiskSuitabilityDetail(property.Value.GetString()); + continue; + } + } + return new AssessedDisk(name.Value, displayName.Value, Optional.ToNullable(gigabytesProvisioned), Optional.ToNullable(megabytesPerSecondOfRead), Optional.ToNullable(megabytesPerSecondOfWrite), Optional.ToNullable(numberOfReadOperationsPerSecond), Optional.ToNullable(numberOfWriteOperationsPerSecond), Optional.ToNullable(monthlyStorageCost), Optional.ToNullable(recommendedDiskType), Optional.ToNullable(recommendedDiskSize), Optional.ToNullable(gigabytesForRecommendedDiskSize), Optional.ToNullable(suitability), Optional.ToNullable(suitabilityExplanation), Optional.ToNullable(suitabilityDetail)); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedDisk.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedDisk.cs new file mode 100644 index 000000000000..4ee52c4ab9c9 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedDisk.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Migrate.Models +{ + /// A disk assessed for an assessment. + public partial class AssessedDisk + { + /// Initializes a new instance of AssessedDisk. + internal AssessedDisk() + { + } + + /// Initializes a new instance of AssessedDisk. + /// Name of the assessed disk. + /// User friendly name of the assessed disk. + /// Gigabytes of storage provisioned for this disk. + /// Disk throughput in MegaBytes per second. + /// Disk throughput in MegaBytes per second. + /// Number of read operations per second for the disk. + /// Number of read and write operations per second for the disk. + /// Estimated aggregate storage cost for a 31-day month for this disk. + /// Storage type selected for this disk. + /// Recommended Azure size for the disk, given utilization data and preferences set on Assessment. + /// Gigabytes of storage provided by the recommended Azure disk size. + /// Whether this disk is suitable for Azure. + /// If disk is not suitable to be migrated, this explains the reasons and mitigation steps. + /// If disk is suitable to be migrate but some conditions/checks were not considered while calculating suitability, this explains the details. + internal AssessedDisk(string name, string displayName, double? gigabytesProvisioned, double? megabytesPerSecondOfRead, double? megabytesPerSecondOfWrite, double? numberOfReadOperationsPerSecond, double? numberOfWriteOperationsPerSecond, double? monthlyStorageCost, AzureDiskType? recommendedDiskType, AzureDiskSize? recommendedDiskSize, int? gigabytesForRecommendedDiskSize, CloudSuitability? suitability, AzureDiskSuitabilityExplanation? suitabilityExplanation, AzureDiskSuitabilityDetail? suitabilityDetail) + { + Name = name; + DisplayName = displayName; + GigabytesProvisioned = gigabytesProvisioned; + MegabytesPerSecondOfRead = megabytesPerSecondOfRead; + MegabytesPerSecondOfWrite = megabytesPerSecondOfWrite; + NumberOfReadOperationsPerSecond = numberOfReadOperationsPerSecond; + NumberOfWriteOperationsPerSecond = numberOfWriteOperationsPerSecond; + MonthlyStorageCost = monthlyStorageCost; + RecommendedDiskType = recommendedDiskType; + RecommendedDiskSize = recommendedDiskSize; + GigabytesForRecommendedDiskSize = gigabytesForRecommendedDiskSize; + Suitability = suitability; + SuitabilityExplanation = suitabilityExplanation; + SuitabilityDetail = suitabilityDetail; + } + + /// Name of the assessed disk. + public string Name { get; } + /// User friendly name of the assessed disk. + public string DisplayName { get; } + /// Gigabytes of storage provisioned for this disk. + public double? GigabytesProvisioned { get; } + /// Disk throughput in MegaBytes per second. + public double? MegabytesPerSecondOfRead { get; } + /// Disk throughput in MegaBytes per second. + public double? MegabytesPerSecondOfWrite { get; } + /// Number of read operations per second for the disk. + public double? NumberOfReadOperationsPerSecond { get; } + /// Number of read and write operations per second for the disk. + public double? NumberOfWriteOperationsPerSecond { get; } + /// Estimated aggregate storage cost for a 31-day month for this disk. + public double? MonthlyStorageCost { get; } + /// Storage type selected for this disk. + public AzureDiskType? RecommendedDiskType { get; } + /// Recommended Azure size for the disk, given utilization data and preferences set on Assessment. + public AzureDiskSize? RecommendedDiskSize { get; } + /// Gigabytes of storage provided by the recommended Azure disk size. + public int? GigabytesForRecommendedDiskSize { get; } + /// Whether this disk is suitable for Azure. + public CloudSuitability? Suitability { get; } + /// If disk is not suitable to be migrated, this explains the reasons and mitigation steps. + public AzureDiskSuitabilityExplanation? SuitabilityExplanation { get; } + /// If disk is suitable to be migrate but some conditions/checks were not considered while calculating suitability, this explains the details. + public AzureDiskSuitabilityDetail? SuitabilityDetail { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedMachineData.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedMachineData.Serialization.cs new file mode 100644 index 000000000000..f169a872677b --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedMachineData.Serialization.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + public partial class AssessedMachineData + { + internal static AssessedMachineData DeserializeAssessedMachineData(JsonElement element) + { + Optional eTag = default; + Optional properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("eTag")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + eTag = new ETag(property.Value.GetString()); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + properties = AssessedMachineProperties.DeserializeAssessedMachineProperties(property.Value); + continue; + } + if (property.NameEquals("id")) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.ToString()); + continue; + } + } + return new AssessedMachineData(id, name, type, systemData.Value, Optional.ToNullable(eTag), properties.Value); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedMachineProperties.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedMachineProperties.Serialization.cs new file mode 100644 index 000000000000..eaaf99b4c1e5 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedMachineProperties.Serialization.cs @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class AssessedMachineProperties + { + internal static AssessedMachineProperties DeserializeAssessedMachineProperties(JsonElement element) + { + Optional bootType = default; + Optional datacenterMachineArmId = default; + Optional datacenterManagementServerArmId = default; + Optional datacenterManagementServerName = default; + Optional description = default; + Optional displayName = default; + Optional megabytesOfMemory = default; + Optional numberOfCores = default; + Optional operatingSystemType = default; + Optional operatingSystemName = default; + Optional operatingSystemVersion = default; + Optional monthlyBandwidthCost = default; + Optional monthlyStorageCost = default; + Optional monthlyPremiumStorageCost = default; + Optional monthlyStandardSSDStorageCost = default; + Optional confidenceRatingInPercentage = default; + Optional> disks = default; + Optional> networkAdapters = default; + Optional recommendedSize = default; + Optional numberOfCoresForRecommendedSize = default; + Optional megabytesOfMemoryForRecommendedSize = default; + Optional monthlyComputeCostForRecommendedSize = default; + Optional percentageCoresUtilization = default; + Optional percentageMemoryUtilization = default; + Optional suitability = default; + Optional suitabilityExplanation = default; + Optional suitabilityDetail = default; + Optional createdTimestamp = default; + Optional updatedTimestamp = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("bootType")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + bootType = new MachineBootType(property.Value.GetString()); + continue; + } + if (property.NameEquals("datacenterMachineArmId")) + { + datacenterMachineArmId = property.Value.GetString(); + continue; + } + if (property.NameEquals("datacenterManagementServerArmId")) + { + datacenterManagementServerArmId = property.Value.GetString(); + continue; + } + if (property.NameEquals("datacenterManagementServerName")) + { + datacenterManagementServerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("description")) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName")) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("megabytesOfMemory")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + megabytesOfMemory = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("numberOfCores")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + numberOfCores = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("operatingSystemType")) + { + operatingSystemType = property.Value.GetString(); + continue; + } + if (property.NameEquals("operatingSystemName")) + { + operatingSystemName = property.Value.GetString(); + continue; + } + if (property.NameEquals("operatingSystemVersion")) + { + operatingSystemVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("monthlyBandwidthCost")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + monthlyBandwidthCost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyStorageCost")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + monthlyStorageCost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyPremiumStorageCost")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + monthlyPremiumStorageCost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyStandardSSDStorageCost")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + monthlyStandardSSDStorageCost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("confidenceRatingInPercentage")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + confidenceRatingInPercentage = null; + continue; + } + confidenceRatingInPercentage = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("disks")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, AssessedDisk.DeserializeAssessedDisk(property0.Value)); + } + disks = dictionary; + continue; + } + if (property.NameEquals("networkAdapters")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, AssessedNetworkAdapter.DeserializeAssessedNetworkAdapter(property0.Value)); + } + networkAdapters = dictionary; + continue; + } + if (property.NameEquals("recommendedSize")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + recommendedSize = new AzureVmSize(property.Value.GetString()); + continue; + } + if (property.NameEquals("numberOfCoresForRecommendedSize")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + numberOfCoresForRecommendedSize = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("megabytesOfMemoryForRecommendedSize")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + megabytesOfMemoryForRecommendedSize = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyComputeCostForRecommendedSize")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + monthlyComputeCostForRecommendedSize = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("percentageCoresUtilization")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + percentageCoresUtilization = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("percentageMemoryUtilization")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + percentageMemoryUtilization = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("suitability")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + suitability = new CloudSuitability(property.Value.GetString()); + continue; + } + if (property.NameEquals("suitabilityExplanation")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + suitabilityExplanation = new AzureVmSuitabilityExplanation(property.Value.GetString()); + continue; + } + if (property.NameEquals("suitabilityDetail")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + suitabilityDetail = new AzureVmSuitabilityDetail(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdTimestamp")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + createdTimestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("updatedTimestamp")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + updatedTimestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new AssessedMachineProperties(Optional.ToNullable(bootType), datacenterMachineArmId.Value, datacenterManagementServerArmId.Value, datacenterManagementServerName.Value, description.Value, displayName.Value, Optional.ToNullable(megabytesOfMemory), Optional.ToNullable(numberOfCores), operatingSystemType.Value, operatingSystemName.Value, operatingSystemVersion.Value, Optional.ToNullable(monthlyBandwidthCost), Optional.ToNullable(monthlyStorageCost), Optional.ToNullable(monthlyPremiumStorageCost), Optional.ToNullable(monthlyStandardSSDStorageCost), Optional.ToNullable(confidenceRatingInPercentage), Optional.ToDictionary(disks), Optional.ToDictionary(networkAdapters), Optional.ToNullable(recommendedSize), Optional.ToNullable(numberOfCoresForRecommendedSize), Optional.ToNullable(megabytesOfMemoryForRecommendedSize), Optional.ToNullable(monthlyComputeCostForRecommendedSize), Optional.ToNullable(percentageCoresUtilization), Optional.ToNullable(percentageMemoryUtilization), Optional.ToNullable(suitability), Optional.ToNullable(suitabilityExplanation), Optional.ToNullable(suitabilityDetail), Optional.ToNullable(createdTimestamp), Optional.ToNullable(updatedTimestamp)); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedMachineProperties.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedMachineProperties.cs new file mode 100644 index 000000000000..94a5850f5170 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedMachineProperties.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; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Properties of an assessed machine. + public partial class AssessedMachineProperties + { + /// Initializes a new instance of AssessedMachineProperties. + internal AssessedMachineProperties() + { + Disks = new ChangeTrackingDictionary(); + NetworkAdapters = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of AssessedMachineProperties. + /// Boot type of the machine. + /// ARM ID of the discovered machine. + /// ARM ID of the discovered datacenter. + /// Name of the server hosting the datacenter management solution. + /// Description of the machine. + /// User readable name of the machine as defined by the user in their private datacenter. + /// Memory in Megabytes. + /// Processor count. + /// Operating System type of the machine. + /// Operating System name of the machine. + /// Operating System version of the machine. + /// Monthly network cost estimate for the network adapters that are attached to this machine as a group, for a 31-day month. + /// Monthly storage cost estimate for the disks that are attached to this machine as a group, for a 31-day month. + /// Monthly premium storage cost estimate for the disks that are attached to this machine as a group, for a 31-day month. + /// Monthly standard SSD storage cost estimate for the disks that are attached to this machine as a group, for a 31-day month. + /// Confidence rating of assessed machine. + /// Dictionary of disks attached to the machine. Key is ID of disk. Value is a disk object. + /// Dictionary of network adapters attached to the machine. Key is name of the adapter. Value is a network adapter object. + /// Recommended Azure size for this machine. + /// Number of CPU cores in the Recommended Azure VM Size. + /// Megabytes of memory in the Recommended Azure VM Size. + /// Compute Cost for a 31-day month, if the machine is migrated to Azure with the Recommended Size. + /// Utilization percentage of the processor core as observed in the private data center, in the Time Range selected on Assessment, reported as the Percentile value based on the percentile number selected in assessment. + /// Utilization percentage of the memory as observed in the private data center, in the Time Range selected on Assessment, reported as the Percentile value based on the percentile number selected in assessment. + /// Whether machine is suitable for migration to Azure. + /// If machine is not ready to be migrated, this explains the reasons and mitigation steps. + /// If machine is not suitable for cloud, this explains the reasons. + /// Time when this machine was created. Date-Time represented in ISO-8601 format. + /// Time when this machine was last updated. Date-Time represented in ISO-8601 format. + internal AssessedMachineProperties(MachineBootType? bootType, string datacenterMachineArmId, string datacenterManagementServerArmId, string datacenterManagementServerName, string description, string displayName, double? megabytesOfMemory, int? numberOfCores, string operatingSystemType, string operatingSystemName, string operatingSystemVersion, double? monthlyBandwidthCost, double? monthlyStorageCost, double? monthlyPremiumStorageCost, double? monthlyStandardSSDStorageCost, double? confidenceRatingInPercentage, IReadOnlyDictionary disks, IReadOnlyDictionary networkAdapters, AzureVmSize? recommendedSize, int? numberOfCoresForRecommendedSize, double? megabytesOfMemoryForRecommendedSize, double? monthlyComputeCostForRecommendedSize, double? percentageCoresUtilization, double? percentageMemoryUtilization, CloudSuitability? suitability, AzureVmSuitabilityExplanation? suitabilityExplanation, AzureVmSuitabilityDetail? suitabilityDetail, DateTimeOffset? createdTimestamp, DateTimeOffset? updatedTimestamp) + { + BootType = bootType; + DatacenterMachineArmId = datacenterMachineArmId; + DatacenterManagementServerArmId = datacenterManagementServerArmId; + DatacenterManagementServerName = datacenterManagementServerName; + Description = description; + DisplayName = displayName; + MegabytesOfMemory = megabytesOfMemory; + NumberOfCores = numberOfCores; + OperatingSystemType = operatingSystemType; + OperatingSystemName = operatingSystemName; + OperatingSystemVersion = operatingSystemVersion; + MonthlyBandwidthCost = monthlyBandwidthCost; + MonthlyStorageCost = monthlyStorageCost; + MonthlyPremiumStorageCost = monthlyPremiumStorageCost; + MonthlyStandardSSDStorageCost = monthlyStandardSSDStorageCost; + ConfidenceRatingInPercentage = confidenceRatingInPercentage; + Disks = disks; + NetworkAdapters = networkAdapters; + RecommendedSize = recommendedSize; + NumberOfCoresForRecommendedSize = numberOfCoresForRecommendedSize; + MegabytesOfMemoryForRecommendedSize = megabytesOfMemoryForRecommendedSize; + MonthlyComputeCostForRecommendedSize = monthlyComputeCostForRecommendedSize; + PercentageCoresUtilization = percentageCoresUtilization; + PercentageMemoryUtilization = percentageMemoryUtilization; + Suitability = suitability; + SuitabilityExplanation = suitabilityExplanation; + SuitabilityDetail = suitabilityDetail; + CreatedTimestamp = createdTimestamp; + UpdatedTimestamp = updatedTimestamp; + } + + /// Boot type of the machine. + public MachineBootType? BootType { get; } + /// ARM ID of the discovered machine. + public string DatacenterMachineArmId { get; } + /// ARM ID of the discovered datacenter. + public string DatacenterManagementServerArmId { get; } + /// Name of the server hosting the datacenter management solution. + public string DatacenterManagementServerName { get; } + /// Description of the machine. + public string Description { get; } + /// User readable name of the machine as defined by the user in their private datacenter. + public string DisplayName { get; } + /// Memory in Megabytes. + public double? MegabytesOfMemory { get; } + /// Processor count. + public int? NumberOfCores { get; } + /// Operating System type of the machine. + public string OperatingSystemType { get; } + /// Operating System name of the machine. + public string OperatingSystemName { get; } + /// Operating System version of the machine. + public string OperatingSystemVersion { get; } + /// Monthly network cost estimate for the network adapters that are attached to this machine as a group, for a 31-day month. + public double? MonthlyBandwidthCost { get; } + /// Monthly storage cost estimate for the disks that are attached to this machine as a group, for a 31-day month. + public double? MonthlyStorageCost { get; } + /// Monthly premium storage cost estimate for the disks that are attached to this machine as a group, for a 31-day month. + public double? MonthlyPremiumStorageCost { get; } + /// Monthly standard SSD storage cost estimate for the disks that are attached to this machine as a group, for a 31-day month. + public double? MonthlyStandardSSDStorageCost { get; } + /// Confidence rating of assessed machine. + public double? ConfidenceRatingInPercentage { get; } + /// Dictionary of disks attached to the machine. Key is ID of disk. Value is a disk object. + public IReadOnlyDictionary Disks { get; } + /// Dictionary of network adapters attached to the machine. Key is name of the adapter. Value is a network adapter object. + public IReadOnlyDictionary NetworkAdapters { get; } + /// Recommended Azure size for this machine. + public AzureVmSize? RecommendedSize { get; } + /// Number of CPU cores in the Recommended Azure VM Size. + public int? NumberOfCoresForRecommendedSize { get; } + /// Megabytes of memory in the Recommended Azure VM Size. + public double? MegabytesOfMemoryForRecommendedSize { get; } + /// Compute Cost for a 31-day month, if the machine is migrated to Azure with the Recommended Size. + public double? MonthlyComputeCostForRecommendedSize { get; } + /// Utilization percentage of the processor core as observed in the private data center, in the Time Range selected on Assessment, reported as the Percentile value based on the percentile number selected in assessment. + public double? PercentageCoresUtilization { get; } + /// Utilization percentage of the memory as observed in the private data center, in the Time Range selected on Assessment, reported as the Percentile value based on the percentile number selected in assessment. + public double? PercentageMemoryUtilization { get; } + /// Whether machine is suitable for migration to Azure. + public CloudSuitability? Suitability { get; } + /// If machine is not ready to be migrated, this explains the reasons and mitigation steps. + public AzureVmSuitabilityExplanation? SuitabilityExplanation { get; } + /// If machine is not suitable for cloud, this explains the reasons. + public AzureVmSuitabilityDetail? SuitabilityDetail { get; } + /// Time when this machine was created. Date-Time represented in ISO-8601 format. + public DateTimeOffset? CreatedTimestamp { get; } + /// Time when this machine was last updated. Date-Time represented in ISO-8601 format. + public DateTimeOffset? UpdatedTimestamp { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedMachineResultList.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedMachineResultList.Serialization.cs new file mode 100644 index 000000000000..a015ff86c2dd --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedMachineResultList.Serialization.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migrate; + +namespace Azure.ResourceManager.Migrate.Models +{ + internal partial class AssessedMachineResultList + { + internal static AssessedMachineResultList DeserializeAssessedMachineResultList(JsonElement element) + { + Optional> value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AssessedMachineData.DeserializeAssessedMachineData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new AssessedMachineResultList(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedMachineResultList.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedMachineResultList.cs new file mode 100644 index 000000000000..23e929002e8c --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedMachineResultList.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migrate; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// List of assessed machines. + internal partial class AssessedMachineResultList + { + /// Initializes a new instance of AssessedMachineResultList. + internal AssessedMachineResultList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of AssessedMachineResultList. + /// List of assessed machines. + /// + internal AssessedMachineResultList(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// List of assessed machines. + public IReadOnlyList Value { get; } + /// Gets the next link. + public string NextLink { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedNetworkAdapter.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedNetworkAdapter.Serialization.cs new file mode 100644 index 000000000000..7633049f46c9 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedNetworkAdapter.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class AssessedNetworkAdapter + { + internal static AssessedNetworkAdapter DeserializeAssessedNetworkAdapter(JsonElement element) + { + Optional macAddress = default; + Optional> ipAddresses = default; + Optional displayName = default; + Optional monthlyBandwidthCosts = default; + Optional megabytesPerSecondReceived = default; + Optional megabytesPerSecondTransmitted = default; + Optional netGigabytesTransmittedPerMonth = default; + Optional suitability = default; + Optional suitabilityExplanation = default; + Optional suitabilityDetail = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("macAddress")) + { + macAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipAddresses")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipAddresses = array; + continue; + } + if (property.NameEquals("displayName")) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("monthlyBandwidthCosts")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + monthlyBandwidthCosts = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("megabytesPerSecondReceived")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + megabytesPerSecondReceived = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("megabytesPerSecondTransmitted")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + megabytesPerSecondTransmitted = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("netGigabytesTransmittedPerMonth")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + netGigabytesTransmittedPerMonth = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("suitability")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + suitability = new CloudSuitability(property.Value.GetString()); + continue; + } + if (property.NameEquals("suitabilityExplanation")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + suitabilityExplanation = new AzureNetworkAdapterSuitabilityExplanation(property.Value.GetString()); + continue; + } + if (property.NameEquals("suitabilityDetail")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + suitabilityDetail = new AzureNetworkAdapterSuitabilityDetail(property.Value.GetString()); + continue; + } + } + return new AssessedNetworkAdapter(macAddress.Value, Optional.ToList(ipAddresses), displayName.Value, Optional.ToNullable(monthlyBandwidthCosts), Optional.ToNullable(megabytesPerSecondReceived), Optional.ToNullable(megabytesPerSecondTransmitted), Optional.ToNullable(netGigabytesTransmittedPerMonth), Optional.ToNullable(suitability), Optional.ToNullable(suitabilityExplanation), Optional.ToNullable(suitabilityDetail)); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedNetworkAdapter.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedNetworkAdapter.cs new file mode 100644 index 000000000000..d3c2d1c1b71a --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessedNetworkAdapter.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// A network adapter assessed for an assessment. + public partial class AssessedNetworkAdapter + { + /// Initializes a new instance of AssessedNetworkAdapter. + internal AssessedNetworkAdapter() + { + IPAddresses = new ChangeTrackingList(); + } + + /// Initializes a new instance of AssessedNetworkAdapter. + /// MAC Address of the network adapter. + /// List of IP Addresses on the network adapter. + /// User friendly name of the assessed network adapter. + /// Monthly cost estimate for network bandwidth used by this network adapter. + /// Adapter throughput for incoming traffic in MegaBytes per second. + /// Adapter throughput for outgoing traffic in MegaBytes per second. + /// Gigabytes transmitted through this adapter each month. + /// Whether this adapter is suitable for Azure. + /// If network adapter is suitable, this explains the reasons and mitigation steps. + /// If network adapter is not suitable for cloud, this explains the reasons. + internal AssessedNetworkAdapter(string macAddress, IReadOnlyList ipAddresses, string displayName, double? monthlyBandwidthCosts, double? megabytesPerSecondReceived, double? megabytesPerSecondTransmitted, double? netGigabytesTransmittedPerMonth, CloudSuitability? suitability, AzureNetworkAdapterSuitabilityExplanation? suitabilityExplanation, AzureNetworkAdapterSuitabilityDetail? suitabilityDetail) + { + MacAddress = macAddress; + IPAddresses = ipAddresses; + DisplayName = displayName; + MonthlyBandwidthCosts = monthlyBandwidthCosts; + MegabytesPerSecondReceived = megabytesPerSecondReceived; + MegabytesPerSecondTransmitted = megabytesPerSecondTransmitted; + NetGigabytesTransmittedPerMonth = netGigabytesTransmittedPerMonth; + Suitability = suitability; + SuitabilityExplanation = suitabilityExplanation; + SuitabilityDetail = suitabilityDetail; + } + + /// 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 assessed network adapter. + public string DisplayName { get; } + /// Monthly cost estimate for network bandwidth used by this network adapter. + public double? MonthlyBandwidthCosts { get; } + /// Adapter throughput for incoming traffic in MegaBytes per second. + public double? MegabytesPerSecondReceived { get; } + /// Adapter throughput for outgoing traffic in MegaBytes per second. + public double? MegabytesPerSecondTransmitted { get; } + /// Gigabytes transmitted through this adapter each month. + public double? NetGigabytesTransmittedPerMonth { get; } + /// Whether this adapter is suitable for Azure. + public CloudSuitability? Suitability { get; } + /// If network adapter is suitable, this explains the reasons and mitigation steps. + public AzureNetworkAdapterSuitabilityExplanation? SuitabilityExplanation { get; } + /// If network adapter is not suitable for cloud, this explains the reasons. + public AzureNetworkAdapterSuitabilityDetail? SuitabilityDetail { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentData.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentData.Serialization.cs new file mode 100644 index 000000000000..3495759dda26 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentData.Serialization.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + public partial class AssessmentData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"); + writer.WriteStringValue(ETag.Value.ToString()); + } + writer.WritePropertyName("properties"); + writer.WriteObjectValue(Properties); + writer.WriteEndObject(); + } + + internal static AssessmentData DeserializeAssessmentData(JsonElement element) + { + Optional eTag = default; + AssessmentProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("eTag")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + eTag = new ETag(property.Value.GetString()); + continue; + } + if (property.NameEquals("properties")) + { + properties = AssessmentProperties.DeserializeAssessmentProperties(property.Value); + continue; + } + if (property.NameEquals("id")) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.ToString()); + continue; + } + } + return new AssessmentData(id, name, type, systemData.Value, Optional.ToNullable(eTag), properties); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentOptions.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentOptions.Serialization.cs new file mode 100644 index 000000000000..bde56efaabdd --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentOptions.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class AssessmentOptions + { + internal static AssessmentOptions DeserializeAssessmentOptions(JsonElement element) + { + Optional name = default; + Optional id = default; + AssessmentOptionsProperties properties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + properties = AssessmentOptionsProperties.DeserializeAssessmentOptionsProperties(property.Value); + continue; + } + } + return new AssessmentOptions(name.Value, id.Value, properties); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentOptions.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentOptions.cs new file mode 100644 index 000000000000..99f76cf256b8 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentOptions.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Assessment options. + public partial class AssessmentOptions + { + /// Initializes a new instance of AssessmentOptions. + /// Properties of the assessment options. + /// is null. + internal AssessmentOptions(AssessmentOptionsProperties properties) + { + if (properties == null) + { + throw new ArgumentNullException(nameof(properties)); + } + + Properties = properties; + } + + /// Initializes a new instance of AssessmentOptions. + /// Unique name of an assessment options. + /// Unique identifier of an assessment options. + /// Properties of the assessment options. + internal AssessmentOptions(string name, string id, AssessmentOptionsProperties properties) + { + Name = name; + Id = id; + Properties = properties; + } + + /// Unique name of an assessment options. + public string Name { get; } + /// Unique identifier of an assessment options. + public string Id { get; } + /// Properties of the assessment options. + public AssessmentOptionsProperties Properties { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentOptionsProperties.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentOptionsProperties.Serialization.cs new file mode 100644 index 000000000000..1f98cea4cf44 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentOptionsProperties.Serialization.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class AssessmentOptionsProperties + { + internal static AssessmentOptionsProperties DeserializeAssessmentOptionsProperties(JsonElement element) + { + Optional> vmFamilies = default; + Optional> reservedInstanceVmFamilies = default; + Optional> reservedInstanceSupportedLocations = default; + Optional> reservedInstanceSupportedCurrencies = default; + Optional> reservedInstanceSupportedOffers = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vmFamilies")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VmFamily.DeserializeVmFamily(item)); + } + vmFamilies = array; + continue; + } + if (property.NameEquals("reservedInstanceVmFamilies")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + reservedInstanceVmFamilies = array; + continue; + } + if (property.NameEquals("reservedInstanceSupportedLocations")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + reservedInstanceSupportedLocations = array; + continue; + } + if (property.NameEquals("reservedInstanceSupportedCurrencies")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + reservedInstanceSupportedCurrencies = array; + continue; + } + if (property.NameEquals("reservedInstanceSupportedOffers")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + reservedInstanceSupportedOffers = array; + continue; + } + } + return new AssessmentOptionsProperties(Optional.ToList(vmFamilies), Optional.ToList(reservedInstanceVmFamilies), Optional.ToList(reservedInstanceSupportedLocations), Optional.ToList(reservedInstanceSupportedCurrencies), Optional.ToList(reservedInstanceSupportedOffers)); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentOptionsProperties.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentOptionsProperties.cs new file mode 100644 index 000000000000..9a4c5b04bcc4 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentOptionsProperties.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Assessment options properties. + public partial class AssessmentOptionsProperties + { + /// Initializes a new instance of AssessmentOptionsProperties. + internal AssessmentOptionsProperties() + { + VmFamilies = new ChangeTrackingList(); + ReservedInstanceVmFamilies = new ChangeTrackingList(); + ReservedInstanceSupportedLocations = new ChangeTrackingList(); + ReservedInstanceSupportedCurrencies = new ChangeTrackingList(); + ReservedInstanceSupportedOffers = new ChangeTrackingList(); + } + + /// Initializes a new instance of AssessmentOptionsProperties. + /// 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. + internal AssessmentOptionsProperties(IReadOnlyList vmFamilies, IReadOnlyList reservedInstanceVmFamilies, IReadOnlyList reservedInstanceSupportedLocations, IReadOnlyList reservedInstanceSupportedCurrencies, IReadOnlyList reservedInstanceSupportedOffers) + { + VmFamilies = vmFamilies; + ReservedInstanceVmFamilies = reservedInstanceVmFamilies; + ReservedInstanceSupportedLocations = reservedInstanceSupportedLocations; + ReservedInstanceSupportedCurrencies = reservedInstanceSupportedCurrencies; + ReservedInstanceSupportedOffers = reservedInstanceSupportedOffers; + } + + /// 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; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentOptionsResultList.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentOptionsResultList.Serialization.cs new file mode 100644 index 000000000000..fc556344ff86 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentOptionsResultList.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + internal partial class AssessmentOptionsResultList + { + internal static AssessmentOptionsResultList DeserializeAssessmentOptionsResultList(JsonElement element) + { + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AssessmentOptions.DeserializeAssessmentOptions(item)); + } + value = array; + continue; + } + } + return new AssessmentOptionsResultList(Optional.ToList(value)); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentOptionsResultList.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentOptionsResultList.cs new file mode 100644 index 000000000000..3d270f194446 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentOptionsResultList.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// List of API operations. + internal partial class AssessmentOptionsResultList + { + /// Initializes a new instance of AssessmentOptionsResultList. + internal AssessmentOptionsResultList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of AssessmentOptionsResultList. + /// List of operations. + internal AssessmentOptionsResultList(IReadOnlyList value) + { + Value = value; + } + + /// List of operations. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentProperties.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentProperties.Serialization.cs new file mode 100644 index 000000000000..aaec66e67d64 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentProperties.Serialization.cs @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class AssessmentProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("azureLocation"); + writer.WriteStringValue(AzureLocation.ToString()); + writer.WritePropertyName("azureOfferCode"); + writer.WriteStringValue(AzureOfferCode.ToString()); + writer.WritePropertyName("azurePricingTier"); + writer.WriteStringValue(AzurePricingTier.ToString()); + writer.WritePropertyName("azureStorageRedundancy"); + writer.WriteStringValue(AzureStorageRedundancy.ToString()); + writer.WritePropertyName("scalingFactor"); + writer.WriteNumberValue(ScalingFactor); + writer.WritePropertyName("percentile"); + writer.WriteStringValue(Percentile.ToString()); + writer.WritePropertyName("timeRange"); + writer.WriteStringValue(TimeRange.ToString()); + writer.WritePropertyName("stage"); + writer.WriteStringValue(Stage.ToString()); + writer.WritePropertyName("currency"); + writer.WriteStringValue(Currency.ToString()); + writer.WritePropertyName("azureHybridUseBenefit"); + writer.WriteStringValue(AzureHybridUseBenefit.ToString()); + writer.WritePropertyName("discountPercentage"); + writer.WriteNumberValue(DiscountPercentage); + writer.WritePropertyName("sizingCriterion"); + writer.WriteStringValue(SizingCriterion.ToString()); + writer.WritePropertyName("reservedInstance"); + writer.WriteStringValue(ReservedInstance.ToString()); + writer.WritePropertyName("azureVmFamilies"); + writer.WriteStartArray(); + foreach (var item in AzureVmFamilies) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + writer.WritePropertyName("azureDiskType"); + writer.WriteStringValue(AzureDiskType.ToString()); + writer.WritePropertyName("vmUptime"); + writer.WriteObjectValue(VmUptime); + writer.WriteEndObject(); + } + + internal static AssessmentProperties DeserializeAssessmentProperties(JsonElement element) + { + AzureLocation azureLocation = default; + AzureOfferCode azureOfferCode = default; + Optional eaSubscriptionId = default; + AzurePricingTier azurePricingTier = default; + AzureStorageRedundancy azureStorageRedundancy = default; + double scalingFactor = default; + Percentile percentile = default; + TimeRange timeRange = default; + Optional perfDataStartTime = default; + Optional perfDataEndTime = default; + AssessmentStage stage = default; + Currency currency = default; + AzureHybridUseBenefit azureHybridUseBenefit = default; + double discountPercentage = default; + Optional confidenceRatingInPercentage = default; + AssessmentSizingCriterion sizingCriterion = default; + ReservedInstance reservedInstance = default; + IList azureVmFamilies = default; + AzureDiskType azureDiskType = default; + VmUptime vmUptime = default; + Optional pricesTimestamp = default; + Optional createdTimestamp = default; + Optional updatedTimestamp = default; + Optional monthlyComputeCost = default; + Optional monthlyBandwidthCost = default; + Optional monthlyStorageCost = default; + Optional monthlyPremiumStorageCost = default; + Optional monthlyStandardSSDStorageCost = default; + Optional status = default; + Optional numberOfMachines = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azureLocation")) + { + azureLocation = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("azureOfferCode")) + { + azureOfferCode = new AzureOfferCode(property.Value.GetString()); + continue; + } + if (property.NameEquals("eaSubscriptionId")) + { + eaSubscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("azurePricingTier")) + { + azurePricingTier = new AzurePricingTier(property.Value.GetString()); + continue; + } + if (property.NameEquals("azureStorageRedundancy")) + { + azureStorageRedundancy = new AzureStorageRedundancy(property.Value.GetString()); + continue; + } + if (property.NameEquals("scalingFactor")) + { + scalingFactor = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("percentile")) + { + percentile = new Percentile(property.Value.GetString()); + continue; + } + if (property.NameEquals("timeRange")) + { + timeRange = new TimeRange(property.Value.GetString()); + continue; + } + if (property.NameEquals("perfDataStartTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + perfDataStartTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("perfDataEndTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + perfDataEndTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("stage")) + { + stage = new AssessmentStage(property.Value.GetString()); + continue; + } + if (property.NameEquals("currency")) + { + currency = new Currency(property.Value.GetString()); + continue; + } + if (property.NameEquals("azureHybridUseBenefit")) + { + azureHybridUseBenefit = new AzureHybridUseBenefit(property.Value.GetString()); + continue; + } + if (property.NameEquals("discountPercentage")) + { + discountPercentage = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("confidenceRatingInPercentage")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + confidenceRatingInPercentage = null; + continue; + } + confidenceRatingInPercentage = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("sizingCriterion")) + { + sizingCriterion = new AssessmentSizingCriterion(property.Value.GetString()); + continue; + } + if (property.NameEquals("reservedInstance")) + { + reservedInstance = new ReservedInstance(property.Value.GetString()); + continue; + } + if (property.NameEquals("azureVmFamilies")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new AzureVmFamily(item.GetString())); + } + azureVmFamilies = array; + continue; + } + if (property.NameEquals("azureDiskType")) + { + azureDiskType = new AzureDiskType(property.Value.GetString()); + continue; + } + if (property.NameEquals("vmUptime")) + { + vmUptime = VmUptime.DeserializeVmUptime(property.Value); + continue; + } + if (property.NameEquals("pricesTimestamp")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + pricesTimestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("createdTimestamp")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + createdTimestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("updatedTimestamp")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + updatedTimestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("monthlyComputeCost")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + monthlyComputeCost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyBandwidthCost")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + monthlyBandwidthCost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyStorageCost")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + monthlyStorageCost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyPremiumStorageCost")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + monthlyPremiumStorageCost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("monthlyStandardSSDStorageCost")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + monthlyStandardSSDStorageCost = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("status")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + status = new AssessmentStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("numberOfMachines")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + numberOfMachines = property.Value.GetInt32(); + continue; + } + } + return new AssessmentProperties(azureLocation, azureOfferCode, eaSubscriptionId.Value, azurePricingTier, azureStorageRedundancy, scalingFactor, percentile, timeRange, Optional.ToNullable(perfDataStartTime), Optional.ToNullable(perfDataEndTime), stage, currency, azureHybridUseBenefit, discountPercentage, Optional.ToNullable(confidenceRatingInPercentage), sizingCriterion, reservedInstance, azureVmFamilies, azureDiskType, vmUptime, Optional.ToNullable(pricesTimestamp), Optional.ToNullable(createdTimestamp), Optional.ToNullable(updatedTimestamp), Optional.ToNullable(monthlyComputeCost), Optional.ToNullable(monthlyBandwidthCost), Optional.ToNullable(monthlyStorageCost), Optional.ToNullable(monthlyPremiumStorageCost), Optional.ToNullable(monthlyStandardSSDStorageCost), Optional.ToNullable(status), Optional.ToNullable(numberOfMachines)); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentProperties.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentProperties.cs new file mode 100644 index 000000000000..4e2be65b0ecf --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentProperties.cs @@ -0,0 +1,190 @@ +// 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.Migrate.Models +{ + /// Properties of an assessment. + public partial class AssessmentProperties + { + /// Initializes a new instance of AssessmentProperties. + /// Target Azure location for which the machines should be assessed. These enums are the same as used by Compute API. + /// Offer code according to which cost estimation is done. + /// Pricing tier for Size evaluation. + /// Storage Redundancy type offered by Azure. + /// Scaling factor used over utilization data to add a performance buffer for new machines to be created in Azure. Min Value = 1.0, Max value = 1.9, Default = 1.3. + /// Percentile of performance data used to recommend Azure size. + /// Time range of performance data used to recommend a size. + /// User configurable setting that describes the status of the assessment. + /// Currency to report prices in. + /// AHUB discount on windows virtual machines. + /// Custom discount percentage to be applied on final costs. Can be in the range [0, 100]. + /// Assessment sizing criterion. + /// Azure reserved instance. + /// List of azure VM families. + /// Storage type selected for this disk. + /// Specify the duration for which the VMs are up in the on-premises environment. + /// or is null. + public AssessmentProperties(AzureLocation azureLocation, AzureOfferCode azureOfferCode, AzurePricingTier azurePricingTier, AzureStorageRedundancy azureStorageRedundancy, double scalingFactor, Percentile percentile, TimeRange timeRange, AssessmentStage stage, Currency currency, AzureHybridUseBenefit azureHybridUseBenefit, double discountPercentage, AssessmentSizingCriterion sizingCriterion, ReservedInstance reservedInstance, IEnumerable azureVmFamilies, AzureDiskType azureDiskType, VmUptime vmUptime) + { + if (azureVmFamilies == null) + { + throw new ArgumentNullException(nameof(azureVmFamilies)); + } + if (vmUptime == null) + { + throw new ArgumentNullException(nameof(vmUptime)); + } + + AzureLocation = azureLocation; + AzureOfferCode = azureOfferCode; + AzurePricingTier = azurePricingTier; + AzureStorageRedundancy = azureStorageRedundancy; + ScalingFactor = scalingFactor; + Percentile = percentile; + TimeRange = timeRange; + Stage = stage; + Currency = currency; + AzureHybridUseBenefit = azureHybridUseBenefit; + DiscountPercentage = discountPercentage; + SizingCriterion = sizingCriterion; + ReservedInstance = reservedInstance; + AzureVmFamilies = azureVmFamilies.ToList(); + AzureDiskType = azureDiskType; + VmUptime = vmUptime; + } + + /// Initializes a new instance of AssessmentProperties. + /// Target Azure location for which the machines should be assessed. These enums are the same as used by Compute API. + /// Offer code according to which cost estimation is done. + /// Enterprise agreement subscription arm id. + /// Pricing tier for Size evaluation. + /// Storage Redundancy type offered by Azure. + /// Scaling factor used over utilization data to add a performance buffer for new machines to be created in Azure. Min Value = 1.0, Max value = 1.9, Default = 1.3. + /// Percentile of performance data used to recommend Azure size. + /// Time range of performance data used to recommend a size. + /// Start time to consider performance data for assessment. + /// End time to consider performance data for assessment. + /// User configurable setting that describes the status of the assessment. + /// Currency to report prices in. + /// AHUB discount on windows virtual machines. + /// Custom discount percentage to be applied on final costs. Can be in the range [0, 100]. + /// Confidence rating percentage for assessment. Can be in the range [0, 100]. + /// Assessment sizing criterion. + /// Azure reserved instance. + /// List of azure VM families. + /// Storage type selected for this disk. + /// Specify the duration for which the VMs are up in the on-premises environment. + /// Time when the Azure Prices were queried. Date-Time represented in ISO-8601 format. + /// 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. + /// Monthly compute cost estimate for the machines that are part of this assessment as a group, for a 31-day month. + /// Monthly network cost estimate for the machines that are part of this assessment as a group, for a 31-day month. + /// Monthly storage cost estimate for the machines that are part of this assessment as a group, for a 31-day month. + /// Monthly premium storage cost estimate for the machines that are part of this assessment as a group, for a 31-day month. + /// Monthly standard SSD storage cost estimate for the machines that are part of this assessment as a group, for a 31-day month. + /// Whether the assessment has been created and is valid. + /// Number of assessed machines part of this assessment. + internal AssessmentProperties(AzureLocation azureLocation, AzureOfferCode azureOfferCode, string eaSubscriptionId, AzurePricingTier azurePricingTier, AzureStorageRedundancy azureStorageRedundancy, double scalingFactor, Percentile percentile, TimeRange timeRange, DateTimeOffset? perfDataStartOn, DateTimeOffset? perfDataEndOn, AssessmentStage stage, Currency currency, AzureHybridUseBenefit azureHybridUseBenefit, double discountPercentage, double? confidenceRatingInPercentage, AssessmentSizingCriterion sizingCriterion, ReservedInstance reservedInstance, IList azureVmFamilies, AzureDiskType azureDiskType, VmUptime vmUptime, DateTimeOffset? pricesTimestamp, DateTimeOffset? createdTimestamp, DateTimeOffset? updatedTimestamp, double? monthlyComputeCost, double? monthlyBandwidthCost, double? monthlyStorageCost, double? monthlyPremiumStorageCost, double? monthlyStandardSSDStorageCost, AssessmentStatus? status, int? numberOfMachines) + { + AzureLocation = azureLocation; + AzureOfferCode = azureOfferCode; + EaSubscriptionId = eaSubscriptionId; + AzurePricingTier = azurePricingTier; + AzureStorageRedundancy = azureStorageRedundancy; + ScalingFactor = scalingFactor; + Percentile = percentile; + TimeRange = timeRange; + PerfDataStartOn = perfDataStartOn; + PerfDataEndOn = perfDataEndOn; + Stage = stage; + Currency = currency; + AzureHybridUseBenefit = azureHybridUseBenefit; + DiscountPercentage = discountPercentage; + ConfidenceRatingInPercentage = confidenceRatingInPercentage; + SizingCriterion = sizingCriterion; + ReservedInstance = reservedInstance; + AzureVmFamilies = azureVmFamilies; + AzureDiskType = azureDiskType; + VmUptime = vmUptime; + PricesTimestamp = pricesTimestamp; + CreatedTimestamp = createdTimestamp; + UpdatedTimestamp = updatedTimestamp; + MonthlyComputeCost = monthlyComputeCost; + MonthlyBandwidthCost = monthlyBandwidthCost; + MonthlyStorageCost = monthlyStorageCost; + MonthlyPremiumStorageCost = monthlyPremiumStorageCost; + MonthlyStandardSSDStorageCost = monthlyStandardSSDStorageCost; + Status = status; + NumberOfMachines = numberOfMachines; + } + + /// Target Azure location for which the machines should be assessed. These enums are the same as used by Compute API. + public AzureLocation AzureLocation { get; set; } + /// Offer code according to which cost estimation is done. + public AzureOfferCode AzureOfferCode { get; set; } + /// Enterprise agreement subscription arm id. + public string EaSubscriptionId { get; } + /// Pricing tier for Size evaluation. + public AzurePricingTier AzurePricingTier { get; set; } + /// Storage Redundancy type offered by Azure. + public AzureStorageRedundancy AzureStorageRedundancy { get; set; } + /// Scaling factor used over utilization data to add a performance buffer for new machines to be created in Azure. Min Value = 1.0, Max value = 1.9, Default = 1.3. + public double ScalingFactor { get; set; } + /// Percentile of performance data used to recommend Azure size. + public Percentile Percentile { get; set; } + /// Time range of performance data used to recommend a size. + public TimeRange TimeRange { get; set; } + /// Start time to consider performance data for assessment. + public DateTimeOffset? PerfDataStartOn { get; } + /// End time to consider performance data for assessment. + public DateTimeOffset? PerfDataEndOn { get; } + /// User configurable setting that describes the status of the assessment. + public AssessmentStage Stage { get; set; } + /// Currency to report prices in. + public Currency Currency { get; set; } + /// AHUB discount on windows virtual machines. + public AzureHybridUseBenefit AzureHybridUseBenefit { get; set; } + /// Custom discount percentage to be applied on final costs. Can be in the range [0, 100]. + public double DiscountPercentage { get; set; } + /// Confidence rating percentage for assessment. Can be in the range [0, 100]. + public double? ConfidenceRatingInPercentage { get; } + /// Assessment sizing criterion. + public AssessmentSizingCriterion SizingCriterion { get; set; } + /// Azure reserved instance. + public ReservedInstance ReservedInstance { get; set; } + /// List of azure VM families. + public IList AzureVmFamilies { get; } + /// Storage type selected for this disk. + public AzureDiskType AzureDiskType { get; set; } + /// Specify the duration for which the VMs are up in the on-premises environment. + public VmUptime VmUptime { get; set; } + /// Time when the Azure Prices were queried. Date-Time represented in ISO-8601 format. + public DateTimeOffset? PricesTimestamp { get; } + /// Time when this project was created. Date-Time represented in ISO-8601 format. + public DateTimeOffset? CreatedTimestamp { get; } + /// Time when this project was last updated. Date-Time represented in ISO-8601 format. + public DateTimeOffset? UpdatedTimestamp { get; } + /// Monthly compute cost estimate for the machines that are part of this assessment as a group, for a 31-day month. + public double? MonthlyComputeCost { get; } + /// Monthly network cost estimate for the machines that are part of this assessment as a group, for a 31-day month. + public double? MonthlyBandwidthCost { get; } + /// Monthly storage cost estimate for the machines that are part of this assessment as a group, for a 31-day month. + public double? MonthlyStorageCost { get; } + /// Monthly premium storage cost estimate for the machines that are part of this assessment as a group, for a 31-day month. + public double? MonthlyPremiumStorageCost { get; } + /// Monthly standard SSD storage cost estimate for the machines that are part of this assessment as a group, for a 31-day month. + public double? MonthlyStandardSSDStorageCost { get; } + /// Whether the assessment has been created and is valid. + public AssessmentStatus? Status { get; } + /// Number of assessed machines part of this assessment. + public int? NumberOfMachines { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentResultList.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentResultList.Serialization.cs new file mode 100644 index 000000000000..21bc3eb584c0 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentResultList.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migrate; + +namespace Azure.ResourceManager.Migrate.Models +{ + internal partial class AssessmentResultList + { + internal static AssessmentResultList DeserializeAssessmentResultList(JsonElement element) + { + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AssessmentData.DeserializeAssessmentData(item)); + } + value = array; + continue; + } + } + return new AssessmentResultList(Optional.ToList(value)); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentResultList.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentResultList.cs new file mode 100644 index 000000000000..e67f5d680cb2 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentResultList.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migrate; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// List of assessments. + internal partial class AssessmentResultList + { + /// Initializes a new instance of AssessmentResultList. + internal AssessmentResultList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of AssessmentResultList. + /// List of assessments. + internal AssessmentResultList(IReadOnlyList value) + { + Value = value; + } + + /// List of assessments. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentSizingCriterion.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentSizingCriterion.cs new file mode 100644 index 000000000000..178ce60d05ed --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/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.Migrate.Models +{ + /// Assessment sizing criterion. + 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"; + + /// PerformanceBased. + public static AssessmentSizingCriterion PerformanceBased { get; } = new AssessmentSizingCriterion(PerformanceBasedValue); + /// AsOnPremises. + 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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentStage.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentStage.cs new file mode 100644 index 000000000000..c306979cfbbb --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/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.Migrate.Models +{ + /// User configurable setting that describes the status of the assessment. + 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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentStatus.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentStatus.cs new file mode 100644 index 000000000000..1acf30f1d8ce --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentStatus.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.Migrate.Models +{ + /// Whether the assessment has been created and is valid. + 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"; + + /// Created. + public static AssessmentStatus Created { get; } = new AssessmentStatus(CreatedValue); + /// Updated. + public static AssessmentStatus Updated { get; } = new AssessmentStatus(UpdatedValue); + /// Running. + public static AssessmentStatus Running { get; } = new AssessmentStatus(RunningValue); + /// Completed. + public static AssessmentStatus Completed { get; } = new AssessmentStatus(CompletedValue); + /// Invalid. + public static AssessmentStatus Invalid { get; } = new AssessmentStatus(InvalidValue); + /// OutOfSync. + public static AssessmentStatus OutOfSync { get; } = new AssessmentStatus(OutOfSyncValue); + /// OutDated. + public static AssessmentStatus OutDated { get; } = new AssessmentStatus(OutDatedValue); + /// 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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureDiskSize.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureDiskSize.cs new file mode 100644 index 000000000000..f2011a62cca4 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureDiskSize.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Recommended Azure size for the disk, given utilization data and preferences set on Assessment. + 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 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 StandardS60Value = "Standard_S60"; + private const string StandardS70Value = "Standard_S70"; + private const string StandardS80Value = "Standard_S80"; + 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"; + + /// 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); + /// 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); + /// 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_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); + /// 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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureDiskSuitabilityDetail.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureDiskSuitabilityDetail.cs new file mode 100644 index 000000000000..a26f5030b0eb --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/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.Migrate.Models +{ + /// If disk is suitable to be migrate but some conditions/checks were not considered while calculating suitability, this explains the details. + 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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureDiskSuitabilityExplanation.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureDiskSuitabilityExplanation.cs new file mode 100644 index 000000000000..2b7e3d4da681 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/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.Migrate.Models +{ + /// If disk is not suitable to be migrated, this explains the reasons and mitigation steps. + 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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureDiskType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureDiskType.cs new file mode 100644 index 000000000000..bc96dc58a228 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureDiskType.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.Migrate.Models +{ + /// Storage type selected for this disk. + 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 PremiumValue = "Premium"; + private const string StandardSSDValue = "StandardSSD"; + private const string StandardOrPremiumValue = "StandardOrPremium"; + + /// Unknown. + public static AzureDiskType Unknown { get; } = new AzureDiskType(UnknownValue); + /// Standard. + public static AzureDiskType Standard { get; } = new AzureDiskType(StandardValue); + /// Premium. + public static AzureDiskType Premium { get; } = new AzureDiskType(PremiumValue); + /// StandardSSD. + public static AzureDiskType StandardSSD { get; } = new AzureDiskType(StandardSSDValue); + /// StandardOrPremium. + public static AzureDiskType StandardOrPremium { get; } = new AzureDiskType(StandardOrPremiumValue); + /// 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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureHybridUseBenefit.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureHybridUseBenefit.cs new file mode 100644 index 000000000000..d39d5619478f --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/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.Migrate.Models +{ + /// AHUB discount on windows virtual machines. + 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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureLocation.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureLocation.cs new file mode 100644 index 000000000000..d70ef190bc72 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureLocation.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Target Azure location for which the machines should be assessed. These enums are the same as used by Compute API. + public readonly partial struct AzureLocation : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureLocation(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string EastAsiaValue = "EastAsia"; + private const string SoutheastAsiaValue = "SoutheastAsia"; + private const string AustraliaEastValue = "AustraliaEast"; + private const string AustraliaSoutheastValue = "AustraliaSoutheast"; + private const string BrazilSouthValue = "BrazilSouth"; + private const string CanadaCentralValue = "CanadaCentral"; + private const string CanadaEastValue = "CanadaEast"; + private const string WestEuropeValue = "WestEurope"; + private const string NorthEuropeValue = "NorthEurope"; + private const string CentralIndiaValue = "CentralIndia"; + private const string SouthIndiaValue = "SouthIndia"; + private const string WestIndiaValue = "WestIndia"; + private const string JapanEastValue = "JapanEast"; + private const string JapanWestValue = "JapanWest"; + private const string KoreaCentralValue = "KoreaCentral"; + private const string KoreaSouthValue = "KoreaSouth"; + private const string UkWestValue = "UkWest"; + private const string UkSouthValue = "UkSouth"; + private const string NorthCentralUsValue = "NorthCentralUs"; + private const string EastUsValue = "EastUs"; + private const string WestUs2Value = "WestUs2"; + private const string SouthCentralUsValue = "SouthCentralUs"; + private const string CentralUsValue = "CentralUs"; + private const string EastUs2Value = "EastUs2"; + private const string WestUsValue = "WestUs"; + private const string WestCentralUsValue = "WestCentralUs"; + private const string GermanyCentralValue = "GermanyCentral"; + private const string GermanyNortheastValue = "GermanyNortheast"; + private const string ChinaNorthValue = "ChinaNorth"; + private const string ChinaEastValue = "ChinaEast"; + private const string USGovArizonaValue = "USGovArizona"; + private const string USGovTexasValue = "USGovTexas"; + private const string USGovIowaValue = "USGovIowa"; + private const string USGovVirginiaValue = "USGovVirginia"; + private const string USDoDCentralValue = "USDoDCentral"; + private const string USDoDEastValue = "USDoDEast"; + + /// Unknown. + public static AzureLocation Unknown { get; } = new AzureLocation(UnknownValue); + /// EastAsia. + public static AzureLocation EastAsia { get; } = new AzureLocation(EastAsiaValue); + /// SoutheastAsia. + public static AzureLocation SoutheastAsia { get; } = new AzureLocation(SoutheastAsiaValue); + /// AustraliaEast. + public static AzureLocation AustraliaEast { get; } = new AzureLocation(AustraliaEastValue); + /// AustraliaSoutheast. + public static AzureLocation AustraliaSoutheast { get; } = new AzureLocation(AustraliaSoutheastValue); + /// BrazilSouth. + public static AzureLocation BrazilSouth { get; } = new AzureLocation(BrazilSouthValue); + /// CanadaCentral. + public static AzureLocation CanadaCentral { get; } = new AzureLocation(CanadaCentralValue); + /// CanadaEast. + public static AzureLocation CanadaEast { get; } = new AzureLocation(CanadaEastValue); + /// WestEurope. + public static AzureLocation WestEurope { get; } = new AzureLocation(WestEuropeValue); + /// NorthEurope. + public static AzureLocation NorthEurope { get; } = new AzureLocation(NorthEuropeValue); + /// CentralIndia. + public static AzureLocation CentralIndia { get; } = new AzureLocation(CentralIndiaValue); + /// SouthIndia. + public static AzureLocation SouthIndia { get; } = new AzureLocation(SouthIndiaValue); + /// WestIndia. + public static AzureLocation WestIndia { get; } = new AzureLocation(WestIndiaValue); + /// JapanEast. + public static AzureLocation JapanEast { get; } = new AzureLocation(JapanEastValue); + /// JapanWest. + public static AzureLocation JapanWest { get; } = new AzureLocation(JapanWestValue); + /// KoreaCentral. + public static AzureLocation KoreaCentral { get; } = new AzureLocation(KoreaCentralValue); + /// KoreaSouth. + public static AzureLocation KoreaSouth { get; } = new AzureLocation(KoreaSouthValue); + /// UkWest. + public static AzureLocation UkWest { get; } = new AzureLocation(UkWestValue); + /// UkSouth. + public static AzureLocation UkSouth { get; } = new AzureLocation(UkSouthValue); + /// NorthCentralUs. + public static AzureLocation NorthCentralUs { get; } = new AzureLocation(NorthCentralUsValue); + /// EastUs. + public static AzureLocation EastUs { get; } = new AzureLocation(EastUsValue); + /// WestUs2. + public static AzureLocation WestUs2 { get; } = new AzureLocation(WestUs2Value); + /// SouthCentralUs. + public static AzureLocation SouthCentralUs { get; } = new AzureLocation(SouthCentralUsValue); + /// CentralUs. + public static AzureLocation CentralUs { get; } = new AzureLocation(CentralUsValue); + /// EastUs2. + public static AzureLocation EastUs2 { get; } = new AzureLocation(EastUs2Value); + /// WestUs. + public static AzureLocation WestUs { get; } = new AzureLocation(WestUsValue); + /// WestCentralUs. + public static AzureLocation WestCentralUs { get; } = new AzureLocation(WestCentralUsValue); + /// GermanyCentral. + public static AzureLocation GermanyCentral { get; } = new AzureLocation(GermanyCentralValue); + /// GermanyNortheast. + public static AzureLocation GermanyNortheast { get; } = new AzureLocation(GermanyNortheastValue); + /// ChinaNorth. + public static AzureLocation ChinaNorth { get; } = new AzureLocation(ChinaNorthValue); + /// ChinaEast. + public static AzureLocation ChinaEast { get; } = new AzureLocation(ChinaEastValue); + /// USGovArizona. + public static AzureLocation USGovArizona { get; } = new AzureLocation(USGovArizonaValue); + /// USGovTexas. + public static AzureLocation USGovTexas { get; } = new AzureLocation(USGovTexasValue); + /// USGovIowa. + public static AzureLocation USGovIowa { get; } = new AzureLocation(USGovIowaValue); + /// USGovVirginia. + public static AzureLocation USGovVirginia { get; } = new AzureLocation(USGovVirginiaValue); + /// USDoDCentral. + public static AzureLocation USDoDCentral { get; } = new AzureLocation(USDoDCentralValue); + /// USDoDEast. + public static AzureLocation USDoDEast { get; } = new AzureLocation(USDoDEastValue); + /// Determines if two values are the same. + public static bool operator ==(AzureLocation left, AzureLocation right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureLocation left, AzureLocation right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AzureLocation(string value) => new AzureLocation(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureLocation other && Equals(other); + /// + public bool Equals(AzureLocation other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureNetworkAdapterSuitabilityDetail.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureNetworkAdapterSuitabilityDetail.cs new file mode 100644 index 000000000000..c77b31b3f255 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureNetworkAdapterSuitabilityDetail.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.Migrate.Models +{ + /// If network adapter is not suitable for cloud, this explains the reasons. + 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"; + + /// 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); + /// 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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureNetworkAdapterSuitabilityExplanation.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureNetworkAdapterSuitabilityExplanation.cs new file mode 100644 index 000000000000..f823c6b96b5e --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/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.Migrate.Models +{ + /// If network adapter is suitable, this explains the reasons and mitigation steps. + 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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureOfferCode.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureOfferCode.cs new file mode 100644 index 000000000000..40387f7fc8eb --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureOfferCode.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Offer code according to which cost estimation is done. + 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"; + + /// 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); + /// 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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzurePricingTier.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzurePricingTier.cs new file mode 100644 index 000000000000..83e2b2fb6ff3 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/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.Migrate.Models +{ + /// Pricing tier for Size evaluation. + 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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureStorageRedundancy.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureStorageRedundancy.cs new file mode 100644 index 000000000000..8e2e0a359b6f --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/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.Migrate.Models +{ + /// Storage Redundancy type offered by Azure. + 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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureVmFamily.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureVmFamily.cs new file mode 100644 index 000000000000..e78df1eccffb --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureVmFamily.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Azure VM family. + 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"; + + /// 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); + /// 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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureVmSize.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureVmSize.cs new file mode 100644 index 000000000000..eaf338147d23 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureVmSize.cs @@ -0,0 +1,423 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Recommended Azure size for this machine. + 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"; + + /// 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); + /// 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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureVmSuitabilityDetail.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureVmSuitabilityDetail.cs new file mode 100644 index 000000000000..e9cb667e3a48 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/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.Migrate.Models +{ + /// If machine is not suitable for cloud, this explains the reasons. + 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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureVmSuitabilityExplanation.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureVmSuitabilityExplanation.cs new file mode 100644 index 000000000000..505baf7c06a6 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureVmSuitabilityExplanation.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// If machine is not ready to be migrated, this explains the reasons and mitigation steps. + 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"; + + /// 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); + /// 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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CloudSuitability.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CloudSuitability.cs new file mode 100644 index 000000000000..b114363c9c69 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CloudSuitability.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.Migrate.Models +{ + /// Whether this disk is suitable for Azure. + public readonly partial struct CloudSuitability : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CloudSuitability(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. + public static CloudSuitability Unknown { get; } = new CloudSuitability(UnknownValue); + /// NotSuitable. + public static CloudSuitability NotSuitable { get; } = new CloudSuitability(NotSuitableValue); + /// Suitable. + public static CloudSuitability Suitable { get; } = new CloudSuitability(SuitableValue); + /// ConditionallySuitable. + public static CloudSuitability ConditionallySuitable { get; } = new CloudSuitability(ConditionallySuitableValue); + /// ReadinessUnknown. + public static CloudSuitability ReadinessUnknown { get; } = new CloudSuitability(ReadinessUnknownValue); + /// Determines if two values are the same. + public static bool operator ==(CloudSuitability left, CloudSuitability right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CloudSuitability left, CloudSuitability right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator CloudSuitability(string value) => new CloudSuitability(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CloudSuitability other && Equals(other); + /// + public bool Equals(CloudSuitability other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CollectorAgentProperties.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CollectorAgentProperties.Serialization.cs new file mode 100644 index 000000000000..7d37297cc60c --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CollectorAgentProperties.Serialization.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class CollectorAgentProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(SpnDetails)) + { + writer.WritePropertyName("spnDetails"); + writer.WriteObjectValue(SpnDetails); + } + writer.WriteEndObject(); + } + + internal static CollectorAgentProperties DeserializeCollectorAgentProperties(JsonElement element) + { + Optional id = default; + Optional version = default; + Optional lastHeartbeatUtc = default; + Optional spnDetails = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("version")) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastHeartbeatUtc")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + lastHeartbeatUtc = null; + continue; + } + lastHeartbeatUtc = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("spnDetails")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + spnDetails = CollectorBodyAgentSpnProperties.DeserializeCollectorBodyAgentSpnProperties(property.Value); + continue; + } + } + return new CollectorAgentProperties(id.Value, version.Value, Optional.ToNullable(lastHeartbeatUtc), spnDetails.Value); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CollectorAgentProperties.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CollectorAgentProperties.cs new file mode 100644 index 000000000000..71133dd930c9 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CollectorAgentProperties.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// The CollectorAgentProperties. + public partial class CollectorAgentProperties + { + /// Initializes a new instance of CollectorAgentProperties. + public CollectorAgentProperties() + { + } + + /// Initializes a new instance of CollectorAgentProperties. + /// + /// + /// + /// + internal CollectorAgentProperties(string id, string version, DateTimeOffset? lastHeartbeatUtc, CollectorBodyAgentSpnProperties spnDetails) + { + Id = id; + Version = version; + LastHeartbeatUtc = lastHeartbeatUtc; + SpnDetails = spnDetails; + } + + /// Gets the id. + public string Id { get; } + /// Gets the version. + public string Version { get; } + /// Gets the last heartbeat utc. + public DateTimeOffset? LastHeartbeatUtc { get; } + /// Gets or sets the spn details. + public CollectorBodyAgentSpnProperties SpnDetails { get; set; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CollectorBodyAgentSpnProperties.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CollectorBodyAgentSpnProperties.Serialization.cs new file mode 100644 index 000000000000..5203be0541ec --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CollectorBodyAgentSpnProperties.Serialization.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class CollectorBodyAgentSpnProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Authority)) + { + writer.WritePropertyName("authority"); + writer.WriteStringValue(Authority); + } + if (Optional.IsDefined(ApplicationId)) + { + writer.WritePropertyName("applicationId"); + writer.WriteStringValue(ApplicationId); + } + if (Optional.IsDefined(Audience)) + { + writer.WritePropertyName("audience"); + writer.WriteStringValue(Audience); + } + if (Optional.IsDefined(ObjectId)) + { + writer.WritePropertyName("objectId"); + writer.WriteStringValue(ObjectId); + } + if (Optional.IsDefined(TenantId)) + { + writer.WritePropertyName("tenantId"); + writer.WriteStringValue(TenantId.Value); + } + writer.WriteEndObject(); + } + + internal static CollectorBodyAgentSpnProperties DeserializeCollectorBodyAgentSpnProperties(JsonElement element) + { + Optional authority = default; + Optional applicationId = default; + Optional audience = default; + Optional objectId = default; + Optional tenantId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authority")) + { + authority = property.Value.GetString(); + continue; + } + if (property.NameEquals("applicationId")) + { + applicationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("audience")) + { + audience = property.Value.GetString(); + continue; + } + if (property.NameEquals("objectId")) + { + objectId = property.Value.GetString(); + continue; + } + if (property.NameEquals("tenantId")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + tenantId = property.Value.GetGuid(); + continue; + } + } + return new CollectorBodyAgentSpnProperties(authority.Value, applicationId.Value, audience.Value, objectId.Value, Optional.ToNullable(tenantId)); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CollectorBodyAgentSpnProperties.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CollectorBodyAgentSpnProperties.cs new file mode 100644 index 000000000000..65d992e8ebc5 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CollectorBodyAgentSpnProperties.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// The CollectorBodyAgentSpnProperties. + public partial class CollectorBodyAgentSpnProperties + { + /// Initializes a new instance of CollectorBodyAgentSpnProperties. + public CollectorBodyAgentSpnProperties() + { + } + + /// Initializes a new instance of CollectorBodyAgentSpnProperties. + /// AAD Authority URL which was used to request the token for the service principal. + /// Application/client Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + /// Intended audience for the service principal. + /// Object Id of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + /// Tenant Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + internal CollectorBodyAgentSpnProperties(string authority, string applicationId, string audience, string objectId, Guid? tenantId) + { + Authority = authority; + ApplicationId = applicationId; + Audience = audience; + ObjectId = objectId; + TenantId = tenantId; + } + + /// AAD Authority URL which was used to request the token for the service principal. + public string Authority { get; set; } + /// Application/client Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + public string ApplicationId { get; set; } + /// Intended audience for the service principal. + public string Audience { get; set; } + /// Object Id of the service principal with which the on-premise management/data plane components would communicate with our Azure services. + public string ObjectId { get; set; } + /// Tenant Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. + public Guid? TenantId { get; set; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CollectorProperties.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CollectorProperties.Serialization.cs new file mode 100644 index 000000000000..8d803b521113 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CollectorProperties.Serialization.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class CollectorProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(DiscoverySiteId)) + { + writer.WritePropertyName("discoverySiteId"); + writer.WriteStringValue(DiscoverySiteId); + } + if (Optional.IsDefined(AgentProperties)) + { + writer.WritePropertyName("agentProperties"); + writer.WriteObjectValue(AgentProperties); + } + writer.WriteEndObject(); + } + + internal static CollectorProperties DeserializeCollectorProperties(JsonElement element) + { + Optional discoverySiteId = default; + Optional createdTimestamp = default; + Optional updatedTimestamp = default; + Optional agentProperties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("discoverySiteId")) + { + discoverySiteId = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdTimestamp")) + { + createdTimestamp = property.Value.GetString(); + continue; + } + if (property.NameEquals("updatedTimestamp")) + { + updatedTimestamp = property.Value.GetString(); + continue; + } + if (property.NameEquals("agentProperties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + agentProperties = CollectorAgentProperties.DeserializeCollectorAgentProperties(property.Value); + continue; + } + } + return new CollectorProperties(discoverySiteId.Value, createdTimestamp.Value, updatedTimestamp.Value, agentProperties.Value); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CollectorProperties.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CollectorProperties.cs new file mode 100644 index 000000000000..3968b329ca39 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CollectorProperties.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Migrate.Models +{ + /// The CollectorProperties. + public partial class CollectorProperties + { + /// Initializes a new instance of CollectorProperties. + public CollectorProperties() + { + } + + /// Initializes a new instance of CollectorProperties. + /// The ARM id of the discovery service site. + /// Time when this collector was created. Date-Time represented in ISO-8601 format. + /// Time when this collector was updated. Date-Time represented in ISO-8601 format. + /// + internal CollectorProperties(string discoverySiteId, string createdTimestamp, string updatedTimestamp, CollectorAgentProperties agentProperties) + { + DiscoverySiteId = discoverySiteId; + CreatedTimestamp = createdTimestamp; + UpdatedTimestamp = updatedTimestamp; + AgentProperties = agentProperties; + } + + /// The ARM id of the discovery service site. + public string DiscoverySiteId { get; set; } + /// Time when this collector was created. Date-Time represented in ISO-8601 format. + public string CreatedTimestamp { get; } + /// Time when this collector was updated. Date-Time represented in ISO-8601 format. + public string UpdatedTimestamp { get; } + /// Gets or sets the agent properties. + public CollectorAgentProperties AgentProperties { get; set; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/Currency.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/Currency.cs new file mode 100644 index 000000000000..b4c6a98ed7df --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/Currency.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.Migrate.Models +{ + /// Currency to report prices in. + public readonly partial struct Currency : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public Currency(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 Currency Unknown { get; } = new Currency(UnknownValue); + /// USD. + public static Currency USD { get; } = new Currency(USDValue); + /// DKK. + public static Currency DKK { get; } = new Currency(DKKValue); + /// CAD. + public static Currency CAD { get; } = new Currency(CADValue); + /// IDR. + public static Currency IdR { get; } = new Currency(IdRValue); + /// JPY. + public static Currency JPY { get; } = new Currency(JPYValue); + /// KRW. + public static Currency KRW { get; } = new Currency(KRWValue); + /// NZD. + public static Currency NZD { get; } = new Currency(NZDValue); + /// NOK. + public static Currency NOK { get; } = new Currency(NOKValue); + /// RUB. + public static Currency RUB { get; } = new Currency(RUBValue); + /// SAR. + public static Currency SAR { get; } = new Currency(SARValue); + /// ZAR. + public static Currency ZAR { get; } = new Currency(ZARValue); + /// SEK. + public static Currency SEK { get; } = new Currency(SEKValue); + /// TRY. + public static Currency TRY { get; } = new Currency(TRYValue); + /// GBP. + public static Currency GBP { get; } = new Currency(GBPValue); + /// MXN. + public static Currency MXN { get; } = new Currency(MXNValue); + /// MYR. + public static Currency MYR { get; } = new Currency(MYRValue); + /// INR. + public static Currency INR { get; } = new Currency(INRValue); + /// HKD. + public static Currency HKD { get; } = new Currency(HKDValue); + /// BRL. + public static Currency BRL { get; } = new Currency(BRLValue); + /// TWD. + public static Currency TWD { get; } = new Currency(TWDValue); + /// EUR. + public static Currency EUR { get; } = new Currency(EURValue); + /// CHF. + public static Currency CHF { get; } = new Currency(CHFValue); + /// ARS. + public static Currency ARS { get; } = new Currency(ARSValue); + /// AUD. + public static Currency AUD { get; } = new Currency(AUDValue); + /// CNY. + public static Currency CNY { get; } = new Currency(CNYValue); + /// Determines if two values are the same. + public static bool operator ==(Currency left, Currency right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Currency left, Currency right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator Currency(string value) => new Currency(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Currency other && Equals(other); + /// + public bool Equals(Currency other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/Disk.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/Disk.Serialization.cs new file mode 100644 index 000000000000..dcb511b8c20f --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/Disk.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class Disk + { + internal static Disk DeserializeDisk(JsonElement element) + { + Optional gigabytesAllocated = default; + Optional displayName = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("gigabytesAllocated")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + gigabytesAllocated = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("displayName")) + { + displayName = property.Value.GetString(); + continue; + } + } + return new Disk(Optional.ToNullable(gigabytesAllocated), displayName.Value); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/Disk.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/Disk.cs new file mode 100644 index 000000000000..b449415a1f36 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/Disk.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Migrate.Models +{ + /// A disk discovered on a machine. + public partial class Disk + { + /// Initializes a new instance of Disk. + internal Disk() + { + } + + /// Initializes a new instance of Disk. + /// Gigabytes of storage provisioned for this disk. + /// User friendly name of the disk. + internal Disk(double? gigabytesAllocated, string displayName) + { + GigabytesAllocated = gigabytesAllocated; + DisplayName = displayName; + } + + /// 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/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUri.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUri.Serialization.cs new file mode 100644 index 000000000000..e1f7b8ed7228 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUri.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class DownloadUri + { + internal static DownloadUri DeserializeDownloadUri(JsonElement element) + { + Optional assessmentReportUrl = default; + Optional expirationTime = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("assessmentReportUrl")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + assessmentReportUrl = null; + continue; + } + assessmentReportUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("expirationTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + expirationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new DownloadUri(assessmentReportUrl.Value, Optional.ToNullable(expirationTime)); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUri.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUri.cs new file mode 100644 index 000000000000..dd832a01b54e --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUri.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Download URL for assessment report. + public partial class DownloadUri + { + /// Initializes a new instance of DownloadUri. + internal DownloadUri() + { + } + + /// Initializes a new instance of DownloadUri. + /// Hyperlink to download report. + /// Expiry date of download url. + internal DownloadUri(Uri assessmentReportUri, DateTimeOffset? expireOn) + { + AssessmentReportUri = assessmentReportUri; + ExpireOn = expireOn; + } + + /// Hyperlink to download report. + public Uri AssessmentReportUri { get; } + /// Expiry date of download url. + public DateTimeOffset? ExpireOn { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupBodyProperties.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupBodyProperties.Serialization.cs new file mode 100644 index 000000000000..ffbbed9aa0e6 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupBodyProperties.Serialization.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class GroupBodyProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(OperationType)) + { + writer.WritePropertyName("operationType"); + writer.WriteStringValue(OperationType.Value.ToString()); + } + if (Optional.IsCollectionDefined(Machines)) + { + writer.WritePropertyName("machines"); + writer.WriteStartArray(); + foreach (var item in Machines) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupBodyProperties.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupBodyProperties.cs new file mode 100644 index 000000000000..38711fa9f7b2 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupBodyProperties.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Body properties of group update. + public partial class GroupBodyProperties + { + /// Initializes a new instance of GroupBodyProperties. + public GroupBodyProperties() + { + Machines = new ChangeTrackingList(); + } + + /// Whether to add or remove the machines. + public GroupUpdateOperation? OperationType { get; set; } + /// List of machine names that are part of this group. + public IList Machines { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupData.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupData.Serialization.cs new file mode 100644 index 000000000000..0136aeb640e2 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupData.Serialization.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + public partial class GroupData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"); + writer.WriteStringValue(ETag.Value.ToString()); + } + writer.WritePropertyName("properties"); + writer.WriteObjectValue(Properties); + writer.WriteEndObject(); + } + + internal static GroupData DeserializeGroupData(JsonElement element) + { + Optional eTag = default; + GroupProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("eTag")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + eTag = new ETag(property.Value.GetString()); + continue; + } + if (property.NameEquals("properties")) + { + properties = GroupProperties.DeserializeGroupProperties(property.Value); + continue; + } + if (property.NameEquals("id")) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.ToString()); + continue; + } + } + return new GroupData(id, name, type, systemData.Value, Optional.ToNullable(eTag), properties); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupProperties.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupProperties.Serialization.cs new file mode 100644 index 000000000000..21af85dd339c --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupProperties.Serialization.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class GroupProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(GroupType)) + { + writer.WritePropertyName("groupType"); + writer.WriteStringValue(GroupType); + } + writer.WriteEndObject(); + } + + internal static GroupProperties DeserializeGroupProperties(JsonElement element) + { + Optional groupStatus = default; + Optional machineCount = default; + Optional> assessments = default; + Optional areAssessmentsRunning = default; + Optional createdTimestamp = default; + Optional updatedTimestamp = default; + Optional groupType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("groupStatus")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + groupStatus = new GroupStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("machineCount")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + machineCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("assessments")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + assessments = array; + continue; + } + if (property.NameEquals("areAssessmentsRunning")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + areAssessmentsRunning = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("createdTimestamp")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + createdTimestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("updatedTimestamp")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + updatedTimestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("groupType")) + { + groupType = property.Value.GetString(); + continue; + } + } + return new GroupProperties(Optional.ToNullable(groupStatus), Optional.ToNullable(machineCount), Optional.ToList(assessments), Optional.ToNullable(areAssessmentsRunning), Optional.ToNullable(createdTimestamp), Optional.ToNullable(updatedTimestamp), groupType.Value); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupProperties.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupProperties.cs new file mode 100644 index 000000000000..ef7125f4b048 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupProperties.cs @@ -0,0 +1,57 @@ +// 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.Migrate.Models +{ + /// Properties of group resource. + public partial class GroupProperties + { + /// Initializes a new instance of GroupProperties. + public GroupProperties() + { + Assessments = new ChangeTrackingList(); + } + + /// Initializes a new instance of GroupProperties. + /// 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. + /// 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. + internal GroupProperties(GroupStatus? groupStatus, int? machineCount, IReadOnlyList assessments, bool? areAssessmentsRunning, DateTimeOffset? createdTimestamp, DateTimeOffset? updatedTimestamp, string groupType) + { + GroupStatus = groupStatus; + MachineCount = machineCount; + Assessments = assessments; + AreAssessmentsRunning = areAssessmentsRunning; + CreatedTimestamp = createdTimestamp; + UpdatedTimestamp = updatedTimestamp; + GroupType = groupType; + } + + /// Whether the group has been created and is valid. + public GroupStatus? 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; } + /// 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? CreatedTimestamp { get; } + /// Time when this group was last updated. Date-Time represented in ISO-8601 format. + public DateTimeOffset? UpdatedTimestamp { get; } + /// The type of group. + public string GroupType { get; set; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupResultList.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupResultList.Serialization.cs new file mode 100644 index 000000000000..65fb5dbd17bd --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupResultList.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migrate; + +namespace Azure.ResourceManager.Migrate.Models +{ + internal partial class GroupResultList + { + internal static GroupResultList DeserializeGroupResultList(JsonElement element) + { + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(GroupData.DeserializeGroupData(item)); + } + value = array; + continue; + } + } + return new GroupResultList(Optional.ToList(value)); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupResultList.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupResultList.cs new file mode 100644 index 000000000000..1c5149bfa9d5 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupResultList.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migrate; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// List of groups. + internal partial class GroupResultList + { + /// Initializes a new instance of GroupResultList. + internal GroupResultList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of GroupResultList. + /// List of groups. + internal GroupResultList(IReadOnlyList value) + { + Value = value; + } + + /// List of groups. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupStatus.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupStatus.cs new file mode 100644 index 000000000000..f7c1f748e8ea --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupStatus.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.Migrate.Models +{ + /// Whether the group has been created and is valid. + public readonly partial struct GroupStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public GroupStatus(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 GroupStatus Created { get; } = new GroupStatus(CreatedValue); + /// Updated. + public static GroupStatus Updated { get; } = new GroupStatus(UpdatedValue); + /// Running. + public static GroupStatus Running { get; } = new GroupStatus(RunningValue); + /// Completed. + public static GroupStatus Completed { get; } = new GroupStatus(CompletedValue); + /// Invalid. + public static GroupStatus Invalid { get; } = new GroupStatus(InvalidValue); + /// Determines if two values are the same. + public static bool operator ==(GroupStatus left, GroupStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(GroupStatus left, GroupStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator GroupStatus(string value) => new GroupStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is GroupStatus other && Equals(other); + /// + public bool Equals(GroupStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupUpdateOperation.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupUpdateOperation.cs new file mode 100644 index 000000000000..f3c4a2b3d64a --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/GroupUpdateOperation.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.Migrate.Models +{ + /// Whether to add or remove the machines. + public readonly partial struct GroupUpdateOperation : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public GroupUpdateOperation(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AddValue = "Add"; + private const string RemoveValue = "Remove"; + + /// Add. + public static GroupUpdateOperation Add { get; } = new GroupUpdateOperation(AddValue); + /// Remove. + public static GroupUpdateOperation Remove { get; } = new GroupUpdateOperation(RemoveValue); + /// Determines if two values are the same. + public static bool operator ==(GroupUpdateOperation left, GroupUpdateOperation right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(GroupUpdateOperation left, GroupUpdateOperation right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator GroupUpdateOperation(string value) => new GroupUpdateOperation(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is GroupUpdateOperation other && Equals(other); + /// + public bool Equals(GroupUpdateOperation other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/HyperVCollectorData.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/HyperVCollectorData.Serialization.cs new file mode 100644 index 000000000000..f5970561c22a --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/HyperVCollectorData.Serialization.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + public partial class HyperVCollectorData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"); + writer.WriteStringValue(ETag.Value.ToString()); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"); + writer.WriteObjectValue(Properties); + } + writer.WriteEndObject(); + } + + internal static HyperVCollectorData DeserializeHyperVCollectorData(JsonElement element) + { + Optional eTag = default; + Optional properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("eTag")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + eTag = new ETag(property.Value.GetString()); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + properties = CollectorProperties.DeserializeCollectorProperties(property.Value); + continue; + } + if (property.NameEquals("id")) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.ToString()); + continue; + } + } + return new HyperVCollectorData(id, name, type, systemData.Value, Optional.ToNullable(eTag), properties.Value); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/HyperVCollectorList.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/HyperVCollectorList.Serialization.cs new file mode 100644 index 000000000000..c71f3590c914 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/HyperVCollectorList.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migrate; + +namespace Azure.ResourceManager.Migrate.Models +{ + internal partial class HyperVCollectorList + { + internal static HyperVCollectorList DeserializeHyperVCollectorList(JsonElement element) + { + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HyperVCollectorData.DeserializeHyperVCollectorData(item)); + } + value = array; + continue; + } + } + return new HyperVCollectorList(Optional.ToList(value)); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/HyperVCollectorList.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/HyperVCollectorList.cs new file mode 100644 index 000000000000..b0a6944c6c26 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/HyperVCollectorList.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migrate; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// List of Hyper-V collectors. + internal partial class HyperVCollectorList + { + /// Initializes a new instance of HyperVCollectorList. + internal HyperVCollectorList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of HyperVCollectorList. + /// List of Hyper-V collectors. + internal HyperVCollectorList(IReadOnlyList value) + { + Value = value; + } + + /// List of Hyper-V collectors. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ImportCollectorData.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ImportCollectorData.Serialization.cs new file mode 100644 index 000000000000..836192cf60b4 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ImportCollectorData.Serialization.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + public partial class ImportCollectorData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"); + writer.WriteStringValue(ETag.Value.ToString()); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"); + writer.WriteObjectValue(Properties); + } + writer.WriteEndObject(); + } + + internal static ImportCollectorData DeserializeImportCollectorData(JsonElement element) + { + Optional eTag = default; + Optional properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("eTag")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + eTag = new ETag(property.Value.GetString()); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + properties = ImportCollectorProperties.DeserializeImportCollectorProperties(property.Value); + continue; + } + if (property.NameEquals("id")) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.ToString()); + continue; + } + } + return new ImportCollectorData(id, name, type, systemData.Value, Optional.ToNullable(eTag), properties.Value); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ImportCollectorList.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ImportCollectorList.Serialization.cs new file mode 100644 index 000000000000..37da774d39e8 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ImportCollectorList.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migrate; + +namespace Azure.ResourceManager.Migrate.Models +{ + internal partial class ImportCollectorList + { + internal static ImportCollectorList DeserializeImportCollectorList(JsonElement element) + { + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ImportCollectorData.DeserializeImportCollectorData(item)); + } + value = array; + continue; + } + } + return new ImportCollectorList(Optional.ToList(value)); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ImportCollectorList.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ImportCollectorList.cs new file mode 100644 index 000000000000..f28f53f34960 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ImportCollectorList.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migrate; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// List of Import collectors. + internal partial class ImportCollectorList + { + /// Initializes a new instance of ImportCollectorList. + internal ImportCollectorList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of ImportCollectorList. + /// List of Import collectors. + internal ImportCollectorList(IReadOnlyList value) + { + Value = value; + } + + /// List of Import collectors. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ImportCollectorProperties.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ImportCollectorProperties.Serialization.cs new file mode 100644 index 000000000000..45d63d0c0fb1 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ImportCollectorProperties.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class ImportCollectorProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(DiscoverySiteId)) + { + writer.WritePropertyName("discoverySiteId"); + writer.WriteStringValue(DiscoverySiteId); + } + writer.WriteEndObject(); + } + + internal static ImportCollectorProperties DeserializeImportCollectorProperties(JsonElement element) + { + Optional discoverySiteId = default; + Optional createdTimestamp = default; + Optional updatedTimestamp = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("discoverySiteId")) + { + discoverySiteId = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdTimestamp")) + { + createdTimestamp = property.Value.GetString(); + continue; + } + if (property.NameEquals("updatedTimestamp")) + { + updatedTimestamp = property.Value.GetString(); + continue; + } + } + return new ImportCollectorProperties(discoverySiteId.Value, createdTimestamp.Value, updatedTimestamp.Value); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ImportCollectorProperties.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ImportCollectorProperties.cs new file mode 100644 index 000000000000..b408facb76e7 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ImportCollectorProperties.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Migrate.Models +{ + /// The ImportCollectorProperties. + public partial class ImportCollectorProperties + { + /// Initializes a new instance of ImportCollectorProperties. + public ImportCollectorProperties() + { + } + + /// Initializes a new instance of ImportCollectorProperties. + /// + /// + /// + internal ImportCollectorProperties(string discoverySiteId, string createdTimestamp, string updatedTimestamp) + { + DiscoverySiteId = discoverySiteId; + CreatedTimestamp = createdTimestamp; + UpdatedTimestamp = updatedTimestamp; + } + + /// Gets or sets the discovery site id. + public string DiscoverySiteId { get; set; } + /// Gets the created timestamp. + public string CreatedTimestamp { get; } + /// Gets the updated timestamp. + public string UpdatedTimestamp { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MachineBootType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MachineBootType.cs new file mode 100644 index 000000000000..772e408d092d --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MachineBootType.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.Migrate.Models +{ + /// Boot type of the machine. + 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"; + + /// 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); + /// 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 string 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?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MachineData.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MachineData.Serialization.cs new file mode 100644 index 000000000000..a1dff47729fd --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MachineData.Serialization.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + public partial class MachineData + { + internal static MachineData DeserializeMachineData(JsonElement element) + { + Optional eTag = default; + Optional properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("eTag")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + eTag = new ETag(property.Value.GetString()); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + properties = MachineProperties.DeserializeMachineProperties(property.Value); + continue; + } + if (property.NameEquals("id")) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.ToString()); + continue; + } + } + return new MachineData(id, name, type, systemData.Value, Optional.ToNullable(eTag), properties.Value); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MachineProperties.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MachineProperties.Serialization.cs new file mode 100644 index 000000000000..501b32b492d1 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MachineProperties.Serialization.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class MachineProperties + { + internal static MachineProperties DeserializeMachineProperties(JsonElement element) + { + Optional bootType = default; + Optional datacenterManagementServerArmId = default; + Optional discoveryMachineArmId = default; + Optional datacenterManagementServerName = default; + Optional displayName = default; + Optional megabytesOfMemory = default; + Optional numberOfCores = default; + Optional operatingSystemType = default; + Optional operatingSystemName = default; + Optional operatingSystemVersion = default; + Optional description = default; + Optional> groups = default; + Optional createdTimestamp = default; + Optional updatedTimestamp = default; + Optional> disks = default; + Optional> networkAdapters = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("bootType")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + bootType = new MachineBootType(property.Value.GetString()); + continue; + } + if (property.NameEquals("datacenterManagementServerArmId")) + { + datacenterManagementServerArmId = property.Value.GetString(); + continue; + } + if (property.NameEquals("discoveryMachineArmId")) + { + discoveryMachineArmId = property.Value.GetString(); + continue; + } + if (property.NameEquals("datacenterManagementServerName")) + { + datacenterManagementServerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName")) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("megabytesOfMemory")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + megabytesOfMemory = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("numberOfCores")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + numberOfCores = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("operatingSystemType")) + { + operatingSystemType = property.Value.GetString(); + continue; + } + if (property.NameEquals("operatingSystemName")) + { + operatingSystemName = property.Value.GetString(); + continue; + } + if (property.NameEquals("operatingSystemVersion")) + { + operatingSystemVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("description")) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("groups")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + groups = array; + continue; + } + if (property.NameEquals("createdTimestamp")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + createdTimestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("updatedTimestamp")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + updatedTimestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("disks")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, Disk.DeserializeDisk(property0.Value)); + } + disks = dictionary; + continue; + } + if (property.NameEquals("networkAdapters")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, NetworkAdapter.DeserializeNetworkAdapter(property0.Value)); + } + networkAdapters = dictionary; + continue; + } + } + return new MachineProperties(Optional.ToNullable(bootType), datacenterManagementServerArmId.Value, discoveryMachineArmId.Value, datacenterManagementServerName.Value, displayName.Value, Optional.ToNullable(megabytesOfMemory), Optional.ToNullable(numberOfCores), operatingSystemType.Value, operatingSystemName.Value, operatingSystemVersion.Value, description.Value, Optional.ToList(groups), Optional.ToNullable(createdTimestamp), Optional.ToNullable(updatedTimestamp), Optional.ToDictionary(disks), Optional.ToDictionary(networkAdapters)); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MachineProperties.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MachineProperties.cs new file mode 100644 index 000000000000..69f857b2930c --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MachineProperties.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; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Properties of a machine. + public partial class MachineProperties + { + /// Initializes a new instance of MachineProperties. + internal MachineProperties() + { + Groups = new ChangeTrackingList(); + Disks = new ChangeTrackingDictionary(); + NetworkAdapters = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of MachineProperties. + /// Boot type of the machine. + /// ARM ID of the data center as tracked by the Microsoft.OffAzure. + /// ARM ID of the machine as tracked by the Microsoft.OffAzure. + /// Name of the server hosting the datacenter management solution. + /// User readable name of the machine as defined by the user in their private datacenter. + /// Memory in Megabytes. + /// Processor count. + /// Operating System type of the machine. + /// Operating System name of the machine. + /// Operating System version of the machine. + /// Description of the machine. + /// List of references to the groups that the machine is member of. + /// Time when this machine was created. Date-Time represented in ISO-8601 format. + /// Time when this machine was last updated. Date-Time represented in ISO-8601 format. + /// Dictionary of disks attached to the machine. Key is ID of disk. Value is a disk object. + /// Dictionary of network adapters attached to the machine. Key is ID of network adapter. Value is a network adapter object. + internal MachineProperties(MachineBootType? bootType, string datacenterManagementServerArmId, string discoveryMachineArmId, string datacenterManagementServerName, string displayName, float? megabytesOfMemory, int? numberOfCores, string operatingSystemType, string operatingSystemName, string operatingSystemVersion, string description, IReadOnlyList groups, DateTimeOffset? createdTimestamp, DateTimeOffset? updatedTimestamp, IReadOnlyDictionary disks, IReadOnlyDictionary networkAdapters) + { + BootType = bootType; + DatacenterManagementServerArmId = datacenterManagementServerArmId; + DiscoveryMachineArmId = discoveryMachineArmId; + DatacenterManagementServerName = datacenterManagementServerName; + DisplayName = displayName; + MegabytesOfMemory = megabytesOfMemory; + NumberOfCores = numberOfCores; + OperatingSystemType = operatingSystemType; + OperatingSystemName = operatingSystemName; + OperatingSystemVersion = operatingSystemVersion; + Description = description; + Groups = groups; + CreatedTimestamp = createdTimestamp; + UpdatedTimestamp = updatedTimestamp; + Disks = disks; + NetworkAdapters = networkAdapters; + } + + /// Boot type of the machine. + public MachineBootType? BootType { get; } + /// ARM ID of the data center as tracked by the Microsoft.OffAzure. + public string DatacenterManagementServerArmId { get; } + /// ARM ID of the machine as tracked by the Microsoft.OffAzure. + public string DiscoveryMachineArmId { get; } + /// Name of the server hosting the datacenter management solution. + public string DatacenterManagementServerName { get; } + /// User readable name of the machine as defined by the user in their private datacenter. + public string DisplayName { get; } + /// Memory in Megabytes. + public float? MegabytesOfMemory { get; } + /// Processor count. + public int? NumberOfCores { get; } + /// Operating System type of the machine. + public string OperatingSystemType { get; } + /// Operating System name of the machine. + public string OperatingSystemName { get; } + /// Operating System version of the machine. + public string OperatingSystemVersion { get; } + /// Description of the machine. + public string Description { get; } + /// List of references to the groups that the machine is member of. + public IReadOnlyList Groups { get; } + /// Time when this machine was created. Date-Time represented in ISO-8601 format. + public DateTimeOffset? CreatedTimestamp { get; } + /// Time when this machine was last updated. Date-Time represented in ISO-8601 format. + public DateTimeOffset? UpdatedTimestamp { get; } + /// Dictionary of disks attached to the machine. Key is ID of disk. Value is a disk object. + public IReadOnlyDictionary Disks { get; } + /// Dictionary of network adapters attached to the machine. Key is ID of network adapter. Value is a network adapter object. + public IReadOnlyDictionary NetworkAdapters { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MachineResultList.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MachineResultList.Serialization.cs new file mode 100644 index 000000000000..f126bb0a7ba2 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MachineResultList.Serialization.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migrate; + +namespace Azure.ResourceManager.Migrate.Models +{ + internal partial class MachineResultList + { + internal static MachineResultList DeserializeMachineResultList(JsonElement element) + { + Optional> value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MachineData.DeserializeMachineData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new MachineResultList(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MachineResultList.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MachineResultList.cs new file mode 100644 index 000000000000..8c0a87cddfbc --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MachineResultList.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migrate; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// List of machines. + internal partial class MachineResultList + { + /// Initializes a new instance of MachineResultList. + internal MachineResultList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of MachineResultList. + /// List of machines. + /// + internal MachineResultList(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// List of machines. + public IReadOnlyList Value { get; } + /// Gets the next link. + public string NextLink { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigratePrivateEndpointConnectionData.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigratePrivateEndpointConnectionData.Serialization.cs new file mode 100644 index 000000000000..250491c33c48 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigratePrivateEndpointConnectionData.Serialization.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + public partial class MigratePrivateEndpointConnectionData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"); + writer.WriteStringValue(ETag.Value.ToString()); + } + writer.WritePropertyName("properties"); + writer.WriteObjectValue(Properties); + writer.WriteEndObject(); + } + + internal static MigratePrivateEndpointConnectionData DeserializeMigratePrivateEndpointConnectionData(JsonElement element) + { + Optional eTag = default; + PrivateEndpointConnectionProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("eTag")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + eTag = new ETag(property.Value.GetString()); + continue; + } + if (property.NameEquals("properties")) + { + properties = PrivateEndpointConnectionProperties.DeserializePrivateEndpointConnectionProperties(property.Value); + continue; + } + if (property.NameEquals("id")) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.ToString()); + continue; + } + } + return new MigratePrivateEndpointConnectionData(id, name, type, systemData.Value, Optional.ToNullable(eTag), properties); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigratePrivateLinkResourceData.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigratePrivateLinkResourceData.Serialization.cs new file mode 100644 index 000000000000..4d147c5f71e5 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigratePrivateLinkResourceData.Serialization.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + public partial class MigratePrivateLinkResourceData + { + internal static MigratePrivateLinkResourceData DeserializeMigratePrivateLinkResourceData(JsonElement element) + { + Optional properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + properties = MigratePrivateLinkResourceProperties.DeserializeMigratePrivateLinkResourceProperties(property.Value); + continue; + } + if (property.NameEquals("id")) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.ToString()); + continue; + } + } + return new MigratePrivateLinkResourceData(id, name, type, systemData.Value, properties.Value); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigratePrivateLinkResourceProperties.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigratePrivateLinkResourceProperties.Serialization.cs new file mode 100644 index 000000000000..0ddf186a0d64 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigratePrivateLinkResourceProperties.Serialization.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class MigratePrivateLinkResourceProperties + { + internal static MigratePrivateLinkResourceProperties DeserializeMigratePrivateLinkResourceProperties(JsonElement element) + { + Optional> requiredMembers = default; + Optional> requiredZoneNames = default; + Optional groupId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("requiredMembers")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + requiredMembers = array; + continue; + } + if (property.NameEquals("requiredZoneNames")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + requiredZoneNames = array; + continue; + } + if (property.NameEquals("groupId")) + { + groupId = property.Value.GetString(); + continue; + } + } + return new MigratePrivateLinkResourceProperties(Optional.ToList(requiredMembers), Optional.ToList(requiredZoneNames), groupId.Value); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigratePrivateLinkResourceProperties.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigratePrivateLinkResourceProperties.cs new file mode 100644 index 000000000000..5d0d488cb4db --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigratePrivateLinkResourceProperties.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Properties of a private link resource. + public partial class MigratePrivateLinkResourceProperties + { + /// Initializes a new instance of MigratePrivateLinkResourceProperties. + internal MigratePrivateLinkResourceProperties() + { + RequiredMembers = new ChangeTrackingList(); + RequiredZoneNames = new ChangeTrackingList(); + } + + /// Initializes a new instance of MigratePrivateLinkResourceProperties. + /// The private link resource required member names. + /// Required DNS zone names of the the private link resource. + /// The private link resource group id. + internal MigratePrivateLinkResourceProperties(IReadOnlyList requiredMembers, IReadOnlyList requiredZoneNames, string groupId) + { + RequiredMembers = requiredMembers; + RequiredZoneNames = requiredZoneNames; + GroupId = groupId; + } + + /// The private link resource required member names. + public IReadOnlyList RequiredMembers { get; } + /// Required DNS zone names of the the private link resource. + public IReadOnlyList RequiredZoneNames { get; } + /// The private link resource group id. + public string GroupId { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigratePrivateLinkServiceConnectionState.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigratePrivateLinkServiceConnectionState.Serialization.cs new file mode 100644 index 000000000000..5e9bcab428bf --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigratePrivateLinkServiceConnectionState.Serialization.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class MigratePrivateLinkServiceConnectionState : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(ActionsRequired)) + { + writer.WritePropertyName("actionsRequired"); + writer.WriteStringValue(ActionsRequired); + } + writer.WriteEndObject(); + } + + internal static MigratePrivateLinkServiceConnectionState DeserializeMigratePrivateLinkServiceConnectionState(JsonElement element) + { + Optional status = default; + Optional description = default; + Optional actionsRequired = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + status = new PrivateLinkServiceConnectionStateStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("description")) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("actionsRequired")) + { + actionsRequired = property.Value.GetString(); + continue; + } + } + return new MigratePrivateLinkServiceConnectionState(Optional.ToNullable(status), description.Value, actionsRequired.Value); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigratePrivateLinkServiceConnectionState.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigratePrivateLinkServiceConnectionState.cs new file mode 100644 index 000000000000..6ee3a0bc10bb --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigratePrivateLinkServiceConnectionState.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Migrate.Models +{ + /// State of a private endpoint connection. + public partial class MigratePrivateLinkServiceConnectionState + { + /// Initializes a new instance of MigratePrivateLinkServiceConnectionState. + public MigratePrivateLinkServiceConnectionState() + { + } + + /// Initializes a new instance of MigratePrivateLinkServiceConnectionState. + /// Connection status of the private endpoint connection. + /// Description of the private endpoint connection. + /// Actions required on the private endpoint connection. + internal MigratePrivateLinkServiceConnectionState(PrivateLinkServiceConnectionStateStatus? status, string description, string actionsRequired) + { + Status = status; + Description = description; + ActionsRequired = actionsRequired; + } + + /// Connection status of the private endpoint connection. + public PrivateLinkServiceConnectionStateStatus? Status { get; set; } + /// Description of the private endpoint connection. + public string Description { get; set; } + /// Actions required on the private endpoint connection. + public string ActionsRequired { get; set; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NetworkAdapter.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NetworkAdapter.Serialization.cs new file mode 100644 index 000000000000..f86c22363436 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NetworkAdapter.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class NetworkAdapter + { + internal static NetworkAdapter DeserializeNetworkAdapter(JsonElement element) + { + Optional macAddress = default; + Optional> ipAddresses = default; + Optional displayName = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("macAddress")) + { + macAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipAddresses")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipAddresses = array; + continue; + } + if (property.NameEquals("displayName")) + { + displayName = property.Value.GetString(); + continue; + } + } + return new NetworkAdapter(macAddress.Value, Optional.ToList(ipAddresses), displayName.Value); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NetworkAdapter.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NetworkAdapter.cs new file mode 100644 index 000000000000..07dbb1ace2cf --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NetworkAdapter.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// A network adapter discovered on a machine. + public partial class NetworkAdapter + { + /// Initializes a new instance of NetworkAdapter. + internal NetworkAdapter() + { + IPAddresses = new ChangeTrackingList(); + } + + /// Initializes a new instance of NetworkAdapter. + /// MAC Address of the network adapter. + /// List of IP Addresses on the network adapter. + /// User friendly name of the network adapter. + internal NetworkAdapter(string macAddress, IReadOnlyList ipAddresses, string displayName) + { + MacAddress = macAddress; + IPAddresses = ipAddresses; + DisplayName = displayName; + } + + /// 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/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/Percentile.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/Percentile.cs new file mode 100644 index 000000000000..3caf3d63909d --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/Percentile.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.Migrate.Models +{ + /// Percentile of performance data used to recommend Azure size. + public readonly partial struct Percentile : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public Percentile(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 Percentile Percentile50 { get; } = new Percentile(Percentile50Value); + /// Percentile90. + public static Percentile Percentile90 { get; } = new Percentile(Percentile90Value); + /// Percentile95. + public static Percentile Percentile95 { get; } = new Percentile(Percentile95Value); + /// Percentile99. + public static Percentile Percentile99 { get; } = new Percentile(Percentile99Value); + /// Determines if two values are the same. + public static bool operator ==(Percentile left, Percentile right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Percentile left, Percentile right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator Percentile(string value) => new Percentile(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Percentile other && Equals(other); + /// + public bool Equals(Percentile other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/PrivateEndpointConnectionCollection.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/PrivateEndpointConnectionCollection.Serialization.cs new file mode 100644 index 000000000000..bf59ebca8071 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/PrivateEndpointConnectionCollection.Serialization.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migrate; + +namespace Azure.ResourceManager.Migrate.Models +{ + internal partial class PrivateEndpointConnectionCollection + { + internal static PrivateEndpointConnectionCollection DeserializePrivateEndpointConnectionCollection(JsonElement element) + { + Optional> value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MigratePrivateEndpointConnectionData.DeserializeMigratePrivateEndpointConnectionData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new PrivateEndpointConnectionCollection(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/PrivateEndpointConnectionCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/PrivateEndpointConnectionCollection.cs new file mode 100644 index 000000000000..07e987b0707a --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/PrivateEndpointConnectionCollection.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migrate; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// A collection of private endpoint connections for a project. + internal partial class PrivateEndpointConnectionCollection + { + /// Initializes a new instance of PrivateEndpointConnectionCollection. + internal PrivateEndpointConnectionCollection() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of PrivateEndpointConnectionCollection. + /// A list of private endpoint connections for a project. + /// + internal PrivateEndpointConnectionCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// A list of private endpoint connections for a project. + public IReadOnlyList Value { get; } + /// Gets the next link. + public string NextLink { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/PrivateEndpointConnectionProperties.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/PrivateEndpointConnectionProperties.Serialization.cs new file mode 100644 index 000000000000..3bb9b9dc8b64 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/PrivateEndpointConnectionProperties.Serialization.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class PrivateEndpointConnectionProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ConnectionState)) + { + writer.WritePropertyName("privateLinkServiceConnectionState"); + writer.WriteObjectValue(ConnectionState); + } + writer.WriteEndObject(); + } + + internal static PrivateEndpointConnectionProperties DeserializePrivateEndpointConnectionProperties(JsonElement element) + { + Optional provisioningState = default; + Optional privateEndpoint = default; + Optional privateLinkServiceConnectionState = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + provisioningState = new PrivateEndpointConnectionPropertiesProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("privateEndpoint")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + privateEndpoint = JsonSerializer.Deserialize(property.Value.ToString()); + continue; + } + if (property.NameEquals("privateLinkServiceConnectionState")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + privateLinkServiceConnectionState = MigratePrivateLinkServiceConnectionState.DeserializeMigratePrivateLinkServiceConnectionState(property.Value); + continue; + } + } + return new PrivateEndpointConnectionProperties(Optional.ToNullable(provisioningState), privateEndpoint, privateLinkServiceConnectionState.Value); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/PrivateEndpointConnectionProperties.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/PrivateEndpointConnectionProperties.cs new file mode 100644 index 000000000000..4957afbd7600 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/PrivateEndpointConnectionProperties.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Private endpoint connection properties. + public partial class PrivateEndpointConnectionProperties + { + /// Initializes a new instance of PrivateEndpointConnectionProperties. + public PrivateEndpointConnectionProperties() + { + } + + /// Initializes a new instance of PrivateEndpointConnectionProperties. + /// Indicates whether there is an ongoing operation on the private endpoint. + /// ARM id for the private endpoint resource corresponding to the connection. + /// State of the private endpoint connection. + internal PrivateEndpointConnectionProperties(PrivateEndpointConnectionPropertiesProvisioningState? provisioningState, SubResource privateEndpoint, MigratePrivateLinkServiceConnectionState connectionState) + { + ProvisioningState = provisioningState; + PrivateEndpoint = privateEndpoint; + ConnectionState = connectionState; + } + + /// Indicates whether there is an ongoing operation on the private endpoint. + public PrivateEndpointConnectionPropertiesProvisioningState? ProvisioningState { get; } + /// ARM id for the private endpoint resource corresponding to the connection. + internal SubResource PrivateEndpoint { get; } + /// Gets Id. + public ResourceIdentifier PrivateEndpointId + { + get => PrivateEndpoint?.Id; + } + + /// State of the private endpoint connection. + public MigratePrivateLinkServiceConnectionState ConnectionState { get; set; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/PrivateEndpointConnectionPropertiesProvisioningState.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/PrivateEndpointConnectionPropertiesProvisioningState.cs new file mode 100644 index 000000000000..81483fb140aa --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/PrivateEndpointConnectionPropertiesProvisioningState.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.Migrate.Models +{ + /// Indicates whether there is an ongoing operation on the private endpoint. + public readonly partial struct PrivateEndpointConnectionPropertiesProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PrivateEndpointConnectionPropertiesProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AcceptedValue = "Accepted"; + private const string InProgressValue = "InProgress"; + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + + /// Accepted. + public static PrivateEndpointConnectionPropertiesProvisioningState Accepted { get; } = new PrivateEndpointConnectionPropertiesProvisioningState(AcceptedValue); + /// InProgress. + public static PrivateEndpointConnectionPropertiesProvisioningState InProgress { get; } = new PrivateEndpointConnectionPropertiesProvisioningState(InProgressValue); + /// Succeeded. + public static PrivateEndpointConnectionPropertiesProvisioningState Succeeded { get; } = new PrivateEndpointConnectionPropertiesProvisioningState(SucceededValue); + /// Failed. + public static PrivateEndpointConnectionPropertiesProvisioningState Failed { get; } = new PrivateEndpointConnectionPropertiesProvisioningState(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(PrivateEndpointConnectionPropertiesProvisioningState left, PrivateEndpointConnectionPropertiesProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PrivateEndpointConnectionPropertiesProvisioningState left, PrivateEndpointConnectionPropertiesProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PrivateEndpointConnectionPropertiesProvisioningState(string value) => new PrivateEndpointConnectionPropertiesProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PrivateEndpointConnectionPropertiesProvisioningState other && Equals(other); + /// + public bool Equals(PrivateEndpointConnectionPropertiesProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/PrivateLinkResourceCollection.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/PrivateLinkResourceCollection.Serialization.cs new file mode 100644 index 000000000000..27f0ecacaa1b --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/PrivateLinkResourceCollection.Serialization.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migrate; + +namespace Azure.ResourceManager.Migrate.Models +{ + internal partial class PrivateLinkResourceCollection + { + internal static PrivateLinkResourceCollection DeserializePrivateLinkResourceCollection(JsonElement element) + { + Optional> value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MigratePrivateLinkResourceData.DeserializeMigratePrivateLinkResourceData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new PrivateLinkResourceCollection(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/PrivateLinkResourceCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/PrivateLinkResourceCollection.cs new file mode 100644 index 000000000000..cbaf84d50ea6 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/PrivateLinkResourceCollection.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migrate; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// A list of private link resources. + internal partial class PrivateLinkResourceCollection + { + /// Initializes a new instance of PrivateLinkResourceCollection. + internal PrivateLinkResourceCollection() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of PrivateLinkResourceCollection. + /// Array of results. + /// Link to retrieve next page of results. + internal PrivateLinkResourceCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Array of results. + public IReadOnlyList Value { get; } + /// Link to retrieve next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/PrivateLinkServiceConnectionStateStatus.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/PrivateLinkServiceConnectionStateStatus.cs new file mode 100644 index 000000000000..c7b3d3215d8a --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/PrivateLinkServiceConnectionStateStatus.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.Migrate.Models +{ + /// Connection status of the private endpoint connection. + public readonly partial struct PrivateLinkServiceConnectionStateStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PrivateLinkServiceConnectionStateStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ApprovedValue = "Approved"; + private const string PendingValue = "Pending"; + private const string RejectedValue = "Rejected"; + private const string DisconnectedValue = "Disconnected"; + + /// Approved. + public static PrivateLinkServiceConnectionStateStatus Approved { get; } = new PrivateLinkServiceConnectionStateStatus(ApprovedValue); + /// Pending. + public static PrivateLinkServiceConnectionStateStatus Pending { get; } = new PrivateLinkServiceConnectionStateStatus(PendingValue); + /// Rejected. + public static PrivateLinkServiceConnectionStateStatus Rejected { get; } = new PrivateLinkServiceConnectionStateStatus(RejectedValue); + /// Disconnected. + public static PrivateLinkServiceConnectionStateStatus Disconnected { get; } = new PrivateLinkServiceConnectionStateStatus(DisconnectedValue); + /// Determines if two values are the same. + public static bool operator ==(PrivateLinkServiceConnectionStateStatus left, PrivateLinkServiceConnectionStateStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PrivateLinkServiceConnectionStateStatus left, PrivateLinkServiceConnectionStateStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PrivateLinkServiceConnectionStateStatus(string value) => new PrivateLinkServiceConnectionStateStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PrivateLinkServiceConnectionStateStatus other && Equals(other); + /// + public bool Equals(PrivateLinkServiceConnectionStateStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProjectData.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProjectData.Serialization.cs new file mode 100644 index 000000000000..d78438e7ca68 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProjectData.Serialization.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure; +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + public partial class ProjectData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"); + writer.WriteStringValue(ETag.Value.ToString()); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Tags)) + { + writer.WritePropertyName("tags"); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Tags); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(Tags.ToString()).RootElement); +#endif + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"); + writer.WriteObjectValue(Properties); + } + writer.WriteEndObject(); + } + + internal static ProjectData DeserializeProjectData(JsonElement element) + { + Optional eTag = default; + Optional location = default; + Optional tags = default; + Optional properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("eTag")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + eTag = new ETag(property.Value.GetString()); + continue; + } + if (property.NameEquals("location")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + location = new Core.AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("tags")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + tags = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + properties = ProjectProperties.DeserializeProjectProperties(property.Value); + continue; + } + if (property.NameEquals("id")) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.ToString()); + continue; + } + } + return new ProjectData(id, name, type, systemData.Value, Optional.ToNullable(eTag), Optional.ToNullable(location), tags.Value, properties.Value); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProjectProperties.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProjectProperties.Serialization.cs new file mode 100644 index 000000000000..8e93a636ad77 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProjectProperties.Serialization.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 System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migrate; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class ProjectProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(AssessmentSolutionId)) + { + writer.WritePropertyName("assessmentSolutionId"); + writer.WriteStringValue(AssessmentSolutionId); + } + if (Optional.IsDefined(ProjectStatus)) + { + writer.WritePropertyName("projectStatus"); + writer.WriteStringValue(ProjectStatus.Value.ToString()); + } + if (Optional.IsDefined(CustomerWorkspaceId)) + { + writer.WritePropertyName("customerWorkspaceId"); + writer.WriteStringValue(CustomerWorkspaceId); + } + if (Optional.IsDefined(CustomerWorkspaceLocation)) + { + writer.WritePropertyName("customerWorkspaceLocation"); + writer.WriteStringValue(CustomerWorkspaceLocation); + } + if (Optional.IsDefined(PublicNetworkAccess)) + { + writer.WritePropertyName("publicNetworkAccess"); + writer.WriteStringValue(PublicNetworkAccess); + } + if (Optional.IsDefined(CustomerStorageAccountArmId)) + { + writer.WritePropertyName("customerStorageAccountArmId"); + writer.WriteStringValue(CustomerStorageAccountArmId); + } + writer.WriteEndObject(); + } + + internal static ProjectProperties DeserializeProjectProperties(JsonElement element) + { + Optional createdTimestamp = default; + Optional updatedTimestamp = default; + Optional serviceEndpoint = default; + Optional assessmentSolutionId = default; + Optional projectStatus = default; + Optional customerWorkspaceId = default; + Optional customerWorkspaceLocation = default; + Optional numberOfGroups = default; + Optional numberOfMachines = default; + Optional numberOfAssessments = default; + Optional lastAssessmentTimestamp = default; + Optional publicNetworkAccess = default; + Optional> privateEndpointConnections = default; + Optional customerStorageAccountArmId = default; + Optional provisioningState = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdTimestamp")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + createdTimestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("updatedTimestamp")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + updatedTimestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("serviceEndpoint")) + { + serviceEndpoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("assessmentSolutionId")) + { + assessmentSolutionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("projectStatus")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + projectStatus = new ProjectStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("customerWorkspaceId")) + { + customerWorkspaceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("customerWorkspaceLocation")) + { + customerWorkspaceLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("numberOfGroups")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + numberOfGroups = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("numberOfMachines")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + numberOfMachines = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("numberOfAssessments")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + numberOfAssessments = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("lastAssessmentTimestamp")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + lastAssessmentTimestamp = null; + continue; + } + lastAssessmentTimestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("publicNetworkAccess")) + { + publicNetworkAccess = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateEndpointConnections")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MigratePrivateEndpointConnectionData.DeserializeMigratePrivateEndpointConnectionData(item)); + } + privateEndpointConnections = array; + continue; + } + if (property.NameEquals("customerStorageAccountArmId")) + { + customerStorageAccountArmId = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + } + return new ProjectProperties(Optional.ToNullable(createdTimestamp), Optional.ToNullable(updatedTimestamp), serviceEndpoint.Value, assessmentSolutionId.Value, Optional.ToNullable(projectStatus), customerWorkspaceId.Value, customerWorkspaceLocation.Value, Optional.ToNullable(numberOfGroups), Optional.ToNullable(numberOfMachines), Optional.ToNullable(numberOfAssessments), Optional.ToNullable(lastAssessmentTimestamp), publicNetworkAccess.Value, Optional.ToList(privateEndpointConnections), customerStorageAccountArmId.Value, Optional.ToNullable(provisioningState)); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProjectProperties.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProjectProperties.cs new file mode 100644 index 000000000000..8506077abf70 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProjectProperties.cs @@ -0,0 +1,90 @@ +// 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.Migrate; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Properties of a project. + public partial class ProjectProperties + { + /// Initializes a new instance of ProjectProperties. + public ProjectProperties() + { + PrivateEndpointConnections = new ChangeTrackingList(); + } + + /// Initializes a new instance of ProjectProperties. + /// 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. + /// Number of groups created in the project. + /// Number of machines in the project. + /// Number of assessments created in the project. + /// Time when last assessment was created. Date-Time represented in ISO-8601 format. This value will be null until assessment is created. + /// 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. + /// Provisioning state of the project. + internal ProjectProperties(DateTimeOffset? createdTimestamp, DateTimeOffset? updatedTimestamp, string serviceEndpoint, string assessmentSolutionId, ProjectStatus? projectStatus, string customerWorkspaceId, string customerWorkspaceLocation, int? numberOfGroups, int? numberOfMachines, int? numberOfAssessments, DateTimeOffset? lastAssessmentTimestamp, string publicNetworkAccess, IReadOnlyList privateEndpointConnections, string customerStorageAccountArmId, ProvisioningState? provisioningState) + { + CreatedTimestamp = createdTimestamp; + UpdatedTimestamp = updatedTimestamp; + ServiceEndpoint = serviceEndpoint; + AssessmentSolutionId = assessmentSolutionId; + ProjectStatus = projectStatus; + CustomerWorkspaceId = customerWorkspaceId; + CustomerWorkspaceLocation = customerWorkspaceLocation; + NumberOfGroups = numberOfGroups; + NumberOfMachines = numberOfMachines; + NumberOfAssessments = numberOfAssessments; + LastAssessmentTimestamp = lastAssessmentTimestamp; + PublicNetworkAccess = publicNetworkAccess; + PrivateEndpointConnections = privateEndpointConnections; + CustomerStorageAccountArmId = customerStorageAccountArmId; + ProvisioningState = provisioningState; + } + + /// Time when this project was created. Date-Time represented in ISO-8601 format. + public DateTimeOffset? CreatedTimestamp { get; } + /// Time when this project was last updated. Date-Time represented in ISO-8601 format. + public DateTimeOffset? UpdatedTimestamp { 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 ProjectStatus? 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; } + /// Number of groups created in the project. + public int? NumberOfGroups { get; } + /// Number of machines in the project. + public int? NumberOfMachines { get; } + /// Number of assessments created in the project. + public int? NumberOfAssessments { get; } + /// Time when last assessment was created. Date-Time represented in ISO-8601 format. This value will be null until assessment is created. + public DateTimeOffset? LastAssessmentTimestamp { get; } + /// 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 string CustomerStorageAccountArmId { get; set; } + /// Provisioning state of the project. + public ProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProjectResultList.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProjectResultList.Serialization.cs new file mode 100644 index 000000000000..e88e84e8cf33 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProjectResultList.Serialization.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migrate; + +namespace Azure.ResourceManager.Migrate.Models +{ + internal partial class ProjectResultList + { + internal static ProjectResultList DeserializeProjectResultList(JsonElement element) + { + Optional> value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ProjectData.DeserializeProjectData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new ProjectResultList(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProjectResultList.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProjectResultList.cs new file mode 100644 index 000000000000..1b0aa43c34dd --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProjectResultList.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migrate; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// List of projects. + internal partial class ProjectResultList + { + /// Initializes a new instance of ProjectResultList. + internal ProjectResultList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of ProjectResultList. + /// List of projects. + /// + internal ProjectResultList(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// List of projects. + public IReadOnlyList Value { get; } + /// Gets the next link. + public string NextLink { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProjectStatus.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProjectStatus.cs new file mode 100644 index 000000000000..bcd10351024e --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProjectStatus.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.Migrate.Models +{ + /// Assessment project status. + public readonly partial struct ProjectStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProjectStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ActiveValue = "Active"; + private const string InactiveValue = "Inactive"; + + /// Active. + public static ProjectStatus Active { get; } = new ProjectStatus(ActiveValue); + /// Inactive. + public static ProjectStatus Inactive { get; } = new ProjectStatus(InactiveValue); + /// Determines if two values are the same. + public static bool operator ==(ProjectStatus left, ProjectStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProjectStatus left, ProjectStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ProjectStatus(string value) => new ProjectStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProjectStatus other && Equals(other); + /// + public bool Equals(ProjectStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProvisioningState.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 000000000000..5526befd0175 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProvisioningState.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.Migrate.Models +{ + /// Provisioning state of the project. + public readonly partial struct ProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AcceptedValue = "Accepted"; + private const string CreatingValue = "Creating"; + private const string DeletingValue = "Deleting"; + private const string FailedValue = "Failed"; + private const string MovingValue = "Moving"; + private const string SucceededValue = "Succeeded"; + + /// Accepted. + public static ProvisioningState Accepted { get; } = new ProvisioningState(AcceptedValue); + /// Creating. + public static ProvisioningState Creating { get; } = new ProvisioningState(CreatingValue); + /// Deleting. + public static ProvisioningState Deleting { get; } = new ProvisioningState(DeletingValue); + /// Failed. + public static ProvisioningState Failed { get; } = new ProvisioningState(FailedValue); + /// Moving. + public static ProvisioningState Moving { get; } = new ProvisioningState(MovingValue); + /// Succeeded. + public static ProvisioningState Succeeded { get; } = new ProvisioningState(SucceededValue); + /// Determines if two values are the same. + public static bool operator ==(ProvisioningState left, ProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProvisioningState left, ProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ProvisioningState(string value) => new ProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProvisioningState other && Equals(other); + /// + public bool Equals(ProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ReservedInstance.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ReservedInstance.cs new file mode 100644 index 000000000000..d3792c5dfbd0 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ReservedInstance.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.Migrate.Models +{ + /// Azure reserved instance. + public readonly partial struct ReservedInstance : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ReservedInstance(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 ReservedInstance None { get; } = new ReservedInstance(NoneValue); + /// RI1Year. + public static ReservedInstance RI1Year { get; } = new ReservedInstance(RI1YearValue); + /// RI3Year. + public static ReservedInstance RI3Year { get; } = new ReservedInstance(RI3YearValue); + /// Determines if two values are the same. + public static bool operator ==(ReservedInstance left, ReservedInstance right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ReservedInstance left, ReservedInstance right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ReservedInstance(string value) => new ReservedInstance(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ReservedInstance other && Equals(other); + /// + public bool Equals(ReservedInstance other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ServerCollectorData.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ServerCollectorData.Serialization.cs new file mode 100644 index 000000000000..9a0ecec3910a --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ServerCollectorData.Serialization.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + public partial class ServerCollectorData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"); + writer.WriteStringValue(ETag.Value.ToString()); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"); + writer.WriteObjectValue(Properties); + } + writer.WriteEndObject(); + } + + internal static ServerCollectorData DeserializeServerCollectorData(JsonElement element) + { + Optional eTag = default; + Optional properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("eTag")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + eTag = new ETag(property.Value.GetString()); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + properties = CollectorProperties.DeserializeCollectorProperties(property.Value); + continue; + } + if (property.NameEquals("id")) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.ToString()); + continue; + } + } + return new ServerCollectorData(id, name, type, systemData.Value, Optional.ToNullable(eTag), properties.Value); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ServerCollectorList.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ServerCollectorList.Serialization.cs new file mode 100644 index 000000000000..37dc80fd2d0b --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ServerCollectorList.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migrate; + +namespace Azure.ResourceManager.Migrate.Models +{ + internal partial class ServerCollectorList + { + internal static ServerCollectorList DeserializeServerCollectorList(JsonElement element) + { + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ServerCollectorData.DeserializeServerCollectorData(item)); + } + value = array; + continue; + } + } + return new ServerCollectorList(Optional.ToList(value)); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ServerCollectorList.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ServerCollectorList.cs new file mode 100644 index 000000000000..e73c5b8c1cb1 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ServerCollectorList.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migrate; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// List of Server collectors. + internal partial class ServerCollectorList + { + /// Initializes a new instance of ServerCollectorList. + internal ServerCollectorList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of ServerCollectorList. + /// List of Server collectors. + internal ServerCollectorList(IReadOnlyList value) + { + Value = value; + } + + /// List of Server collectors. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TimeRange.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TimeRange.cs new file mode 100644 index 000000000000..dfe5533524f8 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TimeRange.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.Migrate.Models +{ + /// Time range of performance data used to recommend a size. + public readonly partial struct TimeRange : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TimeRange(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 TimeRange Day { get; } = new TimeRange(DayValue); + /// Week. + public static TimeRange Week { get; } = new TimeRange(WeekValue); + /// Month. + public static TimeRange Month { get; } = new TimeRange(MonthValue); + /// Custom. + public static TimeRange Custom { get; } = new TimeRange(CustomValue); + /// Determines if two values are the same. + public static bool operator ==(TimeRange left, TimeRange right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TimeRange left, TimeRange right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator TimeRange(string value) => new TimeRange(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TimeRange other && Equals(other); + /// + public bool Equals(TimeRange other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/UpdateGroupBody.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/UpdateGroupBody.Serialization.cs new file mode 100644 index 000000000000..d5cdec38094a --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/UpdateGroupBody.Serialization.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class UpdateGroupBody : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"); + writer.WriteStringValue(ETag.Value.ToString()); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"); + writer.WriteObjectValue(Properties); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/UpdateGroupBody.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/UpdateGroupBody.cs new file mode 100644 index 000000000000..a1975452b9c8 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/UpdateGroupBody.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Properties of group update. + public partial class UpdateGroupBody + { + /// Initializes a new instance of UpdateGroupBody. + public UpdateGroupBody() + { + } + + /// For optimistic concurrency control. + public ETag? ETag { get; set; } + /// Properties of the group. + public GroupBodyProperties Properties { get; set; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/VMwareCollectorData.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/VMwareCollectorData.Serialization.cs new file mode 100644 index 000000000000..7e7296773f48 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/VMwareCollectorData.Serialization.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + public partial class VMwareCollectorData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"); + writer.WriteStringValue(ETag.Value.ToString()); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"); + writer.WriteObjectValue(Properties); + } + writer.WriteEndObject(); + } + + internal static VMwareCollectorData DeserializeVMwareCollectorData(JsonElement element) + { + Optional eTag = default; + Optional properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("eTag")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + eTag = new ETag(property.Value.GetString()); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + properties = CollectorProperties.DeserializeCollectorProperties(property.Value); + continue; + } + if (property.NameEquals("id")) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.ToString()); + continue; + } + } + return new VMwareCollectorData(id, name, type, systemData.Value, Optional.ToNullable(eTag), properties.Value); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/VMwareCollectorList.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/VMwareCollectorList.Serialization.cs new file mode 100644 index 000000000000..6f28d74b9e1b --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/VMwareCollectorList.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migrate; + +namespace Azure.ResourceManager.Migrate.Models +{ + internal partial class VMwareCollectorList + { + internal static VMwareCollectorList DeserializeVMwareCollectorList(JsonElement element) + { + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VMwareCollectorData.DeserializeVMwareCollectorData(item)); + } + value = array; + continue; + } + } + return new VMwareCollectorList(Optional.ToList(value)); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/VMwareCollectorList.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/VMwareCollectorList.cs new file mode 100644 index 000000000000..a77eb36379a4 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/VMwareCollectorList.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Migrate; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// List of VMware collectors. + internal partial class VMwareCollectorList + { + /// Initializes a new instance of VMwareCollectorList. + internal VMwareCollectorList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of VMwareCollectorList. + /// List of VMware collectors. + internal VMwareCollectorList(IReadOnlyList value) + { + Value = value; + } + + /// List of VMware collectors. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/VmFamily.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/VmFamily.Serialization.cs new file mode 100644 index 000000000000..c8bcf821e0ab --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/VmFamily.Serialization.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class VmFamily + { + internal static VmFamily DeserializeVmFamily(JsonElement element) + { + Optional familyName = default; + Optional> targetLocations = default; + Optional> category = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("familyName")) + { + familyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetLocations")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + targetLocations = array; + continue; + } + if (property.NameEquals("category")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + category = array; + continue; + } + } + return new VmFamily(familyName.Value, Optional.ToList(targetLocations), Optional.ToList(category)); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/VmFamily.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/VmFamily.cs new file mode 100644 index 000000000000..b6af2ad315d9 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/VmFamily.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// VM family name, the list of targeted azure locations and the category of the family. + public partial class VmFamily + { + /// Initializes a new instance of VmFamily. + internal VmFamily() + { + TargetLocations = new ChangeTrackingList(); + Category = new ChangeTrackingList(); + } + + /// Initializes a new instance of VmFamily. + /// Name of the VM family. + /// List of Azure regions. + /// Category of the VM family. + internal VmFamily(string familyName, IReadOnlyList targetLocations, IReadOnlyList category) + { + FamilyName = familyName; + TargetLocations = targetLocations; + Category = category; + } + + /// 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/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/VmUptime.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/VmUptime.Serialization.cs new file mode 100644 index 000000000000..f763b8255dc9 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/VmUptime.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class VmUptime : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(DaysPerMonth)) + { + writer.WritePropertyName("daysPerMonth"); + writer.WriteNumberValue(DaysPerMonth.Value); + } + if (Optional.IsDefined(HoursPerDay)) + { + writer.WritePropertyName("hoursPerDay"); + writer.WriteNumberValue(HoursPerDay.Value); + } + writer.WriteEndObject(); + } + + internal static VmUptime DeserializeVmUptime(JsonElement element) + { + Optional daysPerMonth = default; + Optional hoursPerDay = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("daysPerMonth")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + daysPerMonth = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("hoursPerDay")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + hoursPerDay = property.Value.GetInt32(); + continue; + } + } + return new VmUptime(Optional.ToNullable(daysPerMonth), Optional.ToNullable(hoursPerDay)); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/VmUptime.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/VmUptime.cs new file mode 100644 index 000000000000..612b39c8e073 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/VmUptime.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Migrate.Models +{ + /// The VmUptime. + public partial class VmUptime + { + /// Initializes a new instance of VmUptime. + public VmUptime() + { + } + + /// Initializes a new instance of VmUptime. + /// Number of days in a month for VM uptime. + /// Number of hours per day for VM uptime. + internal VmUptime(int? daysPerMonth, int? hoursPerDay) + { + DaysPerMonth = daysPerMonth; + HoursPerDay = hoursPerDay; + } + + /// 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/migrate/Azure.ResourceManager.Migrate/src/Generated/ProjectCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ProjectCollection.cs new file mode 100644 index 000000000000..43c925a6a5da --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ProjectCollection.cs @@ -0,0 +1,334 @@ +// 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.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// 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 GetProjects method from an instance of . + /// + public partial class ProjectCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _projectClientDiagnostics; + private readonly ProjectsRestOperations _projectRestClient; + + /// Initializes a new instance of the class for mocking. + protected ProjectCollection() + { + } + + /// 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 ProjectCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _projectClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", ProjectResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ProjectResource.ResourceType, out string projectApiVersion); + _projectRestClient = new ProjectsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, projectApiVersion); +#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 project with specified name. If a project already exists, update it. + /// Request Path: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// Operation Id: Projects_Create + /// + /// 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. + /// Name of the Azure Migrate project. + /// New or Updated project object. + /// 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, ProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _projectRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, projectName, data, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(Response.FromValue(new ProjectResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a project with specified name. If a project already exists, update it. + /// Request Path: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// Operation Id: Projects_Create + /// + /// 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. + /// Name of the Azure Migrate project. + /// New or Updated project object. + /// 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, ProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _projectRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, projectName, data, cancellationToken); + var operation = new MigrateArmOperation(Response.FromValue(new ProjectResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the project with the specified name. + /// Request Path: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// Operation Id: Projects_Get + /// + /// Name of the Azure Migrate project. + /// 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 = _projectClientDiagnostics.CreateScope("ProjectCollection.Get"); + scope.Start(); + try + { + var response = await _projectRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, projectName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ProjectResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the project with the specified name. + /// Request Path: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// Operation Id: Projects_Get + /// + /// Name of the Azure Migrate project. + /// 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 = _projectClientDiagnostics.CreateScope("ProjectCollection.Get"); + scope.Start(); + try + { + var response = _projectRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, projectName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ProjectResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get all the projects in the resource group. + /// Request Path: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects + /// Operation Id: Projects_List + /// + /// 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) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _projectClientDiagnostics.CreateScope("ProjectCollection.GetAll"); + scope.Start(); + try + { + var response = await _projectRestClient.ListAsync(Id.SubscriptionId, Id.ResourceGroupName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new ProjectResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _projectClientDiagnostics.CreateScope("ProjectCollection.GetAll"); + scope.Start(); + try + { + var response = await _projectRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new ProjectResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); + } + + /// + /// Get all the projects in the resource group. + /// Request Path: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects + /// Operation Id: Projects_List + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _projectClientDiagnostics.CreateScope("ProjectCollection.GetAll"); + scope.Start(); + try + { + var response = _projectRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new ProjectResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _projectClientDiagnostics.CreateScope("ProjectCollection.GetAll"); + scope.Start(); + try + { + var response = _projectRestClient.ListNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new ProjectResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); + } + + /// + /// Checks to see if the resource exists in azure. + /// Request Path: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// Operation Id: Projects_Get + /// + /// Name of the Azure Migrate project. + /// 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 = _projectClientDiagnostics.CreateScope("ProjectCollection.Exists"); + scope.Start(); + try + { + var response = await _projectRestClient.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: Projects_Get + /// + /// Name of the Azure Migrate project. + /// 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 = _projectClientDiagnostics.CreateScope("ProjectCollection.Exists"); + scope.Start(); + try + { + var response = _projectRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, projectName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, 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/migrate/Azure.ResourceManager.Migrate/src/Generated/ProjectData.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ProjectData.cs new file mode 100644 index 000000000000..7e229f59f4cc --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ProjectData.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + /// A class representing the Project data model. + public partial class ProjectData : ResourceData + { + /// Initializes a new instance of ProjectData. + public ProjectData() + { + } + + /// Initializes a new instance of ProjectData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// For optimistic concurrency control. + /// Azure location in which project is created. + /// Tags provided by Azure Tagging service. + /// Properties of the project. + internal ProjectData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ETag? eTag, Core.AzureLocation? location, BinaryData tags, ProjectProperties properties) : base(id, name, resourceType, systemData) + { + ETag = eTag; + Location = location; + Tags = tags; + Properties = properties; + } + + /// For optimistic concurrency control. + public ETag? ETag { get; set; } + /// Azure location in which project is created. + public Core.AzureLocation? Location { get; set; } + /// Tags provided by Azure Tagging service. + public BinaryData Tags { get; set; } + /// Properties of the project. + public ProjectProperties Properties { get; set; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ProjectResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ProjectResource.cs new file mode 100644 index 000000000000..e8f968801d20 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ProjectResource.cs @@ -0,0 +1,713 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// A Class representing a Project 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 GetProjectResource method. + /// Otherwise you can get one from its parent resource using the GetProject method. + /// + public partial class ProjectResource : ArmResource + { + /// Generate the resource identifier of a instance. + 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 _projectClientDiagnostics; + private readonly ProjectsRestOperations _projectRestClient; + private readonly ClientDiagnostics _assessmentClientDiagnostics; + private readonly AssessmentsRestOperations _assessmentRestClient; + private readonly ProjectData _data; + + /// Initializes a new instance of the class for mocking. + protected ProjectResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ProjectResource(ArmClient client, ProjectData 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 ProjectResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _projectClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string projectApiVersion); + _projectRestClient = new ProjectsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, projectApiVersion); + _assessmentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", AssessmentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AssessmentResource.ResourceType, out string assessmentApiVersion); + _assessmentRestClient = new AssessmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, assessmentApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects"; + + /// 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 ProjectData 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 MachineResources in the Project. + /// An object representing collection of MachineResources and their operations over a MachineResource. + public virtual MachineCollection GetMachines() + { + return GetCachedClient(Client => new MachineCollection(Client, Id)); + } + + /// + /// Get the machine with the specified name. Returns a json object of type 'machine' defined in Models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/machines/{machineName} + /// Operation Id: Machines_Get + /// + /// Unique name of a machine in private datacenter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetMachineAsync(string machineName, CancellationToken cancellationToken = default) + { + return await GetMachines().GetAsync(machineName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the machine with the specified name. Returns a json object of type 'machine' defined in Models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/machines/{machineName} + /// Operation Id: Machines_Get + /// + /// Unique name of a machine in private datacenter. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetMachine(string machineName, CancellationToken cancellationToken = default) + { + return GetMachines().Get(machineName, cancellationToken); + } + + /// Gets a collection of GroupResources in the Project. + /// An object representing collection of GroupResources and their operations over a GroupResource. + public virtual GroupCollection GetGroups() + { + return GetCachedClient(Client => new GroupCollection(Client, Id)); + } + + /// + /// Get information related to a specific group in the project. Returns a json object of type 'group' as specified in the models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// Operation Id: Groups_Get + /// + /// Unique name of a group within a project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetGroupAsync(string groupName, CancellationToken cancellationToken = default) + { + return await GetGroups().GetAsync(groupName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get information related to a specific group in the project. Returns a json object of type 'group' as specified in the models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/groups/{groupName} + /// Operation Id: Groups_Get + /// + /// Unique name of a group within a project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetGroup(string groupName, CancellationToken cancellationToken = default) + { + return GetGroups().Get(groupName, cancellationToken); + } + + /// Gets a collection of HyperVCollectorResources in the Project. + /// An object representing collection of HyperVCollectorResources and their operations over a HyperVCollectorResource. + public virtual HyperVCollectorCollection GetHyperVCollectors() + { + return GetCachedClient(Client => new HyperVCollectorCollection(Client, Id)); + } + + /// + /// Get a Hyper-V collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hyperVCollectorName} + /// Operation Id: HyperVCollectors_Get + /// + /// Unique name of a Hyper-V collector within a project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetHyperVCollectorAsync(string hyperVCollectorName, CancellationToken cancellationToken = default) + { + return await GetHyperVCollectors().GetAsync(hyperVCollectorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Hyper-V collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/hypervcollectors/{hyperVCollectorName} + /// Operation Id: HyperVCollectors_Get + /// + /// Unique name of a Hyper-V collector within a project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetHyperVCollector(string hyperVCollectorName, CancellationToken cancellationToken = default) + { + return GetHyperVCollectors().Get(hyperVCollectorName, cancellationToken); + } + + /// Gets a collection of ServerCollectorResources in the Project. + /// An object representing collection of ServerCollectorResources and their operations over a ServerCollectorResource. + public virtual ServerCollectorCollection GetServerCollectors() + { + return GetCachedClient(Client => new ServerCollectorCollection(Client, Id)); + } + + /// + /// Get a Server collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// Operation Id: ServerCollectors_Get + /// + /// Unique name of a Server collector within a project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetServerCollectorAsync(string serverCollectorName, CancellationToken cancellationToken = default) + { + return await GetServerCollectors().GetAsync(serverCollectorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Server collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// Operation Id: ServerCollectors_Get + /// + /// Unique name of a Server collector within a project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetServerCollector(string serverCollectorName, CancellationToken cancellationToken = default) + { + return GetServerCollectors().Get(serverCollectorName, cancellationToken); + } + + /// Gets a collection of VMwareCollectorResources in the Project. + /// An object representing collection of VMwareCollectorResources and their operations over a VMwareCollectorResource. + public virtual VMwareCollectorCollection GetVMwareCollectors() + { + return GetCachedClient(Client => new VMwareCollectorCollection(Client, Id)); + } + + /// + /// Get a VMware collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// Operation Id: VMwareCollectors_Get + /// + /// Unique name of a VMware collector within a project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetVMwareCollectorAsync(string vmWareCollectorName, CancellationToken cancellationToken = default) + { + return await GetVMwareCollectors().GetAsync(vmWareCollectorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a VMware collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// Operation Id: VMwareCollectors_Get + /// + /// Unique name of a VMware collector within a project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetVMwareCollector(string vmWareCollectorName, CancellationToken cancellationToken = default) + { + return GetVMwareCollectors().Get(vmWareCollectorName, cancellationToken); + } + + /// Gets a collection of ImportCollectorResources in the Project. + /// An object representing collection of ImportCollectorResources and their operations over a ImportCollectorResource. + public virtual ImportCollectorCollection GetImportCollectors() + { + return GetCachedClient(Client => new ImportCollectorCollection(Client, Id)); + } + + /// + /// Get a Import collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// Operation Id: ImportCollectors_Get + /// + /// Unique name of a Import collector within a project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetImportCollectorAsync(string importCollectorName, CancellationToken cancellationToken = default) + { + return await GetImportCollectors().GetAsync(importCollectorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Import collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/importcollectors/{importCollectorName} + /// Operation Id: ImportCollectors_Get + /// + /// Unique name of a Import collector within a project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetImportCollector(string importCollectorName, CancellationToken cancellationToken = default) + { + return GetImportCollectors().Get(importCollectorName, cancellationToken); + } + + /// Gets a collection of MigratePrivateEndpointConnectionResources in the Project. + /// An object representing collection of MigratePrivateEndpointConnectionResources and their operations over a MigratePrivateEndpointConnectionResource. + public virtual MigratePrivateEndpointConnectionCollection GetMigratePrivateEndpointConnections() + { + return GetCachedClient(Client => new MigratePrivateEndpointConnectionCollection(Client, Id)); + } + + /// + /// Get information related to a specific private endpoint connection in the project. Returns a json object of type 'privateEndpointConnections' as specified in the models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentprojects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// Operation Id: PrivateEndpointConnection_Get + /// + /// Unique name of a private endpoint connection within a project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetMigratePrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + return await GetMigratePrivateEndpointConnections().GetAsync(privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get information related to a specific private endpoint connection in the project. Returns a json object of type 'privateEndpointConnections' as specified in the models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentprojects/{projectName}/privateEndpointConnections/{privateEndpointConnectionName} + /// Operation Id: PrivateEndpointConnection_Get + /// + /// Unique name of a private endpoint connection within a project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetMigratePrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + return GetMigratePrivateEndpointConnections().Get(privateEndpointConnectionName, cancellationToken); + } + + /// Gets a collection of MigratePrivateLinkResources in the Project. + /// An object representing collection of MigratePrivateLinkResources and their operations over a MigratePrivateLinkResource. + public virtual MigratePrivateLinkResourceCollection GetMigratePrivateLinkResources() + { + return GetCachedClient(Client => new MigratePrivateLinkResourceCollection(Client, Id)); + } + + /// + /// Get information related to a specific private Link Resource in the project. Returns a json object of type 'privateLinkResources' as specified in the models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentprojects/{projectName}/privateLinkResources/{privateLinkResourceName} + /// Operation Id: PrivateLinkResource_Get + /// + /// Unique name of a private link resource within a project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetMigratePrivateLinkResourceAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + return await GetMigratePrivateLinkResources().GetAsync(privateLinkResourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get information related to a specific private Link Resource in the project. Returns a json object of type 'privateLinkResources' as specified in the models section. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentprojects/{projectName}/privateLinkResources/{privateLinkResourceName} + /// Operation Id: PrivateLinkResource_Get + /// + /// Unique name of a private link resource within a project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetMigratePrivateLinkResource(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + return GetMigratePrivateLinkResources().Get(privateLinkResourceName, cancellationToken); + } + + /// + /// Get the project with the specified name. + /// Request Path: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// Operation Id: Projects_Get + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _projectClientDiagnostics.CreateScope("ProjectResource.Get"); + scope.Start(); + try + { + var response = await _projectRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ProjectResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the project with the specified name. + /// Request Path: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// Operation Id: Projects_Get + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _projectClientDiagnostics.CreateScope("ProjectResource.Get"); + scope.Start(); + try + { + var response = _projectRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ProjectResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete the project. Deleting non-existent project is a no-operation. + /// Request Path: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// Operation Id: Projects_Delete + /// + /// 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 = _projectClientDiagnostics.CreateScope("ProjectResource.Delete"); + scope.Start(); + try + { + var response = await _projectRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(response); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete the project. Deleting non-existent project is a no-operation. + /// Request Path: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// Operation Id: Projects_Delete + /// + /// 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 = _projectClientDiagnostics.CreateScope("ProjectResource.Delete"); + scope.Start(); + try + { + var response = _projectRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new MigrateArmOperation(response); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a project with specified name. Supports partial updates, for example only tags can be provided. + /// Request Path: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// Operation Id: Projects_Update + /// + /// Updated project object. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(ProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectResource.Update"); + scope.Start(); + try + { + var response = await _projectRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ProjectResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a project with specified name. Supports partial updates, for example only tags can be provided. + /// Request Path: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName} + /// Operation Id: Projects_Update + /// + /// Updated project object. + /// The cancellation token to use. + /// is null. + public virtual Response Update(ProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectResource.Update"); + scope.Start(); + try + { + var response = _projectRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken); + return Response.FromValue(new ProjectResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get all available options for the properties of an assessment on a project. + /// Request Path: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessmentOptions/{assessmentOptionsName} + /// Operation Id: Projects_AssessmentOptions + /// + /// Name of the assessment options. The only name accepted in default. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> AssessmentOptionsAsync(string assessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentOptionsName, nameof(assessmentOptionsName)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectResource.AssessmentOptions"); + scope.Start(); + try + { + var response = await _projectRestClient.AssessmentOptionsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assessmentOptionsName, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get all available options for the properties of an assessment on a project. + /// Request Path: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessmentOptions/{assessmentOptionsName} + /// Operation Id: Projects_AssessmentOptions + /// + /// Name of the assessment options. The only name accepted in default. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response AssessmentOptions(string assessmentOptionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assessmentOptionsName, nameof(assessmentOptionsName)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectResource.AssessmentOptions"); + scope.Start(); + try + { + var response = _projectRestClient.AssessmentOptions(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, assessmentOptionsName, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets list of all available options for the properties of an assessment on a project. + /// Request Path: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessmentOptions + /// Operation Id: Projects_AssessmentOptionsList + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable AssessmentOptionsListAsync(CancellationToken cancellationToken = default) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _projectClientDiagnostics.CreateScope("ProjectResource.AssessmentOptionsList"); + scope.Start(); + try + { + var response = await _projectRestClient.AssessmentOptionsListAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// + /// Gets list of all available options for the properties of an assessment on a project. + /// Request Path: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessmentOptions + /// Operation Id: Projects_AssessmentOptionsList + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable AssessmentOptionsList(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _projectClientDiagnostics.CreateScope("ProjectResource.AssessmentOptionsList"); + scope.Start(); + try + { + var response = _projectRestClient.AssessmentOptionsList(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + + /// + /// Get all assessments created in the project. + /// + /// Returns a json array of objects of type 'assessment' as specified in Models section. + /// + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessments + /// Operation Id: Assessments_ListByProject + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAssessmentsAsync(CancellationToken cancellationToken = default) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _assessmentClientDiagnostics.CreateScope("ProjectResource.GetAssessments"); + scope.Start(); + try + { + var response = await _assessmentRestClient.ListByProjectAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new AssessmentResource(Client, value)), null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// + /// Get all assessments created in the project. + /// + /// Returns a json array of objects of type 'assessment' as specified in Models section. + /// + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessments + /// Operation Id: Assessments_ListByProject + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAssessments(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _assessmentClientDiagnostics.CreateScope("ProjectResource.GetAssessments"); + scope.Start(); + try + { + var response = _assessmentRestClient.ListByProject(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new AssessmentResource(Client, value)), null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ProviderConstants.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..276ea5df2712 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/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.Migrate +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/AssessedMachinesRestOperations.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/AssessedMachinesRestOperations.cs new file mode 100644 index 000000000000..247aae1d64c3 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/AssessedMachinesRestOperations.cs @@ -0,0 +1,339 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migrate.Models; + +namespace Azure.ResourceManager.Migrate +{ + 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 ?? "2019-10-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListByAssessmentRequest(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.AppendPath("/assessedMachines", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// + /// Get list of machines that assessed as part of the specified assessment. Returns a json array of objects of type 'assessedMachine' as specified in the Models section. + /// + /// Whenever an assessment is created or updated, it goes under computation. During this phase, the 'status' field of Assessment object reports 'Computing'. + /// During the period when the assessment is under computation, the list of assessed machines is empty and no assessed machines are returned by this call. + /// + /// + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a group within a project. + /// Unique name of an assessment within a project. + /// 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, 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); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessedMachineResultList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessedMachineResultList.DeserializeAssessedMachineResultList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// + /// Get list of machines that assessed as part of the specified assessment. Returns a json array of objects of type 'assessedMachine' as specified in the Models section. + /// + /// Whenever an assessment is created or updated, it goes under computation. During this phase, the 'status' field of Assessment object reports 'Computing'. + /// During the period when the assessment is under computation, the list of assessed machines is empty and no assessed machines are returned by this call. + /// + /// + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a group within a project. + /// Unique name of an assessment within a project. + /// 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, 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); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessedMachineResultList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessedMachineResultList.DeserializeAssessedMachineResultList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + 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 an assessed machine with its size & cost estimate that was evaluated in the specified assessment. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a group within a project. + /// Unique name of an assessment within a project. + /// Unique name of an assessed machine evaluated as part of an assessment. + /// 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 an assessed machine with its size & cost estimate that was evaluated in the specified assessment. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a group within a project. + /// Unique name of an assessment within a project. + /// Unique name of an assessed machine evaluated as part of an assessment. + /// 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 HttpMessage CreateListByAssessmentNextPageRequest(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; + } + + /// + /// Get list of machines that assessed as part of the specified assessment. Returns a json array of objects of type 'assessedMachine' as specified in the Models section. + /// + /// Whenever an assessment is created or updated, it goes under computation. During this phase, the 'status' field of Assessment object reports 'Computing'. + /// During the period when the assessment is under computation, the list of assessed machines is empty and no assessed machines are returned by this call. + /// + /// + /// The URL to the next page of results. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a group within a project. + /// Unique name of an assessment within a project. + /// 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, 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); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessedMachineResultList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessedMachineResultList.DeserializeAssessedMachineResultList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// + /// Get list of machines that assessed as part of the specified assessment. Returns a json array of objects of type 'assessedMachine' as specified in the Models section. + /// + /// Whenever an assessment is created or updated, it goes under computation. During this phase, the 'status' field of Assessment object reports 'Computing'. + /// During the period when the assessment is under computation, the list of assessed machines is empty and no assessed machines are returned by this call. + /// + /// + /// The URL to the next page of results. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a group within a project. + /// Unique name of an assessment within a project. + /// 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, 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); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessedMachineResultList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessedMachineResultList.DeserializeAssessedMachineResultList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/AssessmentsRestOperations.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/AssessmentsRestOperations.cs new file mode 100644 index 000000000000..096ec06130c2 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/AssessmentsRestOperations.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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migrate.Models; + +namespace Azure.ResourceManager.Migrate +{ + 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 ?? "2019-10-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + 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; + } + + /// + /// Get all assessments created for the specified group. + /// + /// Returns a json array of objects of type 'assessment' as specified in Models section. + /// + /// + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a group within a project. + /// 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: + { + AssessmentResultList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessmentResultList.DeserializeAssessmentResultList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// + /// Get all assessments created for the specified group. + /// + /// Returns a json array of objects of type 'assessment' as specified in Models section. + /// + /// + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a group within a project. + /// 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: + { + AssessmentResultList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessmentResultList.DeserializeAssessmentResultList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByProjectRequest(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("/assessments", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// + /// Get all assessments created in the project. + /// + /// Returns a json array of objects of type 'assessment' as specified in Models section. + /// + /// + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByProjectAsync(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 = CreateListByProjectRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessmentResultList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessmentResultList.DeserializeAssessmentResultList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// + /// Get all assessments created in the project. + /// + /// Returns a json array of objects of type 'assessment' as specified in Models section. + /// + /// + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByProject(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 = CreateListByProjectRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessmentResultList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessmentResultList.DeserializeAssessmentResultList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + 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 an existing assessment with the specified name. Returns a json object of type 'assessment' as specified in Models section. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a group within a project. + /// Unique name of an assessment within a project. + /// 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: + { + AssessmentData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessmentData.DeserializeAssessmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AssessmentData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get an existing assessment with the specified name. Returns a json object of type 'assessment' as specified in Models section. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a group within a project. + /// Unique name of an assessment within a project. + /// 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: + { + AssessmentData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessmentData.DeserializeAssessmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AssessmentData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName, AssessmentData 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); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// + /// Create a new assessment with the given name and the specified settings. Since name of an assessment in a project is a unique identifier, if an assessment with the name provided already exists, then the existing assessment is updated. + /// + /// Any PUT operation, resulting in either create or update on an assessment, will cause the assessment to go in a "InProgress" state. This will be indicated by the field 'computationState' on the Assessment object. During this time no other PUT operation will be allowed on that assessment object, nor will a Delete operation. Once the computation for the assessment is complete, the field 'computationState' will be updated to 'Ready', and then other PUT or DELETE operations can happen on the assessment. + /// + /// When assessment is under computation, any PUT will lead to a 400 - Bad Request error. + /// + /// + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a group within a project. + /// Unique name of an assessment within a project. + /// New or Updated Assessment object. + /// 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, AssessmentData 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: + { + AssessmentData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessmentData.DeserializeAssessmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// + /// Create a new assessment with the given name and the specified settings. Since name of an assessment in a project is a unique identifier, if an assessment with the name provided already exists, then the existing assessment is updated. + /// + /// Any PUT operation, resulting in either create or update on an assessment, will cause the assessment to go in a "InProgress" state. This will be indicated by the field 'computationState' on the Assessment object. During this time no other PUT operation will be allowed on that assessment object, nor will a Delete operation. Once the computation for the assessment is complete, the field 'computationState' will be updated to 'Ready', and then other PUT or DELETE operations can happen on the assessment. + /// + /// When assessment is under computation, any PUT will lead to a 400 - Bad Request error. + /// + /// + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a group within a project. + /// Unique name of an assessment within a project. + /// New or Updated Assessment object. + /// 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, AssessmentData 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: + { + AssessmentData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessmentData.DeserializeAssessmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + 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 an assessment from the project. The machines remain in the assessment. Deleting a non-existent assessment results in a no-operation. + /// + /// When an assessment is under computation, as indicated by the 'computationState' field, it cannot be deleted. Any such attempt will return a 400 - Bad Request. + /// + /// + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a group within a project. + /// Unique name of an assessment within a project. + /// 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 an assessment from the project. The machines remain in the assessment. Deleting a non-existent assessment results in a no-operation. + /// + /// When an assessment is under computation, as indicated by the 'computationState' field, it cannot be deleted. Any such attempt will return a 400 - Bad Request. + /// + /// + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a group within a project. + /// Unique name of an assessment within a project. + /// 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 HttpMessage CreateGetReportDownloadUrlRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, string assessmentName) + { + 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"); + _userAgent.Apply(message); + return message; + } + + /// Get the URL for downloading the assessment in a report format. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a group within a project. + /// Unique name of an assessment within a project. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetReportDownloadUrlAsync(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 = CreateGetReportDownloadUrlRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DownloadUri value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DownloadUri.DeserializeDownloadUri(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the URL for downloading the assessment in a report format. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a group within a project. + /// Unique name of an assessment within a project. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response GetReportDownloadUrl(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 = CreateGetReportDownloadUrlRequest(subscriptionId, resourceGroupName, projectName, groupName, assessmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DownloadUri value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DownloadUri.DeserializeDownloadUri(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/GroupsRestOperations.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/GroupsRestOperations.cs new file mode 100644 index 000000000000..456e56e67de9 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/GroupsRestOperations.cs @@ -0,0 +1,491 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migrate.Models; + +namespace Azure.ResourceManager.Migrate +{ + 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 ?? "2019-10-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListByProjectRequest(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; + } + + /// Get all groups created in the project. Returns a json array of objects of type 'group' as specified in the Models section. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByProjectAsync(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 = CreateListByProjectRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GroupResultList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = GroupResultList.DeserializeGroupResultList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all groups created in the project. Returns a json array of objects of type 'group' as specified in the Models section. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByProject(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 = CreateListByProjectRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GroupResultList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = GroupResultList.DeserializeGroupResultList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + 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 information related to a specific group in the project. Returns a json object of type 'group' as specified in the models section. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a group within a project. + /// 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: + { + GroupData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = GroupData.DeserializeGroupData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((GroupData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get information related to a specific group in the project. Returns a json object of type 'group' as specified in the models section. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a group within a project. + /// 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: + { + GroupData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = GroupData.DeserializeGroupData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((GroupData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, GroupData 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); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// + /// Create a new group by sending a json object of type 'group' as given in Models section as part of the Request Body. The group name in a project is unique. + /// + /// This operation is Idempotent. + /// + /// + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a group within a project. + /// New or Updated Group object. + /// 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, GroupData 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: + { + GroupData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = GroupData.DeserializeGroupData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// + /// Create a new group by sending a json object of type 'group' as given in Models section as part of the Request Body. The group name in a project is unique. + /// + /// This operation is Idempotent. + /// + /// + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a group within a project. + /// New or Updated Group object. + /// 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, GroupData 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: + { + GroupData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = GroupData.DeserializeGroupData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + 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 the group from the project. The machines remain in the project. Deleting a non-existent group results in a no-operation. + /// + /// A group is an aggregation mechanism for machines in a project. Therefore, deleting group does not delete machines in it. + /// + /// + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a group within a project. + /// 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 the group from the project. The machines remain in the project. Deleting a non-existent group results in a no-operation. + /// + /// A group is an aggregation mechanism for machines in a project. Therefore, deleting group does not delete machines in it. + /// + /// + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a group within a project. + /// 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 HttpMessage CreateUpdateMachinesRequest(string subscriptionId, string resourceGroupName, string projectName, string groupName, UpdateGroupBody groupUpdateProperties) + { + 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"); + if (groupUpdateProperties != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(groupUpdateProperties); + request.Content = content; + } + _userAgent.Apply(message); + return message; + } + + /// Update machines in group by adding or removing machines. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a group within a project. + /// Machines list to be added or removed from group. + /// 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, UpdateGroupBody groupUpdateProperties = null, 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 = CreateUpdateMachinesRequest(subscriptionId, resourceGroupName, projectName, groupName, groupUpdateProperties); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GroupData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = GroupData.DeserializeGroupData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update machines in group by adding or removing machines. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a group within a project. + /// Machines list to be added or removed from group. + /// 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, UpdateGroupBody groupUpdateProperties = null, 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 = CreateUpdateMachinesRequest(subscriptionId, resourceGroupName, projectName, groupName, groupUpdateProperties); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GroupData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = GroupData.DeserializeGroupData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/HyperVCollectorsRestOperations.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/HyperVCollectorsRestOperations.cs new file mode 100644 index 000000000000..8c8525622d87 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/HyperVCollectorsRestOperations.cs @@ -0,0 +1,377 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migrate.Models; + +namespace Azure.ResourceManager.Migrate +{ + 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 ?? "2019-10-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListByProjectRequest(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; + } + + /// Get a list of Hyper-V collector. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByProjectAsync(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 = CreateListByProjectRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HyperVCollectorList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HyperVCollectorList.DeserializeHyperVCollectorList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a list of Hyper-V collector. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByProject(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 = CreateListByProjectRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HyperVCollectorList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HyperVCollectorList.DeserializeHyperVCollectorList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + 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 Hyper-V collector. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a Hyper-V collector within a project. + /// 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: + { + HyperVCollectorData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HyperVCollectorData.DeserializeHyperVCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((HyperVCollectorData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a Hyper-V collector. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a Hyper-V collector within a project. + /// 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: + { + HyperVCollectorData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HyperVCollectorData.DeserializeHyperVCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((HyperVCollectorData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string projectName, string hyperVCollectorName, HyperVCollectorData 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); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or Update Hyper-V collector. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a Hyper-V collector within a project. + /// New or Updated Hyper-V collector. + /// 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, HyperVCollectorData 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: + { + HyperVCollectorData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HyperVCollectorData.DeserializeHyperVCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or Update Hyper-V collector. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a Hyper-V collector within a project. + /// New or Updated Hyper-V collector. + /// 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, HyperVCollectorData 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: + { + HyperVCollectorData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HyperVCollectorData.DeserializeHyperVCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + 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 Hyper-V collector from the project. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a Hyper-V collector within a project. + /// 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 Hyper-V collector from the project. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a Hyper-V collector within a project. + /// 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); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/ImportCollectorsRestOperations.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/ImportCollectorsRestOperations.cs new file mode 100644 index 000000000000..51098d108139 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/ImportCollectorsRestOperations.cs @@ -0,0 +1,377 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migrate.Models; + +namespace Azure.ResourceManager.Migrate +{ + 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 ?? "2019-10-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListByProjectRequest(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; + } + + /// Get a list of Import collector. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByProjectAsync(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 = CreateListByProjectRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ImportCollectorList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ImportCollectorList.DeserializeImportCollectorList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a list of Import collector. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByProject(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 = CreateListByProjectRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ImportCollectorList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ImportCollectorList.DeserializeImportCollectorList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + 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 Import collector. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a Import collector within a project. + /// 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: + { + ImportCollectorData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ImportCollectorData.DeserializeImportCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ImportCollectorData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a Import collector. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a Import collector within a project. + /// 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: + { + ImportCollectorData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ImportCollectorData.DeserializeImportCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ImportCollectorData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string projectName, string importCollectorName, ImportCollectorData 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); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or Update Import collector. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a Import collector within a project. + /// New or Updated Import collector. + /// 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, ImportCollectorData 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: + { + ImportCollectorData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ImportCollectorData.DeserializeImportCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or Update Import collector. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a Import collector within a project. + /// New or Updated Import collector. + /// 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, ImportCollectorData 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: + { + ImportCollectorData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ImportCollectorData.DeserializeImportCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + 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 Import collector from the project. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a Import collector within a project. + /// 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 Import collector from the project. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a Import collector within a project. + /// 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); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/MachinesRestOperations.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/MachinesRestOperations.cs new file mode 100644 index 000000000000..2c3dedcae8ca --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/MachinesRestOperations.cs @@ -0,0 +1,283 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migrate.Models; + +namespace Azure.ResourceManager.Migrate +{ + 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 ?? "2019-10-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListByProjectRequest(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("/machines", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get data of all the machines available in the project. Returns a json array of objects of type 'machine' defined in Models section. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByProjectAsync(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 = CreateListByProjectRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MachineResultList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MachineResultList.DeserializeMachineResultList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get data of all the machines available in the project. Returns a json array of objects of type 'machine' defined in Models section. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByProject(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 = CreateListByProjectRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MachineResultList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MachineResultList.DeserializeMachineResultList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + 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 the machine with the specified name. Returns a json object of type 'machine' defined in Models section. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a machine in private datacenter. + /// 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: + { + MachineData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MachineData.DeserializeMachineData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MachineData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the machine with the specified name. Returns a json object of type 'machine' defined in Models section. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a machine in private datacenter. + /// 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: + { + MachineData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MachineData.DeserializeMachineData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MachineData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByProjectNextPageRequest(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; + } + + /// Get data of all the machines available in the project. Returns a json array of objects of type 'machine' defined in Models section. + /// The URL to the next page of results. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByProjectNextPageAsync(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 = CreateListByProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MachineResultList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MachineResultList.DeserializeMachineResultList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get data of all the machines available in the project. Returns a json array of objects of type 'machine' defined in Models section. + /// The URL to the next page of results. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByProjectNextPage(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 = CreateListByProjectNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MachineResultList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MachineResultList.DeserializeMachineResultList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/PrivateEndpointConnectionRestOperations.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/PrivateEndpointConnectionRestOperations.cs new file mode 100644 index 000000000000..17aa68c51da6 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/PrivateEndpointConnectionRestOperations.cs @@ -0,0 +1,383 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migrate.Models; + +namespace Azure.ResourceManager.Migrate +{ + 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 ?? "2019-10-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListByProjectRequest(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; + } + + /// Get all private endpoint connections in the project. Returns a json array of objects of type 'privateEndpointConnections' as specified in the Models section. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByProjectAsync(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 = CreateListByProjectRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all private endpoint connections in the project. Returns a json array of objects of type 'privateEndpointConnections' as specified in the Models section. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByProject(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 = CreateListByProjectRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateEndpointConnectionCollection.DeserializePrivateEndpointConnectionCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + 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 information related to a specific private endpoint connection in the project. Returns a json object of type 'privateEndpointConnections' as specified in the models section. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a private endpoint connection within a project. + /// 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: + { + MigratePrivateEndpointConnectionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigratePrivateEndpointConnectionData.DeserializeMigratePrivateEndpointConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigratePrivateEndpointConnectionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get information related to a specific private endpoint connection in the project. Returns a json object of type 'privateEndpointConnections' as specified in the models section. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a private endpoint connection within a project. + /// 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: + { + MigratePrivateEndpointConnectionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigratePrivateEndpointConnectionData.DeserializeMigratePrivateEndpointConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigratePrivateEndpointConnectionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string projectName, string privateEndpointConnectionName, MigratePrivateEndpointConnectionData 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); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a specific private endpoint connection in the project. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a private endpoint connection within a project. + /// New or Updated Private Endpoint Connection object. + /// 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, MigratePrivateEndpointConnectionData 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 202: + { + MigratePrivateEndpointConnectionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigratePrivateEndpointConnectionData.DeserializeMigratePrivateEndpointConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a specific private endpoint connection in the project. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a private endpoint connection within a project. + /// New or Updated Private Endpoint Connection object. + /// 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, MigratePrivateEndpointConnectionData 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 202: + { + MigratePrivateEndpointConnectionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigratePrivateEndpointConnectionData.DeserializeMigratePrivateEndpointConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + 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 the private endpoint connection from the project. T. + /// + /// + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a private endpoint connection within a project. + /// 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 the private endpoint connection from the project. T. + /// + /// + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a private endpoint connection within a project. + /// 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); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/PrivateLinkResourceRestOperations.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/PrivateLinkResourceRestOperations.cs new file mode 100644 index 000000000000..5b23b72a95e3 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/PrivateLinkResourceRestOperations.cs @@ -0,0 +1,207 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migrate.Models; + +namespace Azure.ResourceManager.Migrate +{ + 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 ?? "2019-10-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + 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 information related to a specific private Link Resource in the project. Returns a json object of type 'privateLinkResources' as specified in the models section. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a private link resource within a project. + /// 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: + { + MigratePrivateLinkResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MigratePrivateLinkResourceData.DeserializeMigratePrivateLinkResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigratePrivateLinkResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get information related to a specific private Link Resource in the project. Returns a json object of type 'privateLinkResources' as specified in the models section. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a private link resource within a project. + /// 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: + { + MigratePrivateLinkResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MigratePrivateLinkResourceData.DeserializeMigratePrivateLinkResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MigratePrivateLinkResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByProjectRequest(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; + } + + /// Get all private link resources created in the project. Returns a json array of objects of type 'privateLinkResources' as specified in the Models section. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByProjectAsync(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 = CreateListByProjectRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateLinkResourceCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateLinkResourceCollection.DeserializePrivateLinkResourceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all private link resources created in the project. Returns a json array of objects of type 'privateLinkResources' as specified in the Models section. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByProject(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 = CreateListByProjectRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateLinkResourceCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateLinkResourceCollection.DeserializePrivateLinkResourceCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/ProjectsRestOperations.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/ProjectsRestOperations.cs new file mode 100644 index 000000000000..19e2673c1ad7 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/ProjectsRestOperations.cs @@ -0,0 +1,809 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migrate.Models; + +namespace Azure.ResourceManager.Migrate +{ + internal partial class ProjectsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ProjectsRestOperations. + /// 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 ProjectsRestOperations(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 ?? "2019-10-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + 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; + } + + /// Get all the projects in the subscription. + /// Azure Subscription Id in which project was created. + /// 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: + { + ProjectResultList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProjectResultList.DeserializeProjectResultList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all the projects in the subscription. + /// Azure Subscription Id in which project was created. + /// 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: + { + ProjectResultList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProjectResultList.DeserializeProjectResultList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRequest(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; + } + + /// Get all the projects in the resource group. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProjectResultList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProjectResultList.DeserializeProjectResultList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all the projects in the resource group. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProjectResultList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProjectResultList.DeserializeProjectResultList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + 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 the project with the specified name. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// 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: + { + ProjectData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProjectData.DeserializeProjectData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProjectData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the project with the specified name. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// 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: + { + ProjectData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProjectData.DeserializeProjectData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProjectData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string projectName, ProjectData 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); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a project with specified name. If a project already exists, update it. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// New or Updated project object. + /// 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, ProjectData 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: + { + ProjectData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProjectData.DeserializeProjectData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a project with specified name. If a project already exists, update it. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// New or Updated project object. + /// 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, ProjectData 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: + { + ProjectData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProjectData.DeserializeProjectData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string projectName, ProjectData data) + { + 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(data); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a project with specified name. Supports partial updates, for example only tags can be provided. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Updated project object. + /// 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, ProjectData 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 = CreateUpdateRequest(subscriptionId, resourceGroupName, projectName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProjectData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProjectData.DeserializeProjectData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a project with specified name. Supports partial updates, for example only tags can be provided. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Updated project object. + /// 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, ProjectData 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 = CreateUpdateRequest(subscriptionId, resourceGroupName, projectName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProjectData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProjectData.DeserializeProjectData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + 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 the project. Deleting non-existent project is a no-operation. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// 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 the project. Deleting non-existent project is a no-operation. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// 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 HttpMessage CreateAssessmentOptionsRequest(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 all available options for the properties of an assessment on a project. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Name of the assessment options. The only name accepted in default. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> AssessmentOptionsAsync(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 = CreateAssessmentOptionsRequest(subscriptionId, resourceGroupName, projectName, assessmentOptionsName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessmentOptions value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.AssessmentOptions.DeserializeAssessmentOptions(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all available options for the properties of an assessment on a project. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Name of the assessment options. The only name accepted in default. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response AssessmentOptions(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 = CreateAssessmentOptionsRequest(subscriptionId, resourceGroupName, projectName, assessmentOptionsName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessmentOptions value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.AssessmentOptions.DeserializeAssessmentOptions(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateAssessmentOptionsListRequest(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; + } + + /// Gets list of all available options for the properties of an assessment on a project. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> AssessmentOptionsListAsync(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 = CreateAssessmentOptionsListRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AssessmentOptionsResultList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssessmentOptionsResultList.DeserializeAssessmentOptionsResultList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets list of all available options for the properties of an assessment on a project. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response AssessmentOptionsList(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 = CreateAssessmentOptionsListRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AssessmentOptionsResultList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssessmentOptionsResultList.DeserializeAssessmentOptionsResultList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + 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; + } + + /// Get all the projects in the subscription. + /// The URL to the next page of results. + /// Azure Subscription Id in which project was created. + /// 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: + { + ProjectResultList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProjectResultList.DeserializeProjectResultList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all the projects in the subscription. + /// The URL to the next page of results. + /// Azure Subscription Id in which project was created. + /// 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: + { + ProjectResultList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProjectResultList.DeserializeProjectResultList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(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; + } + + /// Get all the projects in the resource group. + /// The URL to the next page of results. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(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 = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProjectResultList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProjectResultList.DeserializeProjectResultList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all the projects in the resource group. + /// The URL to the next page of results. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListNextPage(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 = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProjectResultList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProjectResultList.DeserializeProjectResultList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/ServerCollectorsRestOperations.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/ServerCollectorsRestOperations.cs new file mode 100644 index 000000000000..b34794ded028 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/ServerCollectorsRestOperations.cs @@ -0,0 +1,377 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migrate.Models; + +namespace Azure.ResourceManager.Migrate +{ + 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 ?? "2019-10-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListByProjectRequest(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; + } + + /// Get a list of Server collector. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByProjectAsync(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 = CreateListByProjectRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ServerCollectorList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ServerCollectorList.DeserializeServerCollectorList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a list of Server collector. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByProject(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 = CreateListByProjectRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ServerCollectorList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ServerCollectorList.DeserializeServerCollectorList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + 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 Server collector. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a Server collector within a project. + /// 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: + { + ServerCollectorData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ServerCollectorData.DeserializeServerCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ServerCollectorData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a Server collector. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a Server collector within a project. + /// 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: + { + ServerCollectorData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ServerCollectorData.DeserializeServerCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ServerCollectorData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string projectName, string serverCollectorName, ServerCollectorData 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); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or Update Server collector. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a Server collector within a project. + /// New or Updated Server collector. + /// 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, ServerCollectorData 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: + { + ServerCollectorData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ServerCollectorData.DeserializeServerCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or Update Server collector. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a Server collector within a project. + /// New or Updated Server collector. + /// 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, ServerCollectorData 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: + { + ServerCollectorData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ServerCollectorData.DeserializeServerCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + 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 Server collector from the project. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a Server collector within a project. + /// 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 Server collector from the project. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a Server collector within a project. + /// 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); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/VMwareCollectorsRestOperations.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/VMwareCollectorsRestOperations.cs new file mode 100644 index 000000000000..320341d98a9e --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/VMwareCollectorsRestOperations.cs @@ -0,0 +1,377 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migrate.Models; + +namespace Azure.ResourceManager.Migrate +{ + 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 ?? "2019-10-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListByProjectRequest(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; + } + + /// Get a list of VMware collector. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByProjectAsync(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 = CreateListByProjectRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VMwareCollectorList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VMwareCollectorList.DeserializeVMwareCollectorList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a list of VMware collector. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByProject(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 = CreateListByProjectRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VMwareCollectorList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VMwareCollectorList.DeserializeVMwareCollectorList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + 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 VMware collector. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a VMware collector within a project. + /// 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: + { + VMwareCollectorData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VMwareCollectorData.DeserializeVMwareCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((VMwareCollectorData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a VMware collector. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a VMware collector within a project. + /// 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: + { + VMwareCollectorData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VMwareCollectorData.DeserializeVMwareCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((VMwareCollectorData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string projectName, string vmWareCollectorName, VMwareCollectorData 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); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or Update VMware collector. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a VMware collector within a project. + /// New or Updated VMware collector. + /// 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, VMwareCollectorData 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: + { + VMwareCollectorData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VMwareCollectorData.DeserializeVMwareCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or Update VMware collector. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a VMware collector within a project. + /// New or Updated VMware collector. + /// 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, VMwareCollectorData 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: + { + VMwareCollectorData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VMwareCollectorData.DeserializeVMwareCollectorData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + 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 VMware collector from the project. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a VMware collector within a project. + /// 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 VMware collector from the project. + /// Azure Subscription Id in which project was created. + /// Name of the Azure Resource Group that project is part of. + /// Name of the Azure Migrate project. + /// Unique name of a VMware collector within a project. + /// 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); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ServerCollectorCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ServerCollectorCollection.cs new file mode 100644 index 000000000000..20cebd2848f8 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ServerCollectorCollection.cs @@ -0,0 +1,303 @@ +// 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.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// 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 GetServerCollectors method from an instance of . + /// + public partial class ServerCollectorCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _serverCollectorClientDiagnostics; + private readonly ServerCollectorsRestOperations _serverCollectorRestClient; + + /// Initializes a new instance of the class for mocking. + protected ServerCollectorCollection() + { + } + + /// 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 ServerCollectorCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _serverCollectorClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", ServerCollectorResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ServerCollectorResource.ResourceType, out string serverCollectorApiVersion); + _serverCollectorRestClient = new ServerCollectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, serverCollectorApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ProjectResource.ResourceType), nameof(id)); + } + + /// + /// Create or Update Server collector + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// Operation Id: ServerCollectors_Create + /// + /// 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. + /// Unique name of a Server collector within a project. + /// New or Updated Server collector. + /// 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, ServerCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(serverCollectorName, nameof(serverCollectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _serverCollectorClientDiagnostics.CreateScope("ServerCollectorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _serverCollectorRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverCollectorName, data, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(Response.FromValue(new ServerCollectorResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or Update Server collector + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// Operation Id: ServerCollectors_Create + /// + /// 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. + /// Unique name of a Server collector within a project. + /// New or Updated Server collector. + /// 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, ServerCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(serverCollectorName, nameof(serverCollectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _serverCollectorClientDiagnostics.CreateScope("ServerCollectorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _serverCollectorRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverCollectorName, data, cancellationToken); + var operation = new MigrateArmOperation(Response.FromValue(new ServerCollectorResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Server collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// Operation Id: ServerCollectors_Get + /// + /// Unique name of a Server collector within a project. + /// 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 = _serverCollectorClientDiagnostics.CreateScope("ServerCollectorCollection.Get"); + scope.Start(); + try + { + var response = await _serverCollectorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverCollectorName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServerCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Server collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// Operation Id: ServerCollectors_Get + /// + /// Unique name of a Server collector within a project. + /// 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 = _serverCollectorClientDiagnostics.CreateScope("ServerCollectorCollection.Get"); + scope.Start(); + try + { + var response = _serverCollectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, serverCollectorName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServerCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a list of Server collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors + /// Operation Id: ServerCollectors_ListByProject + /// + /// 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) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _serverCollectorClientDiagnostics.CreateScope("ServerCollectorCollection.GetAll"); + scope.Start(); + try + { + var response = await _serverCollectorRestClient.ListByProjectAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new ServerCollectorResource(Client, value)), null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// + /// Get a list of Server collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors + /// Operation Id: ServerCollectors_ListByProject + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _serverCollectorClientDiagnostics.CreateScope("ServerCollectorCollection.GetAll"); + scope.Start(); + try + { + var response = _serverCollectorRestClient.ListByProject(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new ServerCollectorResource(Client, value)), null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + + /// + /// Checks to see if the resource exists in azure. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// Operation Id: ServerCollectors_Get + /// + /// Unique name of a Server collector within a project. + /// 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 = _serverCollectorClientDiagnostics.CreateScope("ServerCollectorCollection.Exists"); + scope.Start(); + try + { + var response = await _serverCollectorRestClient.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: ServerCollectors_Get + /// + /// Unique name of a Server collector within a project. + /// 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 = _serverCollectorClientDiagnostics.CreateScope("ServerCollectorCollection.Exists"); + scope.Start(); + try + { + var response = _serverCollectorRestClient.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; + } + } + + 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/migrate/Azure.ResourceManager.Migrate/src/Generated/ServerCollectorData.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ServerCollectorData.cs new file mode 100644 index 000000000000..277c1d13900b --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ServerCollectorData.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure; +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + /// A class representing the ServerCollector data model. + public partial class ServerCollectorData : ResourceData + { + /// Initializes a new instance of ServerCollectorData. + public ServerCollectorData() + { + } + + /// Initializes a new instance of ServerCollectorData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// + internal ServerCollectorData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ETag? eTag, CollectorProperties properties) : base(id, name, resourceType, systemData) + { + ETag = eTag; + Properties = properties; + } + + /// Gets or sets the e tag. + public ETag? ETag { get; set; } + /// Gets or sets the properties. + public CollectorProperties Properties { get; set; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ServerCollectorResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ServerCollectorResource.cs new file mode 100644 index 000000000000..93e07d558046 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ServerCollectorResource.cs @@ -0,0 +1,249 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// A Class representing a ServerCollector 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 GetServerCollectorResource method. + /// Otherwise you can get one from its parent resource using the GetServerCollector method. + /// + public partial class ServerCollectorResource : ArmResource + { + /// Generate the resource identifier of a instance. + 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 _serverCollectorClientDiagnostics; + private readonly ServerCollectorsRestOperations _serverCollectorRestClient; + private readonly ServerCollectorData _data; + + /// Initializes a new instance of the class for mocking. + protected ServerCollectorResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ServerCollectorResource(ArmClient client, ServerCollectorData 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 ServerCollectorResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _serverCollectorClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string serverCollectorApiVersion); + _serverCollectorRestClient = new ServerCollectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, serverCollectorApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/servercollectors"; + + /// 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 ServerCollectorData 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 Server collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// Operation Id: ServerCollectors_Get + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _serverCollectorClientDiagnostics.CreateScope("ServerCollectorResource.Get"); + scope.Start(); + try + { + var response = await _serverCollectorRestClient.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 ServerCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Server collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// Operation Id: ServerCollectors_Get + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _serverCollectorClientDiagnostics.CreateScope("ServerCollectorResource.Get"); + scope.Start(); + try + { + var response = _serverCollectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ServerCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Server collector from the project. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// Operation Id: ServerCollectors_Delete + /// + /// 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 = _serverCollectorClientDiagnostics.CreateScope("ServerCollectorResource.Delete"); + scope.Start(); + try + { + var response = await _serverCollectorRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(response); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Server collector from the project. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// Operation Id: ServerCollectors_Delete + /// + /// 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 = _serverCollectorClientDiagnostics.CreateScope("ServerCollectorResource.Delete"); + scope.Start(); + try + { + var response = _serverCollectorRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MigrateArmOperation(response); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or Update Server collector + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// Operation Id: ServerCollectors_Create + /// + /// 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. + /// New or Updated Server collector. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ServerCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _serverCollectorClientDiagnostics.CreateScope("ServerCollectorResource.Update"); + scope.Start(); + try + { + var response = await _serverCollectorRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(Response.FromValue(new ServerCollectorResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or Update Server collector + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/servercollectors/{serverCollectorName} + /// Operation Id: ServerCollectors_Create + /// + /// 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. + /// New or Updated Server collector. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ServerCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _serverCollectorClientDiagnostics.CreateScope("ServerCollectorResource.Update"); + scope.Start(); + try + { + var response = _serverCollectorRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MigrateArmOperation(Response.FromValue(new ServerCollectorResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/VMwareCollectorCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/VMwareCollectorCollection.cs new file mode 100644 index 000000000000..283e63635c33 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/VMwareCollectorCollection.cs @@ -0,0 +1,303 @@ +// 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.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// 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 GetVMwareCollectors method from an instance of . + /// + public partial class VMwareCollectorCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _vMwareCollectorClientDiagnostics; + private readonly VMwareCollectorsRestOperations _vMwareCollectorRestClient; + + /// Initializes a new instance of the class for mocking. + protected VMwareCollectorCollection() + { + } + + /// 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 VMwareCollectorCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _vMwareCollectorClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", VMwareCollectorResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(VMwareCollectorResource.ResourceType, out string vMwareCollectorApiVersion); + _vMwareCollectorRestClient = new VMwareCollectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, vMwareCollectorApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ProjectResource.ResourceType), nameof(id)); + } + + /// + /// Create or Update VMware collector + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// Operation Id: VMwareCollectors_Create + /// + /// 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. + /// Unique name of a VMware collector within a project. + /// New or Updated VMware collector. + /// 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, VMwareCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vmWareCollectorName, nameof(vmWareCollectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _vMwareCollectorClientDiagnostics.CreateScope("VMwareCollectorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _vMwareCollectorRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, vmWareCollectorName, data, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(Response.FromValue(new VMwareCollectorResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or Update VMware collector + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// Operation Id: VMwareCollectors_Create + /// + /// 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. + /// Unique name of a VMware collector within a project. + /// New or Updated VMware collector. + /// 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, VMwareCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vmWareCollectorName, nameof(vmWareCollectorName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _vMwareCollectorClientDiagnostics.CreateScope("VMwareCollectorCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _vMwareCollectorRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, vmWareCollectorName, data, cancellationToken); + var operation = new MigrateArmOperation(Response.FromValue(new VMwareCollectorResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a VMware collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// Operation Id: VMwareCollectors_Get + /// + /// Unique name of a VMware collector within a project. + /// 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 = _vMwareCollectorClientDiagnostics.CreateScope("VMwareCollectorCollection.Get"); + scope.Start(); + try + { + var response = await _vMwareCollectorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, vmWareCollectorName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new VMwareCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a VMware collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// Operation Id: VMwareCollectors_Get + /// + /// Unique name of a VMware collector within a project. + /// 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 = _vMwareCollectorClientDiagnostics.CreateScope("VMwareCollectorCollection.Get"); + scope.Start(); + try + { + var response = _vMwareCollectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, vmWareCollectorName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new VMwareCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a list of VMware collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors + /// Operation Id: VMwareCollectors_ListByProject + /// + /// 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) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _vMwareCollectorClientDiagnostics.CreateScope("VMwareCollectorCollection.GetAll"); + scope.Start(); + try + { + var response = await _vMwareCollectorRestClient.ListByProjectAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new VMwareCollectorResource(Client, value)), null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// + /// Get a list of VMware collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors + /// Operation Id: VMwareCollectors_ListByProject + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _vMwareCollectorClientDiagnostics.CreateScope("VMwareCollectorCollection.GetAll"); + scope.Start(); + try + { + var response = _vMwareCollectorRestClient.ListByProject(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new VMwareCollectorResource(Client, value)), null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + + /// + /// Checks to see if the resource exists in azure. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// Operation Id: VMwareCollectors_Get + /// + /// Unique name of a VMware collector within a project. + /// 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 = _vMwareCollectorClientDiagnostics.CreateScope("VMwareCollectorCollection.Exists"); + scope.Start(); + try + { + var response = await _vMwareCollectorRestClient.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: VMwareCollectors_Get + /// + /// Unique name of a VMware collector within a project. + /// 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 = _vMwareCollectorClientDiagnostics.CreateScope("VMwareCollectorCollection.Exists"); + scope.Start(); + try + { + var response = _vMwareCollectorRestClient.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; + } + } + + 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/migrate/Azure.ResourceManager.Migrate/src/Generated/VMwareCollectorData.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/VMwareCollectorData.cs new file mode 100644 index 000000000000..7ad285261d1b --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/VMwareCollectorData.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure; +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + /// A class representing the VMwareCollector data model. + public partial class VMwareCollectorData : ResourceData + { + /// Initializes a new instance of VMwareCollectorData. + public VMwareCollectorData() + { + } + + /// Initializes a new instance of VMwareCollectorData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// + internal VMwareCollectorData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ETag? eTag, CollectorProperties properties) : base(id, name, resourceType, systemData) + { + ETag = eTag; + Properties = properties; + } + + /// Gets or sets the e tag. + public ETag? ETag { get; set; } + /// Gets or sets the properties. + public CollectorProperties Properties { get; set; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/VMwareCollectorResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/VMwareCollectorResource.cs new file mode 100644 index 000000000000..e1468ec4e846 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/VMwareCollectorResource.cs @@ -0,0 +1,249 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// A Class representing a VMwareCollector 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 GetVMwareCollectorResource method. + /// Otherwise you can get one from its parent resource using the GetVMwareCollector method. + /// + public partial class VMwareCollectorResource : ArmResource + { + /// Generate the resource identifier of a instance. + 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 _vMwareCollectorClientDiagnostics; + private readonly VMwareCollectorsRestOperations _vMwareCollectorRestClient; + private readonly VMwareCollectorData _data; + + /// Initializes a new instance of the class for mocking. + protected VMwareCollectorResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal VMwareCollectorResource(ArmClient client, VMwareCollectorData 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 VMwareCollectorResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _vMwareCollectorClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string vMwareCollectorApiVersion); + _vMwareCollectorRestClient = new VMwareCollectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, vMwareCollectorApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/vmwarecollectors"; + + /// 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 VMwareCollectorData 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 VMware collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// Operation Id: VMwareCollectors_Get + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _vMwareCollectorClientDiagnostics.CreateScope("VMwareCollectorResource.Get"); + scope.Start(); + try + { + var response = await _vMwareCollectorRestClient.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 VMwareCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a VMware collector. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// Operation Id: VMwareCollectors_Get + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _vMwareCollectorClientDiagnostics.CreateScope("VMwareCollectorResource.Get"); + scope.Start(); + try + { + var response = _vMwareCollectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new VMwareCollectorResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a VMware collector from the project. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// Operation Id: VMwareCollectors_Delete + /// + /// 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 = _vMwareCollectorClientDiagnostics.CreateScope("VMwareCollectorResource.Delete"); + scope.Start(); + try + { + var response = await _vMwareCollectorRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(response); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a VMware collector from the project. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// Operation Id: VMwareCollectors_Delete + /// + /// 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 = _vMwareCollectorClientDiagnostics.CreateScope("VMwareCollectorResource.Delete"); + scope.Start(); + try + { + var response = _vMwareCollectorRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MigrateArmOperation(response); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or Update VMware collector + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// Operation Id: VMwareCollectors_Create + /// + /// 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. + /// New or Updated VMware collector. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, VMwareCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _vMwareCollectorClientDiagnostics.CreateScope("VMwareCollectorResource.Update"); + scope.Start(); + try + { + var response = await _vMwareCollectorRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(Response.FromValue(new VMwareCollectorResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or Update VMware collector + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/vmwarecollectors/{vmWareCollectorName} + /// Operation Id: VMwareCollectors_Create + /// + /// 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. + /// New or Updated VMware collector. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, VMwareCollectorData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _vMwareCollectorClientDiagnostics.CreateScope("VMwareCollectorResource.Update"); + scope.Start(); + try + { + var response = _vMwareCollectorRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MigrateArmOperation(Response.FromValue(new VMwareCollectorResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Properties/AssemblyInfo.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..ba25bd9808ef --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/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("migrate")] + +[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] +[assembly: InternalsVisibleTo("Azure.ResourceManager.Migrate.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/autorest.md b/sdk/migrate/Azure.ResourceManager.Migrate/src/autorest.md new file mode 100644 index 000000000000..f17a23ee1469 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/autorest.md @@ -0,0 +1,50 @@ +# Generated code configuration + +Run `dotnet build /t:GenerateCode` to generate code. + +``` yaml + +azure-arm: true +csharp: true +library-name: migrate +namespace: Azure.ResourceManager.migrate +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/migrate/resource-manager/readme.md +output-folder: $(this-folder)/Generated +clear-output-folder: true +skip-csproj: true +modelerfour: + flatten-payloads: false + + + +format-by-name-rules: + 'tenantId': 'uuid' + 'ETag': 'etag' + 'location': 'azure-location' + '*Uri': 'Uri' + '*Uris': 'Uri' + +rename-rules: + CPU: Cpu + CPUs: Cpus + Os: OS + Ip: IP + Ips: IPs|ips + ID: Id + 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 + +``` diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/tests/Azure.ResourceManager.Migrate.Tests.csproj b/sdk/migrate/Azure.ResourceManager.Migrate/tests/Azure.ResourceManager.Migrate.Tests.csproj new file mode 100644 index 000000000000..9a1d129d3f4e --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/tests/Azure.ResourceManager.Migrate.Tests.csproj @@ -0,0 +1,5 @@ + + + + + diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/tests/migrateManagementTestBase.cs b/sdk/migrate/Azure.ResourceManager.Migrate/tests/migrateManagementTestBase.cs new file mode 100644 index 000000000000..2ff2b9854557 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/tests/migrateManagementTestBase.cs @@ -0,0 +1,41 @@ +// 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.Migrate.Tests +{ + public class migrateManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + + protected migrateManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected migrateManagementTestBase(bool isAsync) + : base(isAsync) + { + } + + [SetUp] + public void CreateCommonClient() + { + Client = GetArmClient(); + } + + 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/migrate/Azure.ResourceManager.Migrate/tests/migrateManagementTestEnvironment.cs b/sdk/migrate/Azure.ResourceManager.Migrate/tests/migrateManagementTestEnvironment.cs new file mode 100644 index 000000000000..ee8d7e3b107e --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/tests/migrateManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.Migrate.Tests +{ + public class migrateManagementTestEnvironment : TestEnvironment + { + } +} \ No newline at end of file