diff --git a/sdk/durabletask/ci.mgmt.yml b/sdk/durabletask/ci.mgmt.yml index 5f63204cd804..32b11e75b082 100644 --- a/sdk/durabletask/ci.mgmt.yml +++ b/sdk/durabletask/ci.mgmt.yml @@ -1,7 +1,6 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none - pr: branches: include: 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..495165badd49 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/Azure.ResourceManager.Migrate.sln @@ -0,0 +1,56 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager.Migrate.Samples", "samples\Azure.ResourceManager.Migrate.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.Migrate", "src\Azure.ResourceManager.Migrate.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.Migrate.Tests", "tests\Azure.ResourceManager.Migrate.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + 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..8b33f0fedccc --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes \ 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..63bd836ad44b --- /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..63c311d9cf81 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure Migrate management client library for .NET + +**[Describe the service briefly first.]** + +This library follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: + + - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET. + - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing. + - HTTP pipeline with custom policies. + - Better error-handling. + - Support uniform telemetry across all languages. + +## Getting started + +### Install the package + +Install the Microsoft Azure Migrate management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.Migrate --prerelease +``` + +### Prerequisites + +* You must have an [Microsoft Azure subscription](https://azure.microsoft.com/free/dotnet/). + +### Authenticate the Client + +To create an authenticated client and start interacting with Microsoft Azure resources, see the [quickstart guide here](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). + +## Key concepts + +Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html) + +## Documentation + +Documentation is available to help you learn how to use this package: + +- [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). +- [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). + +## Examples + +Code samples for using the management library for .NET can be found in the following locations +- [.NET Management Library Code Samples](https://aka.ms/azuresdk-net-mgmt-samples) + +## Troubleshooting + +- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues). +- Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags. + +## Next steps + +For more information about Microsoft Azure SDK, see [this website](https://azure.github.io/azure-sdk/). + +## Contributing + +For details on contributing to this repository, see the [contributing +guide][cg]. + +This project welcomes contributions and suggestions. Most contributions +require you to agree to a Contributor License Agreement (CLA) declaring +that you have the right to, and actually do, grant us the rights to use +your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine +whether you need to provide a CLA and decorate the PR appropriately +(for example, label, comment). Follow the instructions provided by the +bot. You'll only need to do this action once across all repositories +using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For +more information, see the [Code of Conduct FAQ][coc_faq] or contact + with any other questions or comments. + + +[cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/api/Azure.ResourceManager.Migrate.net8.0.cs b/sdk/migrate/Azure.ResourceManager.Migrate/api/Azure.ResourceManager.Migrate.net8.0.cs new file mode 100644 index 000000000000..2ca976931e2b --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/api/Azure.ResourceManager.Migrate.net8.0.cs @@ -0,0 +1,747 @@ +namespace Azure.ResourceManager.Migrate +{ + public partial class CompoundAssessmentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected CompoundAssessmentCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string compoundAssessmentName, Azure.ResourceManager.Migrate.CompoundAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string compoundAssessmentName, Azure.ResourceManager.Migrate.CompoundAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string compoundAssessmentName, 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 compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string compoundAssessmentName, 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 CompoundAssessmentData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CompoundAssessmentData() { } + public Azure.ResourceManager.Migrate.Models.CompoundAssessmentProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.CompoundAssessmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.CompoundAssessmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CompoundAssessmentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected CompoundAssessmentResource() { } + public virtual Azure.ResourceManager.Migrate.CompoundAssessmentData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation DownloadUrl(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.Models.DownloadUrlContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DownloadUrlAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.Models.DownloadUrlContent content, 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.Migrate.WebAppCompoundAssessmentSummaryCollection GetWebAppCompoundAssessmentSummaries() { throw null; } + public virtual Azure.Response GetWebAppCompoundAssessmentSummary(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWebAppCompoundAssessmentSummaryAsync(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Migrate.CompoundAssessmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.CompoundAssessmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.CompoundAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.CompoundAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class MigrateExtensions + { + public static Azure.Response GetCompoundAssessment(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string projectName, string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetCompoundAssessmentAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string projectName, string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Migrate.CompoundAssessmentResource GetCompoundAssessmentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migrate.CompoundAssessmentCollection GetCompoundAssessments(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string projectName) { throw null; } + public static Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryResource GetWebAppCompoundAssessmentSummaryResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class WebAppCompoundAssessmentSummaryCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected WebAppCompoundAssessmentSummaryCollection() { } + public virtual Azure.Response Exists(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class WebAppCompoundAssessmentSummaryData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WebAppCompoundAssessmentSummaryData() { } + public Azure.ResourceManager.Migrate.Models.WebAppCompoundAssessmentSummaryProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WebAppCompoundAssessmentSummaryResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected WebAppCompoundAssessmentSummaryResource() { } + public virtual Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, string summaryName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} +namespace Azure.ResourceManager.Migrate.Mocking +{ + public partial class MockableMigrateArmClient : Azure.ResourceManager.ArmResource + { + protected MockableMigrateArmClient() { } + public virtual Azure.ResourceManager.Migrate.CompoundAssessmentResource GetCompoundAssessmentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryResource GetWebAppCompoundAssessmentSummaryResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableMigrateResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableMigrateResourceGroupResource() { } + public virtual Azure.Response GetCompoundAssessment(string projectName, string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCompoundAssessmentAsync(string projectName, string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migrate.CompoundAssessmentCollection GetCompoundAssessments(string projectName) { throw null; } + } +} +namespace Azure.ResourceManager.Migrate.Models +{ + public static partial class ArmMigrateModelFactory + { + public static Azure.ResourceManager.Migrate.CompoundAssessmentData CompoundAssessmentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migrate.Models.CompoundAssessmentProperties properties = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.CompoundAssessmentDetails CompoundAssessmentDetails(System.DateTimeOffset? createdTimestamp = default(System.DateTimeOffset?), System.DateTimeOffset? updatedTimestamp = default(System.DateTimeOffset?), Azure.ResourceManager.Migrate.Models.AssessmentStatus status = default(Azure.ResourceManager.Migrate.Models.AssessmentStatus)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.CompoundAssessmentProperties CompoundAssessmentProperties(Azure.ResourceManager.Migrate.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.Migrate.Models.ProvisioningState?), Azure.ResourceManager.Migrate.Models.TargetAssessmentArmIds targetAssessmentArmIds = null, string fallbackMachineAssessmentArmId = null, Azure.ResourceManager.Migrate.Models.CompoundAssessmentDetails details = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.CostDetailsCommon CostDetailsCommon(Azure.ResourceManager.Migrate.Models.SavingsOption? savingOptions = default(Azure.ResourceManager.Migrate.Models.SavingsOption?), System.Collections.Generic.IEnumerable costDetail = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.DiscoveredLightSummary DiscoveredLightSummary(int numberOfWebApps = 0, System.Collections.Generic.IEnumerable numberOfWebAppsPerType = null, System.Collections.Generic.IEnumerable numberOfWebServersPerType = null, int numberOfWebServers = 0, int numberOfServers = 0) { throw null; } + public static Azure.ResourceManager.Migrate.Models.DownloadUri DownloadUri(string assessmentReportUri = null, System.DateTimeOffset expireOn = default(System.DateTimeOffset)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.ManagementDetails ManagementDetails(Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType? name = default(Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType?), System.Collections.Generic.IEnumerable readinessSummary = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.MigrationDetails MigrationDetails(System.Collections.Generic.IEnumerable readinessSummary = null, Azure.ResourceManager.Migrate.Models.MigrationType? migrationType = default(Azure.ResourceManager.Migrate.Models.MigrationType?)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.NameValuePairCloudSuitabilityCommon NameValuePairCloudSuitabilityCommon(Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon? name = default(Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon?), int? value = default(int?)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.NameValuePairCostType NameValuePairCostType(Azure.ResourceManager.Migrate.Models.CostType? name = default(Azure.ResourceManager.Migrate.Models.CostType?), float? value = default(float?)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.NameValuePairSavingsType NameValuePairSavingsType(Azure.ResourceManager.Migrate.Models.SavingsType? name = default(Azure.ResourceManager.Migrate.Models.SavingsType?), float? value = default(float?)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.SavingsDetailsCommon SavingsDetailsCommon(Azure.ResourceManager.Migrate.Models.SavingsOption? savingOptions = default(Azure.ResourceManager.Migrate.Models.SavingsOption?), System.Collections.Generic.IEnumerable savingsDetail = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.SourceDetails SourceDetails(Azure.ResourceManager.Migrate.Models.AssessmentSource? sourceName = default(Azure.ResourceManager.Migrate.Models.AssessmentSource?), Azure.ResourceManager.Migrate.Models.MigrateWorkloadType? sourceType = default(Azure.ResourceManager.Migrate.Models.MigrateWorkloadType?), Azure.ResourceManager.Migrate.Models.MigrationPlatform? platform = default(Azure.ResourceManager.Migrate.Models.MigrationPlatform?), int? count = default(int?)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.TargetDetails TargetDetails(Azure.ResourceManager.Migrate.Models.AzureTarget? targetName = default(Azure.ResourceManager.Migrate.Models.AzureTarget?), Azure.ResourceManager.Migrate.Models.MigrateWorkloadType? targetType = default(Azure.ResourceManager.Migrate.Models.MigrateWorkloadType?), Azure.ResourceManager.Migrate.Models.MigrationPlatform? platform = default(Azure.ResourceManager.Migrate.Models.MigrationPlatform?), int? count = default(int?)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.TargetSourcePair TargetSourcePair(Azure.ResourceManager.Migrate.Models.AssessmentSource? sourceRef = default(Azure.ResourceManager.Migrate.Models.AssessmentSource?), Azure.ResourceManager.Migrate.Models.AzureTarget? targetRef = default(Azure.ResourceManager.Migrate.Models.AzureTarget?), int? sourceCount = default(int?), int? targetCount = default(int?), Azure.ResourceManager.Migrate.Models.MigrationDetails migrationDetails = null, System.Collections.Generic.IEnumerable managementDetails = null, System.Collections.Generic.IEnumerable costDetails = null, System.Collections.Generic.IEnumerable savingsDetails = null, double? confidenceScore = default(double?)) { throw null; } + public static Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryData WebAppCompoundAssessmentSummaryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migrate.Models.WebAppCompoundAssessmentSummaryProperties properties = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.WebAppCompoundAssessmentSummaryProperties WebAppCompoundAssessmentSummaryProperties(Azure.ResourceManager.Migrate.Models.SummaryType? summaryType = default(Azure.ResourceManager.Migrate.Models.SummaryType?), string summaryName = null, System.Collections.Generic.IEnumerable sources = null, System.Collections.Generic.IEnumerable targets = null, System.Collections.Generic.IEnumerable targetSourceMapping = null, System.Collections.Generic.IEnumerable costComponents = null, System.Collections.Generic.IEnumerable savingsComponents = null, string assessmentName = null, Azure.ResourceManager.Migrate.Models.DiscoveredLightSummary discoveredLightSummary = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.WebAppsPerType WebAppsPerType(Azure.ResourceManager.Migrate.Models.WebAppType webAppType = default(Azure.ResourceManager.Migrate.Models.WebAppType), int count = 0) { throw null; } + public static Azure.ResourceManager.Migrate.Models.WebServersPerType WebServersPerType(Azure.ResourceManager.Migrate.Models.WebServerType webServerType = default(Azure.ResourceManager.Migrate.Models.WebServerType), int count = 0) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AssessmentSource : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AssessmentSource(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource IIS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource Machine { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource MySQLServer { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource OracleDatabase { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource OracleServer { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource SAPInstance { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource SpringbootApplication { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource SqlDatabase { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource SqlInstance { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource TomCat { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource Unknown { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource WebApps { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.AssessmentSource 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.AssessmentSource left, Azure.ResourceManager.Migrate.Models.AssessmentSource right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AssessmentSource (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AssessmentSource left, Azure.ResourceManager.Migrate.Models.AssessmentSource 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 Deleted { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus Failed { 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 AzureManagementOfferingType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureManagementOfferingType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType AUM { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType AzMon { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType AzureBackup { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType No { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType SCOMMI { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType 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.AzureManagementOfferingType left, Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType left, Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureTarget : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureTarget(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.AzureTarget AKS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget Avs { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget AzureAppService { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget AzureAppServiceContainer { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget AzureSpringApps { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget AzureSQLVM { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget AzureVm { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget FlexServerPG { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget MySQLAzureFlexServer { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget OracleIaasVm { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget SAPAzureInstance { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget SqlDatabase { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget SqlMI { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.AzureTarget 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.AzureTarget left, Azure.ResourceManager.Migrate.Models.AzureTarget right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AzureTarget (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AzureTarget left, Azure.ResourceManager.Migrate.Models.AzureTarget right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CloudSuitabilityCommon : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CloudSuitabilityCommon(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon ConditionallySuitable { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon NotSuitable { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon ReadinessUnknown { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon Suitable { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon SuitableWithWarnings { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon 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.CloudSuitabilityCommon left, Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon left, Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CompoundAssessmentDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CompoundAssessmentDetails() { } + public System.DateTimeOffset? CreatedTimestamp { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AssessmentStatus Status { get { throw null; } } + public System.DateTimeOffset? UpdatedTimestamp { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.CompoundAssessmentDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.CompoundAssessmentDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CompoundAssessmentProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CompoundAssessmentProperties(Azure.ResourceManager.Migrate.Models.TargetAssessmentArmIds targetAssessmentArmIds) { } + public Azure.ResourceManager.Migrate.Models.CompoundAssessmentDetails Details { get { throw null; } } + public string FallbackMachineAssessmentArmId { get { throw null; } set { } } + public Azure.ResourceManager.Migrate.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.TargetAssessmentArmIds TargetAssessmentArmIds { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.CompoundAssessmentProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.CompoundAssessmentProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CostDetailsCommon : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CostDetailsCommon() { } + public System.Collections.Generic.IReadOnlyList CostDetail { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.SavingsOption? SavingOptions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.CostDetailsCommon System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.CostDetailsCommon System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CostType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CostType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.CostType DataProtectionService { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonitoringService { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyAvsExternalStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyAvsNetworkCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyAvsNodeCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyAzureHybridCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyBandwidthCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyComputeCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyLicensingCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyLinuxAzureHybridCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyManagementCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyPremiumStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyPremiumV2StorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlySecurityCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyStandardHddStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyStandardSsdStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyUltraDiskCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyUltraStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType PatchingService { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType TotalMonthlyCost { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.CostType 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.CostType left, Azure.ResourceManager.Migrate.Models.CostType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.CostType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.CostType left, Azure.ResourceManager.Migrate.Models.CostType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DiscoveredLightSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DiscoveredLightSummary() { } + public int NumberOfServers { get { throw null; } } + public int NumberOfWebApps { get { throw null; } } + public System.Collections.Generic.IReadOnlyList NumberOfWebAppsPerType { get { throw null; } } + public int NumberOfWebServers { get { throw null; } } + public System.Collections.Generic.IReadOnlyList NumberOfWebServersPerType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.DiscoveredLightSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.DiscoveredLightSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DownloadUri : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DownloadUri() { } + public string AssessmentReportUri { get { throw null; } } + public System.DateTimeOffset ExpireOn { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.DownloadUri System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.DownloadUri System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DownloadUrlContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DownloadUrlContent() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.DownloadUrlContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.DownloadUrlContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ManagementDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ManagementDetails() { } + public Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType? Name { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ReadinessSummary { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.ManagementDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.ManagementDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrateWorkloadType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrateWorkloadType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType Database { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType Host { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType Instance { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType Machine { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType ManagementServer { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType Server { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType Unknown { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType WebApplication { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType WebServer { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.MigrateWorkloadType 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.MigrateWorkloadType left, Azure.ResourceManager.Migrate.Models.MigrateWorkloadType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.MigrateWorkloadType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.MigrateWorkloadType left, Azure.ResourceManager.Migrate.Models.MigrateWorkloadType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MigrationDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MigrationDetails() { } + public Azure.ResourceManager.Migrate.Models.MigrationType? MigrationType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ReadinessSummary { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.MigrationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.MigrationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationPlatform : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationPlatform(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.MigrationPlatform IaaS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationPlatform PaaS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationPlatform SaaS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationPlatform Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.MigrationPlatform 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.MigrationPlatform left, Azure.ResourceManager.Migrate.Models.MigrationPlatform right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.MigrationPlatform (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.MigrationPlatform left, Azure.ResourceManager.Migrate.Models.MigrationPlatform right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.MigrationType Rearchitect { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationType Rehost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationType Replatform { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationType Retain { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.MigrationType 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.MigrationType left, Azure.ResourceManager.Migrate.Models.MigrationType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.MigrationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.MigrationType left, Azure.ResourceManager.Migrate.Models.MigrationType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class NameValuePairCloudSuitabilityCommon : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NameValuePairCloudSuitabilityCommon() { } + public Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon? Name { get { throw null; } } + public int? Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.NameValuePairCloudSuitabilityCommon System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.NameValuePairCloudSuitabilityCommon System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NameValuePairCostType : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NameValuePairCostType() { } + public Azure.ResourceManager.Migrate.Models.CostType? Name { get { throw null; } } + public float? Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.NameValuePairCostType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.NameValuePairCostType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NameValuePairSavingsType : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NameValuePairSavingsType() { } + public Azure.ResourceManager.Migrate.Models.SavingsType? Name { get { throw null; } } + public float? Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.NameValuePairSavingsType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.NameValuePairSavingsType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct 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 Canceled { 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 Provisioning { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.ProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.ProvisioningState Updating { 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; } + } + public partial class SavingsDetailsCommon : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SavingsDetailsCommon() { } + public Azure.ResourceManager.Migrate.Models.SavingsOption? SavingOptions { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SavingsDetail { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.SavingsDetailsCommon System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.SavingsDetailsCommon System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SavingsOption : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SavingsOption(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.SavingsOption CustomAzureOfferCode { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsOption None { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsOption RI1Year { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsOption RI3Year { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsOption SavingsPlan1Year { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsOption SavingsPlan3Year { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.SavingsOption 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.SavingsOption left, Azure.ResourceManager.Migrate.Models.SavingsOption right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.SavingsOption (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.SavingsOption left, Azure.ResourceManager.Migrate.Models.SavingsOption right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SavingsType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SavingsType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.SavingsType MonthlyAhubSqlCostSavings { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsType MonthlyAzureHybridCostSavings { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsType MonthlyLinuxAzureHybridCostSavings { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsType MonthlyVcfByolCostDifference { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.SavingsType 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.SavingsType left, Azure.ResourceManager.Migrate.Models.SavingsType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.SavingsType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.SavingsType left, Azure.ResourceManager.Migrate.Models.SavingsType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SourceDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SourceDetails() { } + public int? Count { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.MigrationPlatform? Platform { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AssessmentSource? SourceName { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.MigrateWorkloadType? SourceType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.SourceDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.SourceDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SummaryType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SummaryType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.SummaryType Strategy { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SummaryType Target { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SummaryType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.SummaryType 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.SummaryType left, Azure.ResourceManager.Migrate.Models.SummaryType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.SummaryType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.SummaryType left, Azure.ResourceManager.Migrate.Models.SummaryType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class TargetAssessmentArmIds : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TargetAssessmentArmIds() { } + public string Aks { get { throw null; } set { } } + public string AzureAppService { get { throw null; } set { } } + public string AzureAppServiceContainer { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.TargetAssessmentArmIds System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.TargetAssessmentArmIds System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TargetDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TargetDetails() { } + public int? Count { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.MigrationPlatform? Platform { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AzureTarget? TargetName { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.MigrateWorkloadType? TargetType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.TargetDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.TargetDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TargetSourcePair : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TargetSourcePair() { } + public double? ConfidenceScore { get { throw null; } } + public System.Collections.Generic.IReadOnlyList CostDetails { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ManagementDetails { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.MigrationDetails MigrationDetails { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SavingsDetails { get { throw null; } } + public int? SourceCount { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AssessmentSource? SourceRef { get { throw null; } } + public int? TargetCount { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AzureTarget? TargetRef { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.TargetSourcePair System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.TargetSourcePair System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WebAppCompoundAssessmentSummaryProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WebAppCompoundAssessmentSummaryProperties() { } + public string AssessmentName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList CostComponents { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.DiscoveredLightSummary DiscoveredLightSummary { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SavingsComponents { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Sources { get { throw null; } } + public string SummaryName { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.SummaryType? SummaryType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Targets { get { throw null; } } + public System.Collections.Generic.IReadOnlyList TargetSourceMapping { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.WebAppCompoundAssessmentSummaryProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.WebAppCompoundAssessmentSummaryProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WebAppsPerType : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WebAppsPerType() { } + public int Count { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.WebAppType WebAppType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.WebAppsPerType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.WebAppsPerType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct WebAppType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public WebAppType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.WebAppType ASPNET { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.WebAppType Java { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.WebAppType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.WebAppType 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.WebAppType left, Azure.ResourceManager.Migrate.Models.WebAppType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.WebAppType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.WebAppType left, Azure.ResourceManager.Migrate.Models.WebAppType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class WebServersPerType : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WebServersPerType() { } + public int Count { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.WebServerType WebServerType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.WebServersPerType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.WebServersPerType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct WebServerType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public WebServerType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.WebServerType IIS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.WebServerType Tomcat { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.WebServerType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.WebServerType 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.WebServerType left, Azure.ResourceManager.Migrate.Models.WebServerType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.WebServerType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.WebServerType left, Azure.ResourceManager.Migrate.Models.WebServerType right) { throw null; } + public override string ToString() { throw null; } + } +} 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..2ca976931e2b --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/api/Azure.ResourceManager.Migrate.netstandard2.0.cs @@ -0,0 +1,747 @@ +namespace Azure.ResourceManager.Migrate +{ + public partial class CompoundAssessmentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected CompoundAssessmentCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string compoundAssessmentName, Azure.ResourceManager.Migrate.CompoundAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string compoundAssessmentName, Azure.ResourceManager.Migrate.CompoundAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string compoundAssessmentName, 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 compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string compoundAssessmentName, 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 CompoundAssessmentData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CompoundAssessmentData() { } + public Azure.ResourceManager.Migrate.Models.CompoundAssessmentProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.CompoundAssessmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.CompoundAssessmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CompoundAssessmentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected CompoundAssessmentResource() { } + public virtual Azure.ResourceManager.Migrate.CompoundAssessmentData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation DownloadUrl(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.Models.DownloadUrlContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DownloadUrlAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.Models.DownloadUrlContent content, 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.Migrate.WebAppCompoundAssessmentSummaryCollection GetWebAppCompoundAssessmentSummaries() { throw null; } + public virtual Azure.Response GetWebAppCompoundAssessmentSummary(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWebAppCompoundAssessmentSummaryAsync(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Migrate.CompoundAssessmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.CompoundAssessmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.CompoundAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.CompoundAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class MigrateExtensions + { + public static Azure.Response GetCompoundAssessment(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string projectName, string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetCompoundAssessmentAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string projectName, string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Migrate.CompoundAssessmentResource GetCompoundAssessmentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migrate.CompoundAssessmentCollection GetCompoundAssessments(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string projectName) { throw null; } + public static Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryResource GetWebAppCompoundAssessmentSummaryResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class WebAppCompoundAssessmentSummaryCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected WebAppCompoundAssessmentSummaryCollection() { } + public virtual Azure.Response Exists(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class WebAppCompoundAssessmentSummaryData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WebAppCompoundAssessmentSummaryData() { } + public Azure.ResourceManager.Migrate.Models.WebAppCompoundAssessmentSummaryProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WebAppCompoundAssessmentSummaryResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected WebAppCompoundAssessmentSummaryResource() { } + public virtual Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, string summaryName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} +namespace Azure.ResourceManager.Migrate.Mocking +{ + public partial class MockableMigrateArmClient : Azure.ResourceManager.ArmResource + { + protected MockableMigrateArmClient() { } + public virtual Azure.ResourceManager.Migrate.CompoundAssessmentResource GetCompoundAssessmentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryResource GetWebAppCompoundAssessmentSummaryResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableMigrateResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableMigrateResourceGroupResource() { } + public virtual Azure.Response GetCompoundAssessment(string projectName, string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCompoundAssessmentAsync(string projectName, string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migrate.CompoundAssessmentCollection GetCompoundAssessments(string projectName) { throw null; } + } +} +namespace Azure.ResourceManager.Migrate.Models +{ + public static partial class ArmMigrateModelFactory + { + public static Azure.ResourceManager.Migrate.CompoundAssessmentData CompoundAssessmentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migrate.Models.CompoundAssessmentProperties properties = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.CompoundAssessmentDetails CompoundAssessmentDetails(System.DateTimeOffset? createdTimestamp = default(System.DateTimeOffset?), System.DateTimeOffset? updatedTimestamp = default(System.DateTimeOffset?), Azure.ResourceManager.Migrate.Models.AssessmentStatus status = default(Azure.ResourceManager.Migrate.Models.AssessmentStatus)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.CompoundAssessmentProperties CompoundAssessmentProperties(Azure.ResourceManager.Migrate.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.Migrate.Models.ProvisioningState?), Azure.ResourceManager.Migrate.Models.TargetAssessmentArmIds targetAssessmentArmIds = null, string fallbackMachineAssessmentArmId = null, Azure.ResourceManager.Migrate.Models.CompoundAssessmentDetails details = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.CostDetailsCommon CostDetailsCommon(Azure.ResourceManager.Migrate.Models.SavingsOption? savingOptions = default(Azure.ResourceManager.Migrate.Models.SavingsOption?), System.Collections.Generic.IEnumerable costDetail = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.DiscoveredLightSummary DiscoveredLightSummary(int numberOfWebApps = 0, System.Collections.Generic.IEnumerable numberOfWebAppsPerType = null, System.Collections.Generic.IEnumerable numberOfWebServersPerType = null, int numberOfWebServers = 0, int numberOfServers = 0) { throw null; } + public static Azure.ResourceManager.Migrate.Models.DownloadUri DownloadUri(string assessmentReportUri = null, System.DateTimeOffset expireOn = default(System.DateTimeOffset)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.ManagementDetails ManagementDetails(Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType? name = default(Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType?), System.Collections.Generic.IEnumerable readinessSummary = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.MigrationDetails MigrationDetails(System.Collections.Generic.IEnumerable readinessSummary = null, Azure.ResourceManager.Migrate.Models.MigrationType? migrationType = default(Azure.ResourceManager.Migrate.Models.MigrationType?)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.NameValuePairCloudSuitabilityCommon NameValuePairCloudSuitabilityCommon(Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon? name = default(Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon?), int? value = default(int?)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.NameValuePairCostType NameValuePairCostType(Azure.ResourceManager.Migrate.Models.CostType? name = default(Azure.ResourceManager.Migrate.Models.CostType?), float? value = default(float?)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.NameValuePairSavingsType NameValuePairSavingsType(Azure.ResourceManager.Migrate.Models.SavingsType? name = default(Azure.ResourceManager.Migrate.Models.SavingsType?), float? value = default(float?)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.SavingsDetailsCommon SavingsDetailsCommon(Azure.ResourceManager.Migrate.Models.SavingsOption? savingOptions = default(Azure.ResourceManager.Migrate.Models.SavingsOption?), System.Collections.Generic.IEnumerable savingsDetail = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.SourceDetails SourceDetails(Azure.ResourceManager.Migrate.Models.AssessmentSource? sourceName = default(Azure.ResourceManager.Migrate.Models.AssessmentSource?), Azure.ResourceManager.Migrate.Models.MigrateWorkloadType? sourceType = default(Azure.ResourceManager.Migrate.Models.MigrateWorkloadType?), Azure.ResourceManager.Migrate.Models.MigrationPlatform? platform = default(Azure.ResourceManager.Migrate.Models.MigrationPlatform?), int? count = default(int?)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.TargetDetails TargetDetails(Azure.ResourceManager.Migrate.Models.AzureTarget? targetName = default(Azure.ResourceManager.Migrate.Models.AzureTarget?), Azure.ResourceManager.Migrate.Models.MigrateWorkloadType? targetType = default(Azure.ResourceManager.Migrate.Models.MigrateWorkloadType?), Azure.ResourceManager.Migrate.Models.MigrationPlatform? platform = default(Azure.ResourceManager.Migrate.Models.MigrationPlatform?), int? count = default(int?)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.TargetSourcePair TargetSourcePair(Azure.ResourceManager.Migrate.Models.AssessmentSource? sourceRef = default(Azure.ResourceManager.Migrate.Models.AssessmentSource?), Azure.ResourceManager.Migrate.Models.AzureTarget? targetRef = default(Azure.ResourceManager.Migrate.Models.AzureTarget?), int? sourceCount = default(int?), int? targetCount = default(int?), Azure.ResourceManager.Migrate.Models.MigrationDetails migrationDetails = null, System.Collections.Generic.IEnumerable managementDetails = null, System.Collections.Generic.IEnumerable costDetails = null, System.Collections.Generic.IEnumerable savingsDetails = null, double? confidenceScore = default(double?)) { throw null; } + public static Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryData WebAppCompoundAssessmentSummaryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migrate.Models.WebAppCompoundAssessmentSummaryProperties properties = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.WebAppCompoundAssessmentSummaryProperties WebAppCompoundAssessmentSummaryProperties(Azure.ResourceManager.Migrate.Models.SummaryType? summaryType = default(Azure.ResourceManager.Migrate.Models.SummaryType?), string summaryName = null, System.Collections.Generic.IEnumerable sources = null, System.Collections.Generic.IEnumerable targets = null, System.Collections.Generic.IEnumerable targetSourceMapping = null, System.Collections.Generic.IEnumerable costComponents = null, System.Collections.Generic.IEnumerable savingsComponents = null, string assessmentName = null, Azure.ResourceManager.Migrate.Models.DiscoveredLightSummary discoveredLightSummary = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.WebAppsPerType WebAppsPerType(Azure.ResourceManager.Migrate.Models.WebAppType webAppType = default(Azure.ResourceManager.Migrate.Models.WebAppType), int count = 0) { throw null; } + public static Azure.ResourceManager.Migrate.Models.WebServersPerType WebServersPerType(Azure.ResourceManager.Migrate.Models.WebServerType webServerType = default(Azure.ResourceManager.Migrate.Models.WebServerType), int count = 0) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AssessmentSource : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AssessmentSource(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource IIS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource Machine { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource MySQLServer { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource OracleDatabase { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource OracleServer { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource SAPInstance { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource SpringbootApplication { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource SqlDatabase { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource SqlInstance { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource TomCat { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource Unknown { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource WebApps { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.AssessmentSource 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.AssessmentSource left, Azure.ResourceManager.Migrate.Models.AssessmentSource right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AssessmentSource (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AssessmentSource left, Azure.ResourceManager.Migrate.Models.AssessmentSource 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 Deleted { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus Failed { 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 AzureManagementOfferingType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureManagementOfferingType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType AUM { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType AzMon { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType AzureBackup { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType No { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType SCOMMI { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType 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.AzureManagementOfferingType left, Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType left, Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureTarget : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureTarget(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.AzureTarget AKS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget Avs { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget AzureAppService { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget AzureAppServiceContainer { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget AzureSpringApps { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget AzureSQLVM { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget AzureVm { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget FlexServerPG { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget MySQLAzureFlexServer { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget OracleIaasVm { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget SAPAzureInstance { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget SqlDatabase { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget SqlMI { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.AzureTarget 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.AzureTarget left, Azure.ResourceManager.Migrate.Models.AzureTarget right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AzureTarget (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AzureTarget left, Azure.ResourceManager.Migrate.Models.AzureTarget right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CloudSuitabilityCommon : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CloudSuitabilityCommon(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon ConditionallySuitable { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon NotSuitable { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon ReadinessUnknown { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon Suitable { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon SuitableWithWarnings { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon 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.CloudSuitabilityCommon left, Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon left, Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CompoundAssessmentDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CompoundAssessmentDetails() { } + public System.DateTimeOffset? CreatedTimestamp { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AssessmentStatus Status { get { throw null; } } + public System.DateTimeOffset? UpdatedTimestamp { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.CompoundAssessmentDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.CompoundAssessmentDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CompoundAssessmentProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CompoundAssessmentProperties(Azure.ResourceManager.Migrate.Models.TargetAssessmentArmIds targetAssessmentArmIds) { } + public Azure.ResourceManager.Migrate.Models.CompoundAssessmentDetails Details { get { throw null; } } + public string FallbackMachineAssessmentArmId { get { throw null; } set { } } + public Azure.ResourceManager.Migrate.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.TargetAssessmentArmIds TargetAssessmentArmIds { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.CompoundAssessmentProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.CompoundAssessmentProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CostDetailsCommon : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CostDetailsCommon() { } + public System.Collections.Generic.IReadOnlyList CostDetail { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.SavingsOption? SavingOptions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.CostDetailsCommon System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.CostDetailsCommon System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CostType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CostType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.CostType DataProtectionService { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonitoringService { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyAvsExternalStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyAvsNetworkCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyAvsNodeCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyAzureHybridCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyBandwidthCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyComputeCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyLicensingCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyLinuxAzureHybridCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyManagementCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyPremiumStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyPremiumV2StorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlySecurityCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyStandardHddStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyStandardSsdStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyUltraDiskCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyUltraStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType PatchingService { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType TotalMonthlyCost { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.CostType 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.CostType left, Azure.ResourceManager.Migrate.Models.CostType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.CostType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.CostType left, Azure.ResourceManager.Migrate.Models.CostType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DiscoveredLightSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DiscoveredLightSummary() { } + public int NumberOfServers { get { throw null; } } + public int NumberOfWebApps { get { throw null; } } + public System.Collections.Generic.IReadOnlyList NumberOfWebAppsPerType { get { throw null; } } + public int NumberOfWebServers { get { throw null; } } + public System.Collections.Generic.IReadOnlyList NumberOfWebServersPerType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.DiscoveredLightSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.DiscoveredLightSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DownloadUri : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DownloadUri() { } + public string AssessmentReportUri { get { throw null; } } + public System.DateTimeOffset ExpireOn { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.DownloadUri System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.DownloadUri System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DownloadUrlContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DownloadUrlContent() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.DownloadUrlContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.DownloadUrlContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ManagementDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ManagementDetails() { } + public Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType? Name { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ReadinessSummary { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.ManagementDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.ManagementDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrateWorkloadType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrateWorkloadType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType Database { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType Host { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType Instance { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType Machine { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType ManagementServer { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType Server { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType Unknown { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType WebApplication { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType WebServer { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.MigrateWorkloadType 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.MigrateWorkloadType left, Azure.ResourceManager.Migrate.Models.MigrateWorkloadType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.MigrateWorkloadType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.MigrateWorkloadType left, Azure.ResourceManager.Migrate.Models.MigrateWorkloadType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MigrationDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MigrationDetails() { } + public Azure.ResourceManager.Migrate.Models.MigrationType? MigrationType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ReadinessSummary { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.MigrationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.MigrationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationPlatform : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationPlatform(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.MigrationPlatform IaaS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationPlatform PaaS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationPlatform SaaS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationPlatform Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.MigrationPlatform 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.MigrationPlatform left, Azure.ResourceManager.Migrate.Models.MigrationPlatform right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.MigrationPlatform (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.MigrationPlatform left, Azure.ResourceManager.Migrate.Models.MigrationPlatform right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.MigrationType Rearchitect { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationType Rehost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationType Replatform { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationType Retain { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.MigrationType 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.MigrationType left, Azure.ResourceManager.Migrate.Models.MigrationType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.MigrationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.MigrationType left, Azure.ResourceManager.Migrate.Models.MigrationType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class NameValuePairCloudSuitabilityCommon : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NameValuePairCloudSuitabilityCommon() { } + public Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon? Name { get { throw null; } } + public int? Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.NameValuePairCloudSuitabilityCommon System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.NameValuePairCloudSuitabilityCommon System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NameValuePairCostType : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NameValuePairCostType() { } + public Azure.ResourceManager.Migrate.Models.CostType? Name { get { throw null; } } + public float? Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.NameValuePairCostType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.NameValuePairCostType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NameValuePairSavingsType : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NameValuePairSavingsType() { } + public Azure.ResourceManager.Migrate.Models.SavingsType? Name { get { throw null; } } + public float? Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.NameValuePairSavingsType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.NameValuePairSavingsType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct 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 Canceled { 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 Provisioning { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.ProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.ProvisioningState Updating { 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; } + } + public partial class SavingsDetailsCommon : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SavingsDetailsCommon() { } + public Azure.ResourceManager.Migrate.Models.SavingsOption? SavingOptions { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SavingsDetail { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.SavingsDetailsCommon System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.SavingsDetailsCommon System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SavingsOption : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SavingsOption(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.SavingsOption CustomAzureOfferCode { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsOption None { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsOption RI1Year { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsOption RI3Year { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsOption SavingsPlan1Year { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsOption SavingsPlan3Year { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.SavingsOption 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.SavingsOption left, Azure.ResourceManager.Migrate.Models.SavingsOption right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.SavingsOption (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.SavingsOption left, Azure.ResourceManager.Migrate.Models.SavingsOption right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SavingsType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SavingsType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.SavingsType MonthlyAhubSqlCostSavings { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsType MonthlyAzureHybridCostSavings { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsType MonthlyLinuxAzureHybridCostSavings { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsType MonthlyVcfByolCostDifference { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.SavingsType 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.SavingsType left, Azure.ResourceManager.Migrate.Models.SavingsType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.SavingsType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.SavingsType left, Azure.ResourceManager.Migrate.Models.SavingsType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SourceDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SourceDetails() { } + public int? Count { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.MigrationPlatform? Platform { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AssessmentSource? SourceName { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.MigrateWorkloadType? SourceType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.SourceDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.SourceDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SummaryType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SummaryType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.SummaryType Strategy { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SummaryType Target { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SummaryType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.SummaryType 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.SummaryType left, Azure.ResourceManager.Migrate.Models.SummaryType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.SummaryType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.SummaryType left, Azure.ResourceManager.Migrate.Models.SummaryType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class TargetAssessmentArmIds : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TargetAssessmentArmIds() { } + public string Aks { get { throw null; } set { } } + public string AzureAppService { get { throw null; } set { } } + public string AzureAppServiceContainer { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.TargetAssessmentArmIds System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.TargetAssessmentArmIds System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TargetDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TargetDetails() { } + public int? Count { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.MigrationPlatform? Platform { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AzureTarget? TargetName { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.MigrateWorkloadType? TargetType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.TargetDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.TargetDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TargetSourcePair : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TargetSourcePair() { } + public double? ConfidenceScore { get { throw null; } } + public System.Collections.Generic.IReadOnlyList CostDetails { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ManagementDetails { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.MigrationDetails MigrationDetails { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SavingsDetails { get { throw null; } } + public int? SourceCount { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AssessmentSource? SourceRef { get { throw null; } } + public int? TargetCount { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AzureTarget? TargetRef { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.TargetSourcePair System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.TargetSourcePair System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WebAppCompoundAssessmentSummaryProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WebAppCompoundAssessmentSummaryProperties() { } + public string AssessmentName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList CostComponents { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.DiscoveredLightSummary DiscoveredLightSummary { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SavingsComponents { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Sources { get { throw null; } } + public string SummaryName { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.SummaryType? SummaryType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Targets { get { throw null; } } + public System.Collections.Generic.IReadOnlyList TargetSourceMapping { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.WebAppCompoundAssessmentSummaryProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.WebAppCompoundAssessmentSummaryProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WebAppsPerType : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WebAppsPerType() { } + public int Count { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.WebAppType WebAppType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.WebAppsPerType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.WebAppsPerType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct WebAppType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public WebAppType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.WebAppType ASPNET { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.WebAppType Java { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.WebAppType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.WebAppType 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.WebAppType left, Azure.ResourceManager.Migrate.Models.WebAppType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.WebAppType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.WebAppType left, Azure.ResourceManager.Migrate.Models.WebAppType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class WebServersPerType : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WebServersPerType() { } + public int Count { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.WebServerType WebServerType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.WebServersPerType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.WebServersPerType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct WebServerType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public WebServerType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.WebServerType IIS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.WebServerType Tomcat { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.WebServerType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.WebServerType 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.WebServerType left, Azure.ResourceManager.Migrate.Models.WebServerType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.WebServerType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.WebServerType left, Azure.ResourceManager.Migrate.Models.WebServerType right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/assets.json b/sdk/migrate/Azure.ResourceManager.Migrate/assets.json new file mode 100644 index 000000000000..7eb82a025442 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/migrate/Azure.ResourceManager.Migrate", + "Tag": "" +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Azure.ResourceManager.Migrate.Samples.csproj b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Azure.ResourceManager.Migrate.Samples.csproj new file mode 100644 index 000000000000..c8b72c599c4a --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Azure.ResourceManager.Migrate.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AKSAssessmentCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AKSAssessmentCollection.cs new file mode 100644 index 000000000000..455c4015ef33 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AKSAssessmentCollection.cs @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AKSAssessmentCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_AksAssessmentOperationsCreateMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksAssessmentOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "AKSAssessment_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AKSAssessmentResource + string projectName = "testProject"; + AKSAssessmentCollection collection = resourceGroupResource.GetAKSAssessments(projectName); + + // invoke the operation + string assessmentName = "testaksassessment"; + AKSAssessmentData data = new AKSAssessmentData + { + Properties = new AKSAssessmentProperties + { + Scope = new Scope + { + ScopeType = ScopeType.ServerGroupId, + ServerGroupId = "this-will-be-a-valid-arm-id", + AzureResourceGraphQuery = "zyhczkubwaqjqrmyithugmedmtdjxb", + }, + Settings = new AKSAssessmentSettings(AzureVmCategory.All, ConsolidationType.Full, PricingTier.Standard) + { + AzureLocation = "EastUS", + Currency = AzureCurrency.USD, + ScalingFactor = 20F, + DiscountPercentage = 14F, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased, + PerformanceData = new PerformanceData + { + Percentile = new Percentile("Unknown"), + TimeRange = TimeRange.Day, + PerfDataStartOn = DateTimeOffset.Parse("2025-02-14T07:09:09.242Z"), + PerfDataEndOn = DateTimeOffset.Parse("2025-02-14T07:09:09.242Z"), + }, + SavingsSettings = new SavingsSettings + { + SavingsOptions = SavingsOption.None, + AzureOfferCode = AzureOffer.Unknown, + }, + BillingSettings = new BillingSettings + { + LicensingProgram = LicensingProgram.EA, + SubscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56", + }, + EnvironmentType = EnvironmentType.Production, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, assessmentName, data); + AKSAssessmentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AKSAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AksAssessmentOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksAssessmentOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AKSAssessment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AKSAssessmentResource + string projectName = "testProject"; + AKSAssessmentCollection collection = resourceGroupResource.GetAKSAssessments(projectName); + + // invoke the operation + string assessmentName = "testaksassessment"; + AKSAssessmentResource result = await collection.GetAsync(assessmentName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AKSAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AksAssessmentOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksAssessmentOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AKSAssessment_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AKSAssessmentResource + string projectName = "testProject"; + AKSAssessmentCollection collection = resourceGroupResource.GetAKSAssessments(projectName); + + // invoke the operation and iterate over the result + await foreach (AKSAssessmentResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AKSAssessmentData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AksAssessmentOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksAssessmentOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AKSAssessment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AKSAssessmentResource + string projectName = "testProject"; + AKSAssessmentCollection collection = resourceGroupResource.GetAKSAssessments(projectName); + + // invoke the operation + string assessmentName = "testaksassessment"; + bool result = await collection.ExistsAsync(assessmentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AksAssessmentOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksAssessmentOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AKSAssessment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AKSAssessmentResource + string projectName = "testProject"; + AKSAssessmentCollection collection = resourceGroupResource.GetAKSAssessments(projectName); + + // invoke the operation + string assessmentName = "testaksassessment"; + NullableResponse response = await collection.GetIfExistsAsync(assessmentName); + AKSAssessmentResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AKSAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AKSAssessmentOptionCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AKSAssessmentOptionCollection.cs new file mode 100644 index 000000000000..e57c79db8108 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AKSAssessmentOptionCollection.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AKSAssessmentOptionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AksOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AKSAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AKSAssessmentOptionResource + string projectName = "testProject"; + AKSAssessmentOptionCollection collection = resourceGroupResource.GetAKSAssessmentOptions(projectName); + + // invoke the operation + string assessmentOptionsName = "default"; + AKSAssessmentOptionResource result = await collection.GetAsync(assessmentOptionsName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AKSAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AksOptionsOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksOptionsOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AKSAssessmentOptions_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AKSAssessmentOptionResource + string projectName = "testProject"; + AKSAssessmentOptionCollection collection = resourceGroupResource.GetAKSAssessmentOptions(projectName); + + // invoke the operation and iterate over the result + await foreach (AKSAssessmentOptionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AKSAssessmentOptionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AksOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AKSAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AKSAssessmentOptionResource + string projectName = "testProject"; + AKSAssessmentOptionCollection collection = resourceGroupResource.GetAKSAssessmentOptions(projectName); + + // invoke the operation + string assessmentOptionsName = "default"; + bool result = await collection.ExistsAsync(assessmentOptionsName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AksOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AKSAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AKSAssessmentOptionResource + string projectName = "testProject"; + AKSAssessmentOptionCollection collection = resourceGroupResource.GetAKSAssessmentOptions(projectName); + + // invoke the operation + string assessmentOptionsName = "default"; + NullableResponse response = await collection.GetIfExistsAsync(assessmentOptionsName); + AKSAssessmentOptionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AKSAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AKSAssessmentOptionResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AKSAssessmentOptionResource.cs new file mode 100644 index 000000000000..ab9e57303c15 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AKSAssessmentOptionResource.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AKSAssessmentOptionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AksOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AKSAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AKSAssessmentOptionResource created on azure + // for more information of creating AKSAssessmentOptionResource, please refer to the document of AKSAssessmentOptionResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + string projectName = "testProject"; + string assessmentOptionsName = "default"; + ResourceIdentifier aksAssessmentOptionResourceId = AKSAssessmentOptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentOptionsName); + AKSAssessmentOptionResource aksAssessmentOption = client.GetAKSAssessmentOptionResource(aksAssessmentOptionResourceId); + + // invoke the operation + AKSAssessmentOptionResource result = await aksAssessmentOption.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AKSAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AKSAssessmentResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AKSAssessmentResource.cs new file mode 100644 index 000000000000..866f2ddb9c35 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AKSAssessmentResource.cs @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AKSAssessmentResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AksAssessmentOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksAssessmentOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AKSAssessment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AKSAssessmentResource created on azure + // for more information of creating AKSAssessmentResource, please refer to the document of AKSAssessmentResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + string projectName = "testProject"; + string assessmentName = "testaksassessment"; + ResourceIdentifier aksAssessmentResourceId = AKSAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AKSAssessmentResource aksAssessment = client.GetAKSAssessmentResource(aksAssessmentResourceId); + + // invoke the operation + AKSAssessmentResource result = await aksAssessment.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AKSAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_AksAssessmentOperationsDeleteMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksAssessmentOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "AKSAssessment_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AKSAssessmentResource created on azure + // for more information of creating AKSAssessmentResource, please refer to the document of AKSAssessmentResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + string projectName = "testProject"; + string assessmentName = "testaksassessment"; + ResourceIdentifier aksAssessmentResourceId = AKSAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AKSAssessmentResource aksAssessment = client.GetAKSAssessmentResource(aksAssessmentResourceId); + + // invoke the operation + await aksAssessment.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_AksAssessmentOperationsCreateMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksAssessmentOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "AKSAssessment_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AKSAssessmentResource created on azure + // for more information of creating AKSAssessmentResource, please refer to the document of AKSAssessmentResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + string projectName = "testProject"; + string assessmentName = "testaksassessment"; + ResourceIdentifier aksAssessmentResourceId = AKSAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AKSAssessmentResource aksAssessment = client.GetAKSAssessmentResource(aksAssessmentResourceId); + + // invoke the operation + AKSAssessmentData data = new AKSAssessmentData + { + Properties = new AKSAssessmentProperties + { + Scope = new Scope + { + ScopeType = ScopeType.ServerGroupId, + ServerGroupId = "this-will-be-a-valid-arm-id", + AzureResourceGraphQuery = "zyhczkubwaqjqrmyithugmedmtdjxb", + }, + Settings = new AKSAssessmentSettings(AzureVmCategory.All, ConsolidationType.Full, PricingTier.Standard) + { + AzureLocation = "EastUS", + Currency = AzureCurrency.USD, + ScalingFactor = 20F, + DiscountPercentage = 14F, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased, + PerformanceData = new PerformanceData + { + Percentile = new Percentile("Unknown"), + TimeRange = TimeRange.Day, + PerfDataStartOn = DateTimeOffset.Parse("2025-02-14T07:09:09.242Z"), + PerfDataEndOn = DateTimeOffset.Parse("2025-02-14T07:09:09.242Z"), + }, + SavingsSettings = new SavingsSettings + { + SavingsOptions = SavingsOption.None, + AzureOfferCode = AzureOffer.Unknown, + }, + BillingSettings = new BillingSettings + { + LicensingProgram = LicensingProgram.EA, + SubscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56", + }, + EnvironmentType = EnvironmentType.Production, + }, + }, + }; + ArmOperation lro = await aksAssessment.UpdateAsync(WaitUntil.Completed, data); + AKSAssessmentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AKSAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task DownloadUrl_AksAssessmentOperationsDownloadUrlMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksAssessmentOperations_DownloadUrl_MaximumSet_Gen.json + // this example is just showing the usage of "AKSAssessmentOperations_DownloadUrl" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AKSAssessmentResource created on azure + // for more information of creating AKSAssessmentResource, please refer to the document of AKSAssessmentResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + string projectName = "testProject"; + string assessmentName = "testaksassessment"; + ResourceIdentifier aksAssessmentResourceId = AKSAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AKSAssessmentResource aksAssessment = client.GetAKSAssessmentResource(aksAssessmentResourceId); + + // invoke the operation + DownloadUrlContent content = new DownloadUrlContent(); + ArmOperation lro = await aksAssessment.DownloadUrlAsync(WaitUntil.Completed, content); + DownloadUri result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAKSCostDetailOperationsByParent_AksCostDetailOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksCostDetailOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AKSCostDetail_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AKSAssessmentResource created on azure + // for more information of creating AKSAssessmentResource, please refer to the document of AKSAssessmentResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + string projectName = "testProject"; + string assessmentName = "testaksassessment"; + ResourceIdentifier aksAssessmentResourceId = AKSAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AKSAssessmentResource aksAssessment = client.GetAKSAssessmentResource(aksAssessmentResourceId); + + // invoke the operation and iterate over the result + await foreach (AKSCostDetail item in aksAssessment.GetAKSCostDetailOperationsByParentAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AKSClusterCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AKSClusterCollection.cs new file mode 100644 index 000000000000..ee8c8e979372 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AKSClusterCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AKSClusterCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AksClusterOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksClusterOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AKSCluster_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AKSAssessmentResource created on azure + // for more information of creating AKSAssessmentResource, please refer to the document of AKSAssessmentResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + string projectName = "testProject"; + string assessmentName = "testaksassessment"; + ResourceIdentifier aksAssessmentResourceId = AKSAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AKSAssessmentResource aksAssessment = client.GetAKSAssessmentResource(aksAssessmentResourceId); + + // get the collection of this AKSClusterResource + AKSClusterCollection collection = aksAssessment.GetAKSClusters(); + + // invoke the operation + string clusterName = "testaksassessment-cluster"; + AKSClusterResource result = await collection.GetAsync(clusterName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AKSClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AksClusterOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksClusterOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AKSCluster_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AKSAssessmentResource created on azure + // for more information of creating AKSAssessmentResource, please refer to the document of AKSAssessmentResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + string projectName = "testProject"; + string assessmentName = "testaksassessment"; + ResourceIdentifier aksAssessmentResourceId = AKSAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AKSAssessmentResource aksAssessment = client.GetAKSAssessmentResource(aksAssessmentResourceId); + + // get the collection of this AKSClusterResource + AKSClusterCollection collection = aksAssessment.GetAKSClusters(); + + // invoke the operation and iterate over the result + await foreach (AKSClusterResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AKSClusterData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AksClusterOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksClusterOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AKSCluster_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AKSAssessmentResource created on azure + // for more information of creating AKSAssessmentResource, please refer to the document of AKSAssessmentResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + string projectName = "testProject"; + string assessmentName = "testaksassessment"; + ResourceIdentifier aksAssessmentResourceId = AKSAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AKSAssessmentResource aksAssessment = client.GetAKSAssessmentResource(aksAssessmentResourceId); + + // get the collection of this AKSClusterResource + AKSClusterCollection collection = aksAssessment.GetAKSClusters(); + + // invoke the operation + string clusterName = "testaksassessment-cluster"; + bool result = await collection.ExistsAsync(clusterName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AksClusterOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksClusterOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AKSCluster_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AKSAssessmentResource created on azure + // for more information of creating AKSAssessmentResource, please refer to the document of AKSAssessmentResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + string projectName = "testProject"; + string assessmentName = "testaksassessment"; + ResourceIdentifier aksAssessmentResourceId = AKSAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AKSAssessmentResource aksAssessment = client.GetAKSAssessmentResource(aksAssessmentResourceId); + + // get the collection of this AKSClusterResource + AKSClusterCollection collection = aksAssessment.GetAKSClusters(); + + // invoke the operation + string clusterName = "testaksassessment-cluster"; + NullableResponse response = await collection.GetIfExistsAsync(clusterName); + AKSClusterResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AKSClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AKSClusterResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AKSClusterResource.cs new file mode 100644 index 000000000000..c1517fe259bd --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AKSClusterResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AKSClusterResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AksClusterOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksClusterOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AKSCluster_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AKSClusterResource created on azure + // for more information of creating AKSClusterResource, please refer to the document of AKSClusterResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + string projectName = "testProject"; + string assessmentName = "testaksassessment"; + string clusterName = "testaksassessment-cluster"; + ResourceIdentifier aksClusterResourceId = AKSClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, clusterName); + AKSClusterResource aksCluster = client.GetAKSClusterResource(aksClusterResourceId); + + // invoke the operation + AKSClusterResource result = await aksCluster.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AKSClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AKSSummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AKSSummaryCollection.cs new file mode 100644 index 000000000000..20198aad2467 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AKSSummaryCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AKSSummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AksSummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AKSSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AKSAssessmentResource created on azure + // for more information of creating AKSAssessmentResource, please refer to the document of AKSAssessmentResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + string projectName = "testProject"; + string assessmentName = "testaksassessment"; + ResourceIdentifier aksAssessmentResourceId = AKSAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AKSAssessmentResource aksAssessment = client.GetAKSAssessmentResource(aksAssessmentResourceId); + + // get the collection of this AKSSummaryResource + AKSSummaryCollection collection = aksAssessment.GetAKSSummaries(); + + // invoke the operation + string summaryName = "AKS"; + AKSSummaryResource result = await collection.GetAsync(summaryName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AKSSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AksSummaryOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksSummaryOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AKSSummary_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AKSAssessmentResource created on azure + // for more information of creating AKSAssessmentResource, please refer to the document of AKSAssessmentResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + string projectName = "testProject"; + string assessmentName = "testaksassessment"; + ResourceIdentifier aksAssessmentResourceId = AKSAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AKSAssessmentResource aksAssessment = client.GetAKSAssessmentResource(aksAssessmentResourceId); + + // get the collection of this AKSSummaryResource + AKSSummaryCollection collection = aksAssessment.GetAKSSummaries(); + + // invoke the operation and iterate over the result + await foreach (AKSSummaryResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AKSSummaryData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AksSummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AKSSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AKSAssessmentResource created on azure + // for more information of creating AKSAssessmentResource, please refer to the document of AKSAssessmentResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + string projectName = "testProject"; + string assessmentName = "testaksassessment"; + ResourceIdentifier aksAssessmentResourceId = AKSAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AKSAssessmentResource aksAssessment = client.GetAKSAssessmentResource(aksAssessmentResourceId); + + // get the collection of this AKSSummaryResource + AKSSummaryCollection collection = aksAssessment.GetAKSSummaries(); + + // invoke the operation + string summaryName = "AKS"; + bool result = await collection.ExistsAsync(summaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AksSummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AKSSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AKSAssessmentResource created on azure + // for more information of creating AKSAssessmentResource, please refer to the document of AKSAssessmentResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + string projectName = "testProject"; + string assessmentName = "testaksassessment"; + ResourceIdentifier aksAssessmentResourceId = AKSAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AKSAssessmentResource aksAssessment = client.GetAKSAssessmentResource(aksAssessmentResourceId); + + // get the collection of this AKSSummaryResource + AKSSummaryCollection collection = aksAssessment.GetAKSSummaries(); + + // invoke the operation + string summaryName = "AKS"; + NullableResponse response = await collection.GetIfExistsAsync(summaryName); + AKSSummaryResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AKSSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AKSSummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AKSSummaryResource.cs new file mode 100644 index 000000000000..d5739d562a28 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AKSSummaryResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AKSSummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AksSummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AksSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AKSSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AKSSummaryResource created on azure + // for more information of creating AKSSummaryResource, please refer to the document of AKSSummaryResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + string projectName = "testProject"; + string assessmentName = "testaksassessment"; + string summaryName = "AKS"; + ResourceIdentifier aksSummaryResourceId = AKSSummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, summaryName); + AKSSummaryResource aksSummary = client.GetAKSSummaryResource(aksSummaryResourceId); + + // invoke the operation + AKSSummaryResource result = await aksSummary.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AKSSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedMachineV2Collection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedMachineV2Collection.cs new file mode 100644 index 000000000000..ceb677eed395 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedMachineV2Collection.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AssessedMachineV2Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedMachinesV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedMachinesV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedMachineV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineAssessmentV2Resource created on azure + // for more information of creating MachineAssessmentV2Resource, please refer to the document of MachineAssessmentV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier machineAssessmentV2ResourceId = MachineAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + MachineAssessmentV2Resource machineAssessmentV2 = client.GetMachineAssessmentV2Resource(machineAssessmentV2ResourceId); + + // get the collection of this AssessedMachineV2Resource + AssessedMachineV2Collection collection = machineAssessmentV2.GetAssessedMachineV2s(); + + // invoke the operation + string assessedMachineName = "machine1"; + AssessedMachineV2Resource result = await collection.GetAsync(assessedMachineName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedMachineV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AssessedMachinesV2OperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedMachinesV2Operations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedMachineV2_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineAssessmentV2Resource created on azure + // for more information of creating MachineAssessmentV2Resource, please refer to the document of MachineAssessmentV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier machineAssessmentV2ResourceId = MachineAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + MachineAssessmentV2Resource machineAssessmentV2 = client.GetMachineAssessmentV2Resource(machineAssessmentV2ResourceId); + + // get the collection of this AssessedMachineV2Resource + AssessedMachineV2Collection collection = machineAssessmentV2.GetAssessedMachineV2s(); + + // invoke the operation and iterate over the result + int? pageSize = 13; + string continuationToken = "lsuhpxtnundds"; + int? totalRecordCount = 28; + await foreach (AssessedMachineV2Resource item in collection.GetAllAsync(pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedMachineV2Data resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AssessedMachinesV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedMachinesV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedMachineV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineAssessmentV2Resource created on azure + // for more information of creating MachineAssessmentV2Resource, please refer to the document of MachineAssessmentV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier machineAssessmentV2ResourceId = MachineAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + MachineAssessmentV2Resource machineAssessmentV2 = client.GetMachineAssessmentV2Resource(machineAssessmentV2ResourceId); + + // get the collection of this AssessedMachineV2Resource + AssessedMachineV2Collection collection = machineAssessmentV2.GetAssessedMachineV2s(); + + // invoke the operation + string assessedMachineName = "machine1"; + bool result = await collection.ExistsAsync(assessedMachineName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AssessedMachinesV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedMachinesV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedMachineV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineAssessmentV2Resource created on azure + // for more information of creating MachineAssessmentV2Resource, please refer to the document of MachineAssessmentV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier machineAssessmentV2ResourceId = MachineAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + MachineAssessmentV2Resource machineAssessmentV2 = client.GetMachineAssessmentV2Resource(machineAssessmentV2ResourceId); + + // get the collection of this AssessedMachineV2Resource + AssessedMachineV2Collection collection = machineAssessmentV2.GetAssessedMachineV2s(); + + // invoke the operation + string assessedMachineName = "machine1"; + NullableResponse response = await collection.GetIfExistsAsync(assessedMachineName); + AssessedMachineV2Resource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedMachineV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedMachineV2Resource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedMachineV2Resource.cs new file mode 100644 index 000000000000..7966b6779ca5 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedMachineV2Resource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AssessedMachineV2Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedMachinesV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedMachinesV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedMachineV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessedMachineV2Resource created on azure + // for more information of creating AssessedMachineV2Resource, please refer to the document of AssessedMachineV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + string assessedMachineName = "machine1"; + ResourceIdentifier assessedMachineV2ResourceId = AssessedMachineV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, assessedMachineName); + AssessedMachineV2Resource assessedMachineV2 = client.GetAssessedMachineV2Resource(assessedMachineV2ResourceId); + + // invoke the operation + AssessedMachineV2Resource result = await assessedMachineV2.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedMachineV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlDatabaseV3Collection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlDatabaseV3Collection.cs new file mode 100644 index 000000000000..920e21ab0aaf --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlDatabaseV3Collection.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AssessedSqlDatabaseV3Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedSqlDatabaseV3OperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlDatabaseV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlDatabaseV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this AssessedSqlDatabaseV3Resource + AssessedSqlDatabaseV3Collection collection = sqlAssessmentV3.GetAssessedSqlDatabaseV3s(); + + // invoke the operation + string assessedSqlDatabaseName = "db1"; + AssessedSqlDatabaseV3Resource result = await collection.GetAsync(assessedSqlDatabaseName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlDatabaseV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AssessedSqlDatabaseV3OperationsListByParent() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlDatabaseV3Operations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlDatabaseV3_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this AssessedSqlDatabaseV3Resource + AssessedSqlDatabaseV3Collection collection = sqlAssessmentV3.GetAssessedSqlDatabaseV3s(); + + // invoke the operation and iterate over the result + int? pageSize = 11; + string continuationToken = "ahjkwi"; + int? totalRecordCount = 11; + await foreach (AssessedSqlDatabaseV3Resource item in collection.GetAllAsync(pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlDatabaseV3Data resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AssessedSqlDatabaseV3OperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlDatabaseV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlDatabaseV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this AssessedSqlDatabaseV3Resource + AssessedSqlDatabaseV3Collection collection = sqlAssessmentV3.GetAssessedSqlDatabaseV3s(); + + // invoke the operation + string assessedSqlDatabaseName = "db1"; + bool result = await collection.ExistsAsync(assessedSqlDatabaseName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AssessedSqlDatabaseV3OperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlDatabaseV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlDatabaseV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this AssessedSqlDatabaseV3Resource + AssessedSqlDatabaseV3Collection collection = sqlAssessmentV3.GetAssessedSqlDatabaseV3s(); + + // invoke the operation + string assessedSqlDatabaseName = "db1"; + NullableResponse response = await collection.GetIfExistsAsync(assessedSqlDatabaseName); + AssessedSqlDatabaseV3Resource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlDatabaseV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlDatabaseV3Resource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlDatabaseV3Resource.cs new file mode 100644 index 000000000000..ecce0772602a --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlDatabaseV3Resource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AssessedSqlDatabaseV3Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedSqlDatabaseV3OperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlDatabaseV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlDatabaseV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessedSqlDatabaseV3Resource created on azure + // for more information of creating AssessedSqlDatabaseV3Resource, please refer to the document of AssessedSqlDatabaseV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + string assessedSqlDatabaseName = "db1"; + ResourceIdentifier assessedSqlDatabaseV3ResourceId = AssessedSqlDatabaseV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, assessedSqlDatabaseName); + AssessedSqlDatabaseV3Resource assessedSqlDatabaseV3 = client.GetAssessedSqlDatabaseV3Resource(assessedSqlDatabaseV3ResourceId); + + // invoke the operation + AssessedSqlDatabaseV3Resource result = await assessedSqlDatabaseV3.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlDatabaseV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlInstanceV3Collection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlInstanceV3Collection.cs new file mode 100644 index 000000000000..f78028ae2435 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlInstanceV3Collection.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AssessedSqlInstanceV3Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedSqlInstanceV3OperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlInstanceV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlInstanceV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this AssessedSqlInstanceV3Resource + AssessedSqlInstanceV3Collection collection = sqlAssessmentV3.GetAssessedSqlInstanceV3s(); + + // invoke the operation + string assessedSqlInstanceName = "sql1"; + AssessedSqlInstanceV3Resource result = await collection.GetAsync(assessedSqlInstanceName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlInstanceV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AssessedSqlInstanceV3OperationsListByParent() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlInstanceV3Operations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlInstanceV3_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this AssessedSqlInstanceV3Resource + AssessedSqlInstanceV3Collection collection = sqlAssessmentV3.GetAssessedSqlInstanceV3s(); + + // invoke the operation and iterate over the result + int? pageSize = 30; + string continuationToken = "tvblslp"; + int? totalRecordCount = 29; + await foreach (AssessedSqlInstanceV3Resource item in collection.GetAllAsync(pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlInstanceV3Data resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AssessedSqlInstanceV3OperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlInstanceV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlInstanceV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this AssessedSqlInstanceV3Resource + AssessedSqlInstanceV3Collection collection = sqlAssessmentV3.GetAssessedSqlInstanceV3s(); + + // invoke the operation + string assessedSqlInstanceName = "sql1"; + bool result = await collection.ExistsAsync(assessedSqlInstanceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AssessedSqlInstanceV3OperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlInstanceV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlInstanceV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this AssessedSqlInstanceV3Resource + AssessedSqlInstanceV3Collection collection = sqlAssessmentV3.GetAssessedSqlInstanceV3s(); + + // invoke the operation + string assessedSqlInstanceName = "sql1"; + NullableResponse response = await collection.GetIfExistsAsync(assessedSqlInstanceName); + AssessedSqlInstanceV3Resource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlInstanceV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlInstanceV3Resource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlInstanceV3Resource.cs new file mode 100644 index 000000000000..f2e8bcf2a4d6 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlInstanceV3Resource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AssessedSqlInstanceV3Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedSqlInstanceV3OperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlInstanceV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlInstanceV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessedSqlInstanceV3Resource created on azure + // for more information of creating AssessedSqlInstanceV3Resource, please refer to the document of AssessedSqlInstanceV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + string assessedSqlInstanceName = "sql1"; + ResourceIdentifier assessedSqlInstanceV3ResourceId = AssessedSqlInstanceV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, assessedSqlInstanceName); + AssessedSqlInstanceV3Resource assessedSqlInstanceV3 = client.GetAssessedSqlInstanceV3Resource(assessedSqlInstanceV3ResourceId); + + // invoke the operation + AssessedSqlInstanceV3Resource result = await assessedSqlInstanceV3.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlInstanceV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlMachineV3Collection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlMachineV3Collection.cs new file mode 100644 index 000000000000..e55cd17b650b --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlMachineV3Collection.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AssessedSqlMachineV3Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedSqlMachinesV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlMachinesV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlMachineV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this AssessedSqlMachineV3Resource + AssessedSqlMachineV3Collection collection = sqlAssessmentV3.GetAssessedSqlMachineV3s(); + + // invoke the operation + string assessedSqlMachineName = "machine1"; + AssessedSqlMachineV3Resource result = await collection.GetAsync(assessedSqlMachineName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlMachineV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AssessedSqlMachinesV3OperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlMachinesV3Operations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlMachineV3_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this AssessedSqlMachineV3Resource + AssessedSqlMachineV3Collection collection = sqlAssessmentV3.GetAssessedSqlMachineV3s(); + + // invoke the operation and iterate over the result + int? pageSize = 27; + string continuationToken = "vzjkdmjvvkeuvm"; + int? totalRecordCount = 30; + await foreach (AssessedSqlMachineV3Resource item in collection.GetAllAsync(pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlMachineV3Data resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AssessedSqlMachinesV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlMachinesV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlMachineV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this AssessedSqlMachineV3Resource + AssessedSqlMachineV3Collection collection = sqlAssessmentV3.GetAssessedSqlMachineV3s(); + + // invoke the operation + string assessedSqlMachineName = "machine1"; + bool result = await collection.ExistsAsync(assessedSqlMachineName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AssessedSqlMachinesV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlMachinesV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlMachineV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this AssessedSqlMachineV3Resource + AssessedSqlMachineV3Collection collection = sqlAssessmentV3.GetAssessedSqlMachineV3s(); + + // invoke the operation + string assessedSqlMachineName = "machine1"; + NullableResponse response = await collection.GetIfExistsAsync(assessedSqlMachineName); + AssessedSqlMachineV3Resource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlMachineV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlMachineV3Resource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlMachineV3Resource.cs new file mode 100644 index 000000000000..9954c5daa2b4 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlMachineV3Resource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AssessedSqlMachineV3Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedSqlMachinesV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlMachinesV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlMachineV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessedSqlMachineV3Resource created on azure + // for more information of creating AssessedSqlMachineV3Resource, please refer to the document of AssessedSqlMachineV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + string assessedSqlMachineName = "machine1"; + ResourceIdentifier assessedSqlMachineV3ResourceId = AssessedSqlMachineV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, assessedSqlMachineName); + AssessedSqlMachineV3Resource assessedSqlMachineV3 = client.GetAssessedSqlMachineV3Resource(assessedSqlMachineV3ResourceId); + + // invoke the operation + AssessedSqlMachineV3Resource result = await assessedSqlMachineV3.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedSqlMachineV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedWebAppV3Collection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedWebAppV3Collection.cs new file mode 100644 index 000000000000..4da4af3903e4 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedWebAppV3Collection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AssessedWebAppV3Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedWebAppsV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedWebAppsV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedWebAppV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // get the collection of this AssessedWebAppV3Resource + AssessedWebAppV3Collection collection = webAppAssessmentV3.GetAssessedWebAppV3s(); + + // invoke the operation + string assessedWebAppName = "webapp1"; + AssessedWebAppV3Resource result = await collection.GetAsync(assessedWebAppName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedWebAppV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AssessedWebAppsV3OperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedWebAppsV3Operations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedWebAppV3_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // get the collection of this AssessedWebAppV3Resource + AssessedWebAppV3Collection collection = webAppAssessmentV3.GetAssessedWebAppV3s(); + + // invoke the operation and iterate over the result + await foreach (AssessedWebAppV3Resource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedWebAppV3Data resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AssessedWebAppsV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedWebAppsV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedWebAppV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // get the collection of this AssessedWebAppV3Resource + AssessedWebAppV3Collection collection = webAppAssessmentV3.GetAssessedWebAppV3s(); + + // invoke the operation + string assessedWebAppName = "webapp1"; + bool result = await collection.ExistsAsync(assessedWebAppName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AssessedWebAppsV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedWebAppsV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedWebAppV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // get the collection of this AssessedWebAppV3Resource + AssessedWebAppV3Collection collection = webAppAssessmentV3.GetAssessedWebAppV3s(); + + // invoke the operation + string assessedWebAppName = "webapp1"; + NullableResponse response = await collection.GetIfExistsAsync(assessedWebAppName); + AssessedWebAppV3Resource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedWebAppV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedWebAppV3Resource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedWebAppV3Resource.cs new file mode 100644 index 000000000000..ae35dd024b6d --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedWebAppV3Resource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AssessedWebAppV3Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedWebAppsV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedWebAppsV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedWebAppV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessedWebAppV3Resource created on azure + // for more information of creating AssessedWebAppV3Resource, please refer to the document of AssessedWebAppV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + string assessedWebAppName = "webapp1"; + ResourceIdentifier assessedWebAppV3ResourceId = AssessedWebAppV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, assessedWebAppName); + AssessedWebAppV3Resource assessedWebAppV3 = client.GetAssessedWebAppV3Resource(assessedWebAppV3ResourceId); + + // invoke the operation + AssessedWebAppV3Resource result = await assessedWebAppV3.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedWebAppV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedWebApplicationCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedWebApplicationCollection.cs new file mode 100644 index 000000000000..7fcc9126ba0f --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedWebApplicationCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AssessedWebApplicationCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedWebApplicationOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedWebApplicationOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedWebApplication_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AKSAssessmentResource created on azure + // for more information of creating AKSAssessmentResource, please refer to the document of AKSAssessmentResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + string projectName = "testProject"; + string assessmentName = "testaksassessment"; + ResourceIdentifier aksAssessmentResourceId = AKSAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AKSAssessmentResource aksAssessment = client.GetAKSAssessmentResource(aksAssessmentResourceId); + + // get the collection of this AssessedWebApplicationResource + AssessedWebApplicationCollection collection = aksAssessment.GetAssessedWebApplications(); + + // invoke the operation + string assessedWorkload = "webapp"; + AssessedWebApplicationResource result = await collection.GetAsync(assessedWorkload); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedWebApplicationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AssessedWebApplicationOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedWebApplicationOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedWebApplication_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AKSAssessmentResource created on azure + // for more information of creating AKSAssessmentResource, please refer to the document of AKSAssessmentResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + string projectName = "testProject"; + string assessmentName = "testaksassessment"; + ResourceIdentifier aksAssessmentResourceId = AKSAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AKSAssessmentResource aksAssessment = client.GetAKSAssessmentResource(aksAssessmentResourceId); + + // get the collection of this AssessedWebApplicationResource + AssessedWebApplicationCollection collection = aksAssessment.GetAssessedWebApplications(); + + // invoke the operation and iterate over the result + await foreach (AssessedWebApplicationResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedWebApplicationData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AssessedWebApplicationOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedWebApplicationOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedWebApplication_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AKSAssessmentResource created on azure + // for more information of creating AKSAssessmentResource, please refer to the document of AKSAssessmentResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + string projectName = "testProject"; + string assessmentName = "testaksassessment"; + ResourceIdentifier aksAssessmentResourceId = AKSAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AKSAssessmentResource aksAssessment = client.GetAKSAssessmentResource(aksAssessmentResourceId); + + // get the collection of this AssessedWebApplicationResource + AssessedWebApplicationCollection collection = aksAssessment.GetAssessedWebApplications(); + + // invoke the operation + string assessedWorkload = "webapp"; + bool result = await collection.ExistsAsync(assessedWorkload); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AssessedWebApplicationOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedWebApplicationOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedWebApplication_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AKSAssessmentResource created on azure + // for more information of creating AKSAssessmentResource, please refer to the document of AKSAssessmentResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + string projectName = "testProject"; + string assessmentName = "testaksassessment"; + ResourceIdentifier aksAssessmentResourceId = AKSAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AKSAssessmentResource aksAssessment = client.GetAKSAssessmentResource(aksAssessmentResourceId); + + // get the collection of this AssessedWebApplicationResource + AssessedWebApplicationCollection collection = aksAssessment.GetAssessedWebApplications(); + + // invoke the operation + string assessedWorkload = "webapp"; + NullableResponse response = await collection.GetIfExistsAsync(assessedWorkload); + AssessedWebApplicationResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedWebApplicationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedWebApplicationResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedWebApplicationResource.cs new file mode 100644 index 000000000000..9ba47572365d --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedWebApplicationResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AssessedWebApplicationResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedWebApplicationOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedWebApplicationOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedWebApplication_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessedWebApplicationResource created on azure + // for more information of creating AssessedWebApplicationResource, please refer to the document of AssessedWebApplicationResource + string subscriptionId = "572C3D3F-425D-4AE8-A935-72631EADDE56"; + string resourceGroupName = "rgaksAssessments"; + string projectName = "testProject"; + string assessmentName = "testaksassessment"; + string assessedWorkload = "webapp"; + ResourceIdentifier assessedWebApplicationResourceId = AssessedWebApplicationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, assessedWorkload); + AssessedWebApplicationResource assessedWebApplication = client.GetAssessedWebApplicationResource(assessedWebApplicationResourceId); + + // invoke the operation + AssessedWebApplicationResource result = await assessedWebApplication.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessedWebApplicationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectCollection.cs new file mode 100644 index 000000000000..d85aac7c6c34 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectCollection.cs @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AssessmentProjectCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_AssessmentProjectsOperationsCreate() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProject_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AssessmentProjectResource + AssessmentProjectCollection collection = resourceGroupResource.GetAssessmentProjects(); + + // invoke the operation + string projectName = "sakanwar1204project"; + AssessmentProjectData data = new AssessmentProjectData(new AzureLocation("southeastasia")) + { + Properties = new ProjectProperties + { + AssessmentSolutionId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa", + ProjectStatus = ProjectStatus.Active, + PublicNetworkAccess = "Disabled", + CustomerStorageAccountArmId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa", + }, + Tags = +{ +["Migrate Project"] = "sakanwar-PE-SEA" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, projectName, data); + AssessmentProjectResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessmentProjectData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessmentProjectsOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProject_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AssessmentProjectResource + AssessmentProjectCollection collection = resourceGroupResource.GetAssessmentProjects(); + + // invoke the operation + string projectName = "sakanwar1204project"; + AssessmentProjectResource result = await collection.GetAsync(projectName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessmentProjectData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AssessmentProjectsOperationsListByParent() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectsOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProject_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AssessmentProjectResource + AssessmentProjectCollection collection = resourceGroupResource.GetAssessmentProjects(); + + // invoke the operation and iterate over the result + await foreach (AssessmentProjectResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessmentProjectData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AssessmentProjectsOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProject_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AssessmentProjectResource + AssessmentProjectCollection collection = resourceGroupResource.GetAssessmentProjects(); + + // invoke the operation + string projectName = "sakanwar1204project"; + bool result = await collection.ExistsAsync(projectName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AssessmentProjectsOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProject_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AssessmentProjectResource + AssessmentProjectCollection collection = resourceGroupResource.GetAssessmentProjects(); + + // invoke the operation + string projectName = "sakanwar1204project"; + NullableResponse response = await collection.GetIfExistsAsync(projectName); + AssessmentProjectResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessmentProjectData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectResource.cs new file mode 100644 index 000000000000..9e95c5b17e0e --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectResource.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AssessmentProjectResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessmentProjectsOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProject_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // invoke the operation + AssessmentProjectResource result = await assessmentProject.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessmentProjectData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_AssessmentProjectsOperationsDelete() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectsOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProject_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "A926B99C-7F4C-4556-871E-20CB8C6ADB56"; + string resourceGroupName = "rgmigrate"; + string projectName = "zqrsyncwahgydqvwuchkfd"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // invoke the operation + await assessmentProject.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_AssessmentProjectsOperationsUpdate() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectsOperations_Update_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProject_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // invoke the operation + AssessmentProjectData data = new AssessmentProjectData(default) + { + Properties = new ProjectProperties + { + AssessmentSolutionId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa", + ProjectStatus = ProjectStatus.Active, + PublicNetworkAccess = "Disabled", + CustomerStorageAccountArmId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa", + }, + Tags = +{ +["Migrate Project"] = "sakanwar-PE-SEA" +}, + }; + ArmOperation lro = await assessmentProject.UpdateAsync(WaitUntil.Completed, data); + AssessmentProjectResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessmentProjectData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectSummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectSummaryCollection.cs new file mode 100644 index 000000000000..00953c54cb68 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectSummaryCollection.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AssessmentProjectSummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessmentProjectSummaryOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProjectSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "piyushapp1"; + string projectName = "PiyushApp15328project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this AssessmentProjectSummaryResource + AssessmentProjectSummaryCollection collection = assessmentProject.GetAssessmentProjectSummaries(); + + // invoke the operation + string projectSummaryName = "default"; + AssessmentProjectSummaryResource result = await collection.GetAsync(projectSummaryName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessmentProjectSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AssessmentProjectSummaryOperationsListByParent() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectSummaryOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProjectSummary_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "piyushapp1"; + string projectName = "PiyushApp15328project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this AssessmentProjectSummaryResource + AssessmentProjectSummaryCollection collection = assessmentProject.GetAssessmentProjectSummaries(); + + // invoke the operation and iterate over the result + await foreach (AssessmentProjectSummaryResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessmentProjectSummaryData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AssessmentProjectSummaryOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProjectSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "piyushapp1"; + string projectName = "PiyushApp15328project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this AssessmentProjectSummaryResource + AssessmentProjectSummaryCollection collection = assessmentProject.GetAssessmentProjectSummaries(); + + // invoke the operation + string projectSummaryName = "default"; + bool result = await collection.ExistsAsync(projectSummaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AssessmentProjectSummaryOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProjectSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "piyushapp1"; + string projectName = "PiyushApp15328project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this AssessmentProjectSummaryResource + AssessmentProjectSummaryCollection collection = assessmentProject.GetAssessmentProjectSummaries(); + + // invoke the operation + string projectSummaryName = "default"; + NullableResponse response = await collection.GetIfExistsAsync(projectSummaryName); + AssessmentProjectSummaryResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessmentProjectSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectSummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectSummaryResource.cs new file mode 100644 index 000000000000..16db2ea0bc54 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectSummaryResource.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AssessmentProjectSummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessmentProjectSummaryOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProjectSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectSummaryResource created on azure + // for more information of creating AssessmentProjectSummaryResource, please refer to the document of AssessmentProjectSummaryResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "piyushapp1"; + string projectName = "PiyushApp15328project"; + string projectSummaryName = "default"; + ResourceIdentifier assessmentProjectSummaryResourceId = AssessmentProjectSummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, projectSummaryName); + AssessmentProjectSummaryResource assessmentProjectSummary = client.GetAssessmentProjectSummaryResource(assessmentProjectSummaryResourceId); + + // invoke the operation + AssessmentProjectSummaryResource result = await assessmentProjectSummary.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessmentProjectSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessedMachineV2Collection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessedMachineV2Collection.cs new file mode 100644 index 000000000000..435039d9d30c --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessedMachineV2Collection.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AvsAssessedMachineV2Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsAssessedMachinesV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessedMachinesV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessedMachineV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsAssessmentV2Resource created on azure + // for more information of creating AvsAssessmentV2Resource, please refer to the document of AvsAssessmentV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier avsAssessmentV2ResourceId = AvsAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AvsAssessmentV2Resource avsAssessmentV2 = client.GetAvsAssessmentV2Resource(avsAssessmentV2ResourceId); + + // get the collection of this AvsAssessedMachineV2Resource + AvsAssessedMachineV2Collection collection = avsAssessmentV2.GetAvsAssessedMachineV2s(); + + // invoke the operation + string avsAssessedMachineName = "machine1"; + AvsAssessedMachineV2Resource result = await collection.GetAsync(avsAssessedMachineName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsAssessedMachineV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AvsAssessedMachinesV2OperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessedMachinesV2Operations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessedMachineV2_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsAssessmentV2Resource created on azure + // for more information of creating AvsAssessmentV2Resource, please refer to the document of AvsAssessmentV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier avsAssessmentV2ResourceId = AvsAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AvsAssessmentV2Resource avsAssessmentV2 = client.GetAvsAssessmentV2Resource(avsAssessmentV2ResourceId); + + // get the collection of this AvsAssessedMachineV2Resource + AvsAssessedMachineV2Collection collection = avsAssessmentV2.GetAvsAssessedMachineV2s(); + + // invoke the operation and iterate over the result + int? pageSize = 26; + string continuationToken = "vhdrqptyyromhgz"; + int? totalRecordCount = 7; + await foreach (AvsAssessedMachineV2Resource item in collection.GetAllAsync(pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsAssessedMachineV2Data resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AvsAssessedMachinesV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessedMachinesV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessedMachineV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsAssessmentV2Resource created on azure + // for more information of creating AvsAssessmentV2Resource, please refer to the document of AvsAssessmentV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier avsAssessmentV2ResourceId = AvsAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AvsAssessmentV2Resource avsAssessmentV2 = client.GetAvsAssessmentV2Resource(avsAssessmentV2ResourceId); + + // get the collection of this AvsAssessedMachineV2Resource + AvsAssessedMachineV2Collection collection = avsAssessmentV2.GetAvsAssessedMachineV2s(); + + // invoke the operation + string avsAssessedMachineName = "machine1"; + bool result = await collection.ExistsAsync(avsAssessedMachineName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AvsAssessedMachinesV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessedMachinesV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessedMachineV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsAssessmentV2Resource created on azure + // for more information of creating AvsAssessmentV2Resource, please refer to the document of AvsAssessmentV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier avsAssessmentV2ResourceId = AvsAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AvsAssessmentV2Resource avsAssessmentV2 = client.GetAvsAssessmentV2Resource(avsAssessmentV2ResourceId); + + // get the collection of this AvsAssessedMachineV2Resource + AvsAssessedMachineV2Collection collection = avsAssessmentV2.GetAvsAssessedMachineV2s(); + + // invoke the operation + string avsAssessedMachineName = "machine1"; + NullableResponse response = await collection.GetIfExistsAsync(avsAssessedMachineName); + AvsAssessedMachineV2Resource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsAssessedMachineV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessedMachineV2Resource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessedMachineV2Resource.cs new file mode 100644 index 000000000000..61cc94628207 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessedMachineV2Resource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AvsAssessedMachineV2Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsAssessedMachinesV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessedMachinesV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessedMachineV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsAssessedMachineV2Resource created on azure + // for more information of creating AvsAssessedMachineV2Resource, please refer to the document of AvsAssessedMachineV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + string avsAssessedMachineName = "machine1"; + ResourceIdentifier avsAssessedMachineV2ResourceId = AvsAssessedMachineV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, avsAssessedMachineName); + AvsAssessedMachineV2Resource avsAssessedMachineV2 = client.GetAvsAssessedMachineV2Resource(avsAssessedMachineV2ResourceId); + + // invoke the operation + AvsAssessedMachineV2Resource result = await avsAssessedMachineV2.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsAssessedMachineV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2Collection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2Collection.cs new file mode 100644 index 000000000000..629cfccbc8df --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2Collection.cs @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AvsAssessmentV2Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_AvsAssessmentsV2OperationsCreateMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentsV2Operations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AvsAssessmentV2Resource + string projectName = "contosoProject"; + AvsAssessmentV2Collection collection = resourceGroupResource.GetAvsAssessmentV2s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + AvsAssessmentV2Data data = new AvsAssessmentV2Data + { + Properties = new AvsAssessmentPropertiesV2 + { + Scope = new Scope + { + ScopeType = ScopeType.ServerGroupId, + ServerGroupId = "fxonspfmzfuiaepr", + AzureResourceGraphQuery = "ylnfwgptlyzwzkotmunbx", + }, + Settings = new AvsAssessmentSettings + { + AzureLocation = "actuloeieva", + Currency = AzureCurrency.Unknown, + ScalingFactor = 28F, + DiscountPercentage = 27F, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased, + PerformanceData = new PerformanceData + { + Percentile = new Percentile("Unknown"), + TimeRange = TimeRange.Day, + PerfDataStartOn = DateTimeOffset.Parse("2025-02-21T05:36:34.751Z"), + PerfDataEndOn = DateTimeOffset.Parse("2025-02-21T05:36:34.751Z"), + }, + SavingsSettings = new SavingsSettings + { + SavingsOptions = SavingsOption.None, + AzureOfferCode = AzureOffer.Unknown, + }, + BillingSettings = new BillingSettings + { + LicensingProgram = LicensingProgram.Retail, + SubscriptionId = "xvtuenxmmjuqlhgmvev", + }, + EnvironmentType = EnvironmentType.Production, + FailuresToTolerateAndRaidLevelList = { FttAndRaidLevel.Unknown }, + VcpuOversubscription = 25F, + NodeTypes = { AzureAvsNodeType.Unknown }, + AvsAssessmentScenario = AvsAssessmentScenario.Unknown, + ExternalStorageTypes = { ExternalStorageType.Unknown }, + CpuHeadroom = 27F, + IsVcfByolEnabled = true, + MemOvercommit = 11F, + DedupeCompression = 26F, + IsStretchClusterEnabled = true, + }, + Details = new AssessmentDetails(), + FallbackMachineAssessmentArmId = "tpjvxfcyxsgngqdxyrrfh", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, assessmentName, data); + AvsAssessmentV2Resource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsAssessmentV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsAssessmentsV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentsV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AvsAssessmentV2Resource + string projectName = "contosoProject"; + AvsAssessmentV2Collection collection = resourceGroupResource.GetAvsAssessmentV2s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + AvsAssessmentV2Resource result = await collection.GetAsync(assessmentName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsAssessmentV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AvsAssessmentsV2OperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentsV2Operations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AvsAssessmentV2Resource + string projectName = "contosoProject"; + AvsAssessmentV2Collection collection = resourceGroupResource.GetAvsAssessmentV2s(projectName); + + // invoke the operation and iterate over the result + await foreach (AvsAssessmentV2Resource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsAssessmentV2Data resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AvsAssessmentsV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentsV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AvsAssessmentV2Resource + string projectName = "contosoProject"; + AvsAssessmentV2Collection collection = resourceGroupResource.GetAvsAssessmentV2s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + bool result = await collection.ExistsAsync(assessmentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AvsAssessmentsV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentsV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AvsAssessmentV2Resource + string projectName = "contosoProject"; + AvsAssessmentV2Collection collection = resourceGroupResource.GetAvsAssessmentV2s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + NullableResponse response = await collection.GetIfExistsAsync(assessmentName); + AvsAssessmentV2Resource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsAssessmentV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2Resource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2Resource.cs new file mode 100644 index 000000000000..601aa062faa2 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2Resource.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AvsAssessmentV2Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsAssessmentsV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentsV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsAssessmentV2Resource created on azure + // for more information of creating AvsAssessmentV2Resource, please refer to the document of AvsAssessmentV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier avsAssessmentV2ResourceId = AvsAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AvsAssessmentV2Resource avsAssessmentV2 = client.GetAvsAssessmentV2Resource(avsAssessmentV2ResourceId); + + // invoke the operation + AvsAssessmentV2Resource result = await avsAssessmentV2.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsAssessmentV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_AvsAssessmentsV2OperationsDeleteMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentsV2Operations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsAssessmentV2Resource created on azure + // for more information of creating AvsAssessmentV2Resource, please refer to the document of AvsAssessmentV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier avsAssessmentV2ResourceId = AvsAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AvsAssessmentV2Resource avsAssessmentV2 = client.GetAvsAssessmentV2Resource(avsAssessmentV2ResourceId); + + // invoke the operation + await avsAssessmentV2.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_AvsAssessmentsV2OperationsCreateMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentsV2Operations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsAssessmentV2Resource created on azure + // for more information of creating AvsAssessmentV2Resource, please refer to the document of AvsAssessmentV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier avsAssessmentV2ResourceId = AvsAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AvsAssessmentV2Resource avsAssessmentV2 = client.GetAvsAssessmentV2Resource(avsAssessmentV2ResourceId); + + // invoke the operation + AvsAssessmentV2Data data = new AvsAssessmentV2Data + { + Properties = new AvsAssessmentPropertiesV2 + { + Scope = new Scope + { + ScopeType = ScopeType.ServerGroupId, + ServerGroupId = "fxonspfmzfuiaepr", + AzureResourceGraphQuery = "ylnfwgptlyzwzkotmunbx", + }, + Settings = new AvsAssessmentSettings + { + AzureLocation = "actuloeieva", + Currency = AzureCurrency.Unknown, + ScalingFactor = 28F, + DiscountPercentage = 27F, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased, + PerformanceData = new PerformanceData + { + Percentile = new Percentile("Unknown"), + TimeRange = TimeRange.Day, + PerfDataStartOn = DateTimeOffset.Parse("2025-02-21T05:36:34.751Z"), + PerfDataEndOn = DateTimeOffset.Parse("2025-02-21T05:36:34.751Z"), + }, + SavingsSettings = new SavingsSettings + { + SavingsOptions = SavingsOption.None, + AzureOfferCode = AzureOffer.Unknown, + }, + BillingSettings = new BillingSettings + { + LicensingProgram = LicensingProgram.Retail, + SubscriptionId = "xvtuenxmmjuqlhgmvev", + }, + EnvironmentType = EnvironmentType.Production, + FailuresToTolerateAndRaidLevelList = { FttAndRaidLevel.Unknown }, + VcpuOversubscription = 25F, + NodeTypes = { AzureAvsNodeType.Unknown }, + AvsAssessmentScenario = AvsAssessmentScenario.Unknown, + ExternalStorageTypes = { ExternalStorageType.Unknown }, + CpuHeadroom = 27F, + IsVcfByolEnabled = true, + MemOvercommit = 11F, + DedupeCompression = 26F, + IsStretchClusterEnabled = true, + }, + Details = new AssessmentDetails(), + FallbackMachineAssessmentArmId = "tpjvxfcyxsgngqdxyrrfh", + }, + }; + ArmOperation lro = await avsAssessmentV2.UpdateAsync(WaitUntil.Completed, data); + AvsAssessmentV2Resource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsAssessmentV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task DownloadUrl_GetDownloadURLForTheAssessmentReport() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentsV2Operations_DownloadUrl_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentsV2Operations_DownloadUrl" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsAssessmentV2Resource created on azure + // for more information of creating AvsAssessmentV2Resource, please refer to the document of AvsAssessmentV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier avsAssessmentV2ResourceId = AvsAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AvsAssessmentV2Resource avsAssessmentV2 = client.GetAvsAssessmentV2Resource(avsAssessmentV2ResourceId); + + // invoke the operation + DownloadUrlContent content = new DownloadUrlContent(); + ArmOperation lro = await avsAssessmentV2.DownloadUrlAsync(WaitUntil.Completed, content); + DownloadUri result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2SummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2SummaryCollection.cs new file mode 100644 index 000000000000..f7e880aa6171 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2SummaryCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AvsAssessmentV2SummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsAssessmentV2SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsAssessmentV2Resource created on azure + // for more information of creating AvsAssessmentV2Resource, please refer to the document of AvsAssessmentV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier avsAssessmentV2ResourceId = AvsAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AvsAssessmentV2Resource avsAssessmentV2 = client.GetAvsAssessmentV2Resource(avsAssessmentV2ResourceId); + + // get the collection of this AvsAssessmentV2SummaryResource + AvsAssessmentV2SummaryCollection collection = avsAssessmentV2.GetAvsAssessmentV2Summaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + AvsAssessmentV2SummaryResource result = await collection.GetAsync(summaryName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsAssessmentV2SummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AvsAssessmentV2SummaryOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentV2SummaryOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2Summary_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsAssessmentV2Resource created on azure + // for more information of creating AvsAssessmentV2Resource, please refer to the document of AvsAssessmentV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier avsAssessmentV2ResourceId = AvsAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AvsAssessmentV2Resource avsAssessmentV2 = client.GetAvsAssessmentV2Resource(avsAssessmentV2ResourceId); + + // get the collection of this AvsAssessmentV2SummaryResource + AvsAssessmentV2SummaryCollection collection = avsAssessmentV2.GetAvsAssessmentV2Summaries(); + + // invoke the operation and iterate over the result + await foreach (AvsAssessmentV2SummaryResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsAssessmentV2SummaryData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AvsAssessmentV2SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsAssessmentV2Resource created on azure + // for more information of creating AvsAssessmentV2Resource, please refer to the document of AvsAssessmentV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier avsAssessmentV2ResourceId = AvsAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AvsAssessmentV2Resource avsAssessmentV2 = client.GetAvsAssessmentV2Resource(avsAssessmentV2ResourceId); + + // get the collection of this AvsAssessmentV2SummaryResource + AvsAssessmentV2SummaryCollection collection = avsAssessmentV2.GetAvsAssessmentV2Summaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + bool result = await collection.ExistsAsync(summaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AvsAssessmentV2SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsAssessmentV2Resource created on azure + // for more information of creating AvsAssessmentV2Resource, please refer to the document of AvsAssessmentV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier avsAssessmentV2ResourceId = AvsAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AvsAssessmentV2Resource avsAssessmentV2 = client.GetAvsAssessmentV2Resource(avsAssessmentV2ResourceId); + + // get the collection of this AvsAssessmentV2SummaryResource + AvsAssessmentV2SummaryCollection collection = avsAssessmentV2.GetAvsAssessmentV2Summaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + NullableResponse response = await collection.GetIfExistsAsync(summaryName); + AvsAssessmentV2SummaryResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsAssessmentV2SummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2SummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2SummaryResource.cs new file mode 100644 index 000000000000..57e0a7ddd7f3 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2SummaryResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AvsAssessmentV2SummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsAssessmentV2SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsAssessmentV2SummaryResource created on azure + // for more information of creating AvsAssessmentV2SummaryResource, please refer to the document of AvsAssessmentV2SummaryResource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + string summaryName = "PaaSPreferred"; + ResourceIdentifier avsAssessmentV2SummaryResourceId = AvsAssessmentV2SummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, summaryName); + AvsAssessmentV2SummaryResource avsAssessmentV2Summary = client.GetAvsAssessmentV2SummaryResource(avsAssessmentV2SummaryResourceId); + + // invoke the operation + AvsAssessmentV2SummaryResource result = await avsAssessmentV2Summary.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsAssessmentV2SummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsGraphAssessmentOptionCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsGraphAssessmentOptionCollection.cs new file mode 100644 index 000000000000..4ff9257e4c6c --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsGraphAssessmentOptionCollection.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AvsGraphAssessmentOptionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AvsGraphAssessmentOptionResource + string projectName = "contosoProject"; + AvsGraphAssessmentOptionCollection collection = resourceGroupResource.GetAvsGraphAssessmentOptions(projectName); + + // invoke the operation + AvsGraphAssessmentOptionResource result = await collection.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsGraphAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_AvsGraphAssessmentOptionsOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsGraphAssessmentOptionsOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AvsGraphAssessmentOptions_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AvsGraphAssessmentOptionResource + string projectName = "contosoProject"; + AvsGraphAssessmentOptionCollection collection = resourceGroupResource.GetAvsGraphAssessmentOptions(projectName); + + // invoke the operation and iterate over the result + await foreach (AvsGraphAssessmentOptionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsGraphAssessmentOptionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_AvsGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AvsGraphAssessmentOptionResource + string projectName = "contosoProject"; + AvsGraphAssessmentOptionCollection collection = resourceGroupResource.GetAvsGraphAssessmentOptions(projectName); + + // invoke the operation + bool result = await collection.ExistsAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AvsGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AvsGraphAssessmentOptionResource + string projectName = "contosoProject"; + AvsGraphAssessmentOptionCollection collection = resourceGroupResource.GetAvsGraphAssessmentOptions(projectName); + + // invoke the operation + NullableResponse response = await collection.GetIfExistsAsync(); + AvsGraphAssessmentOptionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsGraphAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsGraphAssessmentOptionResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsGraphAssessmentOptionResource.cs new file mode 100644 index 000000000000..c02bcabeadcb --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsGraphAssessmentOptionResource.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AvsGraphAssessmentOptionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsGraphAssessmentOptionResource created on azure + // for more information of creating AvsGraphAssessmentOptionResource, please refer to the document of AvsGraphAssessmentOptionResource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + ResourceIdentifier avsGraphAssessmentOptionResourceId = AvsGraphAssessmentOptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AvsGraphAssessmentOptionResource avsGraphAssessmentOption = client.GetAvsGraphAssessmentOptionResource(avsGraphAssessmentOptionResourceId); + + // invoke the operation + AvsGraphAssessmentOptionResource result = await avsGraphAssessmentOption.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsGraphAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsSummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsSummaryCollection.cs new file mode 100644 index 000000000000..e247255583a2 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsSummaryCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AvsSummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BusinessCaseAvsSummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseAvsSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this AvsSummaryResource + AvsSummaryCollection collection = businessCase.GetAvsSummaries(); + + // invoke the operation + string avsSummaryName = "MySummary"; + AvsSummaryResource result = await collection.GetAsync(avsSummaryName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_BusinessCaseAvsSummaryOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseAvsSummaryOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AvsSummary_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this AvsSummaryResource + AvsSummaryCollection collection = businessCase.GetAvsSummaries(); + + // invoke the operation and iterate over the result + await foreach (AvsSummaryResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsSummaryData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_BusinessCaseAvsSummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseAvsSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this AvsSummaryResource + AvsSummaryCollection collection = businessCase.GetAvsSummaries(); + + // invoke the operation + string avsSummaryName = "MySummary"; + bool result = await collection.ExistsAsync(avsSummaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_BusinessCaseAvsSummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseAvsSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this AvsSummaryResource + AvsSummaryCollection collection = businessCase.GetAvsSummaries(); + + // invoke the operation + string avsSummaryName = "MySummary"; + NullableResponse response = await collection.GetIfExistsAsync(avsSummaryName); + AvsSummaryResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsSummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsSummaryResource.cs new file mode 100644 index 000000000000..6c6523791c57 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsSummaryResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AvsSummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BusinessCaseAvsSummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseAvsSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsSummaryResource created on azure + // for more information of creating AvsSummaryResource, please refer to the document of AvsSummaryResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + string avsSummaryName = "MySummary"; + ResourceIdentifier avsSummaryResourceId = AvsSummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName, avsSummaryName); + AvsSummaryResource avsSummary = client.GetAvsSummaryResource(avsSummaryResourceId); + + // invoke the operation + AvsSummaryResource result = await avsSummary.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvsSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_BusinessCaseCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_BusinessCaseCollection.cs new file mode 100644 index 000000000000..bfcdab882c04 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_BusinessCaseCollection.cs @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_BusinessCaseCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_BusinessCaseOperationsCreateMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "BusinessCase_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this BusinessCaseResource + string projectName = "MyMigrateProject"; + BusinessCaseCollection collection = resourceGroupResource.GetBusinessCases(projectName); + + // invoke the operation + string businessCaseName = "MyBusinessCase"; + BusinessCaseData data = new BusinessCaseData + { + Properties = new BusinessCaseProperties + { + Settings = new Settings(new AzureSettings("hpocokeckktxpzilk", BusinessCaseCurrency.Unknown) + { + DiscountPercentage = 48F, + BusinessCaseType = MigrationStrategy.Unknown, + WorkloadDiscoverySource = DiscoverySource.Unknown, + PerformanceDataStartOn = DateTimeOffset.Parse("2024-11-14T10:27:58.436Z"), + PerformanceDataEndOn = DateTimeOffset.Parse("2024-11-14T10:27:58.436Z"), + ComfortFactor = 19F, + PerformanceUtilizationPercentile = 93F, + PerYearMigrationCompletionPercentage = {new NameValuePair +{ +Name = "cthxvjhedpsnbddvyghswtgp", +Value = 13F, +}}, + InfrastructureGrowthRate = 79F, + Wacc = 43F, + NetworkCostPercentage = 81F, + IaasLaborCostPercentage = 51F, + PaasLaborCostPercentage = 13F, + AvsLaborCostPercentage = 2F, + SavingsOption = SavingsOption.Unknown, + }) + { + OnPremiseSettings = new OnPremiseSettings( + new ComputeSettings( + 26F, + 8F, + 1F, + 10F, + 10F, + new SqlServerLicensingSettings[] + { +new SqlServerLicensingSettings(SqlServerLicenseType.Unknown, 28F, 27F) + }, + new WindowsServerLicensingSettings(2F, 6F, 21), + new LinuxServerLicensingSettings(7F), + new LinuxServerLicensingSettings(7F), + new VirtualizationSoftwareSettings(23F)), + new StorageSettings(12F, 5F), + new NetworkSettings(84F, 18, 27F), + new FacilitySettings(25F) + { + FacilitiesCostPerKwh = 1F, + }, + new LaborSettings(16, 18, 22F), + new SecuritySettings(6F, 10F)) + { + ManagementSettings = new ManagementSettings(new HypervVirtualizationManagementSettings(8, 15F, new HypervLicense[] + { +new HypervLicense(1F, HyperVLicenseType.Unknown) + }), new ThirdPartyManagementSettings(1F, 13F), new OtherManagementCostsSettings(2F, 28F, 4F)), + }, + AzureArcSettings = new AzureArcSettings(AzureArcState.Disabled) + { + LaborCostPercentage = 46F, + ManagementMonitoringSettings = new AzureArcMonitoringSettings(17F, 19), + }, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, businessCaseName, data); + BusinessCaseResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BusinessCaseData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BusinessCaseOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BusinessCase_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this BusinessCaseResource + string projectName = "MyMigrateProject"; + BusinessCaseCollection collection = resourceGroupResource.GetBusinessCases(projectName); + + // invoke the operation + string businessCaseName = "MyBusinessCase"; + BusinessCaseResource result = await collection.GetAsync(businessCaseName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BusinessCaseData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_BusinessCaseOperationsListByParentMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "BusinessCase_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this BusinessCaseResource + string projectName = "MyMigrateProject"; + BusinessCaseCollection collection = resourceGroupResource.GetBusinessCases(projectName); + + // invoke the operation and iterate over the result + await foreach (BusinessCaseResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BusinessCaseData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_BusinessCaseOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BusinessCase_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this BusinessCaseResource + string projectName = "MyMigrateProject"; + BusinessCaseCollection collection = resourceGroupResource.GetBusinessCases(projectName); + + // invoke the operation + string businessCaseName = "MyBusinessCase"; + bool result = await collection.ExistsAsync(businessCaseName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_BusinessCaseOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BusinessCase_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this BusinessCaseResource + string projectName = "MyMigrateProject"; + BusinessCaseCollection collection = resourceGroupResource.GetBusinessCases(projectName); + + // invoke the operation + string businessCaseName = "MyBusinessCase"; + NullableResponse response = await collection.GetIfExistsAsync(businessCaseName); + BusinessCaseResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BusinessCaseData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_BusinessCaseResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_BusinessCaseResource.cs new file mode 100644 index 000000000000..c39f4f6e56fa --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_BusinessCaseResource.cs @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_BusinessCaseResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BusinessCaseOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BusinessCase_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // invoke the operation + BusinessCaseResource result = await businessCase.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BusinessCaseData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_BusinessCaseOperationsDeleteMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "BusinessCase_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // invoke the operation + await businessCase.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_BusinessCaseOperationsCreateMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "BusinessCase_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // invoke the operation + BusinessCaseData data = new BusinessCaseData + { + Properties = new BusinessCaseProperties + { + Settings = new Settings(new AzureSettings("hpocokeckktxpzilk", BusinessCaseCurrency.Unknown) + { + DiscountPercentage = 48F, + BusinessCaseType = MigrationStrategy.Unknown, + WorkloadDiscoverySource = DiscoverySource.Unknown, + PerformanceDataStartOn = DateTimeOffset.Parse("2024-11-14T10:27:58.436Z"), + PerformanceDataEndOn = DateTimeOffset.Parse("2024-11-14T10:27:58.436Z"), + ComfortFactor = 19F, + PerformanceUtilizationPercentile = 93F, + PerYearMigrationCompletionPercentage = {new NameValuePair +{ +Name = "cthxvjhedpsnbddvyghswtgp", +Value = 13F, +}}, + InfrastructureGrowthRate = 79F, + Wacc = 43F, + NetworkCostPercentage = 81F, + IaasLaborCostPercentage = 51F, + PaasLaborCostPercentage = 13F, + AvsLaborCostPercentage = 2F, + SavingsOption = SavingsOption.Unknown, + }) + { + OnPremiseSettings = new OnPremiseSettings( + new ComputeSettings( + 26F, + 8F, + 1F, + 10F, + 10F, + new SqlServerLicensingSettings[] + { +new SqlServerLicensingSettings(SqlServerLicenseType.Unknown, 28F, 27F) + }, + new WindowsServerLicensingSettings(2F, 6F, 21), + new LinuxServerLicensingSettings(7F), + new LinuxServerLicensingSettings(7F), + new VirtualizationSoftwareSettings(23F)), + new StorageSettings(12F, 5F), + new NetworkSettings(84F, 18, 27F), + new FacilitySettings(25F) + { + FacilitiesCostPerKwh = 1F, + }, + new LaborSettings(16, 18, 22F), + new SecuritySettings(6F, 10F)) + { + ManagementSettings = new ManagementSettings(new HypervVirtualizationManagementSettings(8, 15F, new HypervLicense[] + { +new HypervLicense(1F, HyperVLicenseType.Unknown) + }), new ThirdPartyManagementSettings(1F, 13F), new OtherManagementCostsSettings(2F, 28F, 4F)), + }, + AzureArcSettings = new AzureArcSettings(AzureArcState.Disabled) + { + LaborCostPercentage = 46F, + ManagementMonitoringSettings = new AzureArcMonitoringSettings(17F, 19), + }, + }, + }, + }; + ArmOperation lro = await businessCase.UpdateAsync(WaitUntil.Completed, data); + BusinessCaseResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BusinessCaseData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CompareSummary_GetCompareSummaryReportForBusinessCase() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOperations_CompareSummary_MaximumSet_Gen.json + // this example is just showing the usage of "BusinessCaseOperations_CompareSummary" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // invoke the operation + CompareSummaryContent content = new CompareSummaryContent(); + ArmOperation lro = await businessCase.CompareSummaryAsync(WaitUntil.Completed, content); + CompareSummary result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetReportDownloadUrl_GetDownloadURLForTheBusinessCaseReportGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOperations_GetReportDownloadUrl_MaximumSet_Gen.json + // this example is just showing the usage of "BusinessCaseOperations_GetReportDownloadUrl" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // invoke the operation + GetReportDownloadUrlContent content = new GetReportDownloadUrlContent(); + ArmOperation lro = await businessCase.GetReportDownloadUrlAsync(WaitUntil.Completed, content); + ReportDownloadUri result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_CompoundAssessmentCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_CompoundAssessmentCollection.cs new file mode 100644 index 000000000000..86d04d3073fb --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_CompoundAssessmentCollection.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_CompoundAssessmentCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CompoundAssessmentOperationsCreate() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "CompoundAssessment_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this CompoundAssessmentResource + string projectName = "contosoProject"; + CompoundAssessmentCollection collection = resourceGroupResource.GetCompoundAssessments(projectName); + + // invoke the operation + string compoundAssessmentName = "assessmentName"; + CompoundAssessmentData data = new CompoundAssessmentData + { + Properties = new CompoundAssessmentProperties(new TargetAssessmentArmIds + { + Aks = "/subscriptions/6898488D-BBF0-40FC-A5E3-3DF2C00C5F21/resourceGroups/rgwebAppCompoundAssessments/providers/Microsoft.Migrate/assessmentprojects/contosoProject/aksAssessments/nameOfAssessment", + AzureAppService = "/subscriptions/6898488D-BBF0-40FC-A5E3-3DF2C00C5F21/resourceGroups/rgwebAppCompoundAssessments/providers/Microsoft.Migrate/assessmentprojects/contosoProject/webAppAssessments/nameOfAssessment", + AzureAppServiceContainer = "/subscriptions/6898488D-BBF0-40FC-A5E3-3DF2C00C5F21/resourceGroups/rgwebAppCompoundAssessments/providers/Microsoft.Migrate/assessmentprojects/contosoProject/webAppAssessments/nameOfAssessment", + }) + { + FallbackMachineAssessmentArmId = "/subscriptions/6898488D-BBF0-40FC-A5E3-3DF2C00C5F21/resourceGroups/rgwebAppCompoundAssessments/providers/Microsoft.Migrate/assessmentprojects/contosoProject/assessments/nameOfAssessment", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, compoundAssessmentName, data); + CompoundAssessmentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CompoundAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CompoundAssessmentOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "CompoundAssessment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this CompoundAssessmentResource + string projectName = "contosoProject"; + CompoundAssessmentCollection collection = resourceGroupResource.GetCompoundAssessments(projectName); + + // invoke the operation + string compoundAssessmentName = "assessmentName"; + CompoundAssessmentResource result = await collection.GetAsync(compoundAssessmentName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CompoundAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_CompoundAssessmentOperationsListByParent() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "CompoundAssessment_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this CompoundAssessmentResource + string projectName = "contosoProject"; + CompoundAssessmentCollection collection = resourceGroupResource.GetCompoundAssessments(projectName); + + // invoke the operation and iterate over the result + await foreach (CompoundAssessmentResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CompoundAssessmentData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_CompoundAssessmentOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "CompoundAssessment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this CompoundAssessmentResource + string projectName = "contosoProject"; + CompoundAssessmentCollection collection = resourceGroupResource.GetCompoundAssessments(projectName); + + // invoke the operation + string compoundAssessmentName = "assessmentName"; + bool result = await collection.ExistsAsync(compoundAssessmentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_CompoundAssessmentOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "CompoundAssessment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this CompoundAssessmentResource + string projectName = "contosoProject"; + CompoundAssessmentCollection collection = resourceGroupResource.GetCompoundAssessments(projectName); + + // invoke the operation + string compoundAssessmentName = "assessmentName"; + NullableResponse response = await collection.GetIfExistsAsync(compoundAssessmentName); + CompoundAssessmentResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CompoundAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_CompoundAssessmentResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_CompoundAssessmentResource.cs new file mode 100644 index 000000000000..ac077129ae27 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_CompoundAssessmentResource.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_CompoundAssessmentResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CompoundAssessmentOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "CompoundAssessment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CompoundAssessmentResource created on azure + // for more information of creating CompoundAssessmentResource, please refer to the document of CompoundAssessmentResource + string subscriptionId = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + string projectName = "contosoProject"; + string compoundAssessmentName = "assessmentName"; + ResourceIdentifier compoundAssessmentResourceId = CompoundAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + CompoundAssessmentResource compoundAssessment = client.GetCompoundAssessmentResource(compoundAssessmentResourceId); + + // invoke the operation + CompoundAssessmentResource result = await compoundAssessment.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CompoundAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_CompoundAssessmentOperationsDelete() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "CompoundAssessment_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CompoundAssessmentResource created on azure + // for more information of creating CompoundAssessmentResource, please refer to the document of CompoundAssessmentResource + string subscriptionId = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + string projectName = "contosoProject"; + string compoundAssessmentName = "assessmentName"; + ResourceIdentifier compoundAssessmentResourceId = CompoundAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + CompoundAssessmentResource compoundAssessment = client.GetCompoundAssessmentResource(compoundAssessmentResourceId); + + // invoke the operation + await compoundAssessment.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CompoundAssessmentOperationsCreate() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "CompoundAssessment_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CompoundAssessmentResource created on azure + // for more information of creating CompoundAssessmentResource, please refer to the document of CompoundAssessmentResource + string subscriptionId = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + string projectName = "contosoProject"; + string compoundAssessmentName = "assessmentName"; + ResourceIdentifier compoundAssessmentResourceId = CompoundAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + CompoundAssessmentResource compoundAssessment = client.GetCompoundAssessmentResource(compoundAssessmentResourceId); + + // invoke the operation + CompoundAssessmentData data = new CompoundAssessmentData + { + Properties = new CompoundAssessmentProperties(new TargetAssessmentArmIds + { + Aks = "/subscriptions/6898488D-BBF0-40FC-A5E3-3DF2C00C5F21/resourceGroups/rgwebAppCompoundAssessments/providers/Microsoft.Migrate/assessmentprojects/contosoProject/aksAssessments/nameOfAssessment", + AzureAppService = "/subscriptions/6898488D-BBF0-40FC-A5E3-3DF2C00C5F21/resourceGroups/rgwebAppCompoundAssessments/providers/Microsoft.Migrate/assessmentprojects/contosoProject/webAppAssessments/nameOfAssessment", + AzureAppServiceContainer = "/subscriptions/6898488D-BBF0-40FC-A5E3-3DF2C00C5F21/resourceGroups/rgwebAppCompoundAssessments/providers/Microsoft.Migrate/assessmentprojects/contosoProject/webAppAssessments/nameOfAssessment", + }) + { + FallbackMachineAssessmentArmId = "/subscriptions/6898488D-BBF0-40FC-A5E3-3DF2C00C5F21/resourceGroups/rgwebAppCompoundAssessments/providers/Microsoft.Migrate/assessmentprojects/contosoProject/assessments/nameOfAssessment", + }, + }; + ArmOperation lro = await compoundAssessment.UpdateAsync(WaitUntil.Completed, data); + CompoundAssessmentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CompoundAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task DownloadUrl_CompoundAssessmentOperationsDownloadUrl() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentOperations_DownloadUrl_MaximumSet_Gen.json + // this example is just showing the usage of "CompoundAssessmentOperations_DownloadUrl" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CompoundAssessmentResource created on azure + // for more information of creating CompoundAssessmentResource, please refer to the document of CompoundAssessmentResource + string subscriptionId = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + string projectName = "contosoProject"; + string compoundAssessmentName = "assessmentName"; + ResourceIdentifier compoundAssessmentResourceId = CompoundAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + CompoundAssessmentResource compoundAssessment = client.GetCompoundAssessmentResource(compoundAssessmentResourceId); + + // invoke the operation + DownloadUrlContent content = new DownloadUrlContent(); + ArmOperation lro = await compoundAssessment.DownloadUrlAsync(WaitUntil.Completed, content); + DownloadUri result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedAvsMachineCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedAvsMachineCollection.cs new file mode 100644 index 000000000000..5b00bb8813ad --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedAvsMachineCollection.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_EvaluatedAvsMachineCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_EvaluatedAvsMachinesOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedAvsMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedAvsMachine_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedAvsMachineResource + EvaluatedAvsMachineCollection collection = businessCase.GetEvaluatedAvsMachines(); + + // invoke the operation + string evaluatedAvsMachineName = "MyMachine"; + EvaluatedAvsMachineResource result = await collection.GetAsync(evaluatedAvsMachineName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EvaluatedAvsMachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_EvaluatedAvsMachinesOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedAvsMachinesOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedAvsMachine_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedAvsMachineResource + EvaluatedAvsMachineCollection collection = businessCase.GetEvaluatedAvsMachines(); + + // invoke the operation and iterate over the result + int? pageSize = 18; + string continuationToken = "kri"; + int? totalRecordCount = 12; + await foreach (EvaluatedAvsMachineResource item in collection.GetAllAsync(pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EvaluatedAvsMachineData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_EvaluatedAvsMachinesOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedAvsMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedAvsMachine_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedAvsMachineResource + EvaluatedAvsMachineCollection collection = businessCase.GetEvaluatedAvsMachines(); + + // invoke the operation + string evaluatedAvsMachineName = "MyMachine"; + bool result = await collection.ExistsAsync(evaluatedAvsMachineName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_EvaluatedAvsMachinesOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedAvsMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedAvsMachine_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedAvsMachineResource + EvaluatedAvsMachineCollection collection = businessCase.GetEvaluatedAvsMachines(); + + // invoke the operation + string evaluatedAvsMachineName = "MyMachine"; + NullableResponse response = await collection.GetIfExistsAsync(evaluatedAvsMachineName); + EvaluatedAvsMachineResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EvaluatedAvsMachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedAvsMachineResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedAvsMachineResource.cs new file mode 100644 index 000000000000..055ff7c31512 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedAvsMachineResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_EvaluatedAvsMachineResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_EvaluatedAvsMachinesOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedAvsMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedAvsMachine_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EvaluatedAvsMachineResource created on azure + // for more information of creating EvaluatedAvsMachineResource, please refer to the document of EvaluatedAvsMachineResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + string evaluatedAvsMachineName = "MyMachine"; + ResourceIdentifier evaluatedAvsMachineResourceId = EvaluatedAvsMachineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName, evaluatedAvsMachineName); + EvaluatedAvsMachineResource evaluatedAvsMachine = client.GetEvaluatedAvsMachineResource(evaluatedAvsMachineResourceId); + + // invoke the operation + EvaluatedAvsMachineResource result = await evaluatedAvsMachine.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EvaluatedAvsMachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedMachineCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedMachineCollection.cs new file mode 100644 index 000000000000..d26eda4d8104 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedMachineCollection.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_EvaluatedMachineCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_EvaluatedMachinesOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedMachine_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedMachineResource + EvaluatedMachineCollection collection = businessCase.GetEvaluatedMachines(); + + // invoke the operation + string evaluatedMachineName = "MyMachine"; + EvaluatedMachineResource result = await collection.GetAsync(evaluatedMachineName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EvaluatedMachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_EvaluatedMachinesOperationsListByParentMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedMachinesOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedMachine_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedMachineResource + EvaluatedMachineCollection collection = businessCase.GetEvaluatedMachines(); + + // invoke the operation and iterate over the result + int? pageSize = 24; + string continuationToken = "eoevgdmtpkbhlgyglvsa"; + int? totalRecordCount = 6; + await foreach (EvaluatedMachineResource item in collection.GetAllAsync(pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EvaluatedMachineData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_EvaluatedMachinesOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedMachine_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedMachineResource + EvaluatedMachineCollection collection = businessCase.GetEvaluatedMachines(); + + // invoke the operation + string evaluatedMachineName = "MyMachine"; + bool result = await collection.ExistsAsync(evaluatedMachineName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_EvaluatedMachinesOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedMachine_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedMachineResource + EvaluatedMachineCollection collection = businessCase.GetEvaluatedMachines(); + + // invoke the operation + string evaluatedMachineName = "MyMachine"; + NullableResponse response = await collection.GetIfExistsAsync(evaluatedMachineName); + EvaluatedMachineResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EvaluatedMachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedMachineResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedMachineResource.cs new file mode 100644 index 000000000000..cd0e4381cd62 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedMachineResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_EvaluatedMachineResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_EvaluatedMachinesOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedMachine_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EvaluatedMachineResource created on azure + // for more information of creating EvaluatedMachineResource, please refer to the document of EvaluatedMachineResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + string evaluatedMachineName = "MyMachine"; + ResourceIdentifier evaluatedMachineResourceId = EvaluatedMachineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName, evaluatedMachineName); + EvaluatedMachineResource evaluatedMachine = client.GetEvaluatedMachineResource(evaluatedMachineResourceId); + + // invoke the operation + EvaluatedMachineResource result = await evaluatedMachine.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EvaluatedMachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedSqlEntityCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedSqlEntityCollection.cs new file mode 100644 index 000000000000..4ed56435890b --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedSqlEntityCollection.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_EvaluatedSqlEntityCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_EvaluatedSqlEntitiesOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedSqlEntitiesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedSqlEntity_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedSqlEntityResource + EvaluatedSqlEntityCollection collection = businessCase.GetEvaluatedSqlEntities(); + + // invoke the operation + string evaluatedSqlEntityName = "MyEntity"; + EvaluatedSqlEntityResource result = await collection.GetAsync(evaluatedSqlEntityName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EvaluatedSqlEntityData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_EvaluatedSqlEntitiesOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedSqlEntitiesOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedSqlEntity_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedSqlEntityResource + EvaluatedSqlEntityCollection collection = businessCase.GetEvaluatedSqlEntities(); + + // invoke the operation and iterate over the result + int? pageSize = 13; + string continuationToken = "bnmyic"; + int? totalRecordCount = 23; + await foreach (EvaluatedSqlEntityResource item in collection.GetAllAsync(pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EvaluatedSqlEntityData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_EvaluatedSqlEntitiesOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedSqlEntitiesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedSqlEntity_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedSqlEntityResource + EvaluatedSqlEntityCollection collection = businessCase.GetEvaluatedSqlEntities(); + + // invoke the operation + string evaluatedSqlEntityName = "MyEntity"; + bool result = await collection.ExistsAsync(evaluatedSqlEntityName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_EvaluatedSqlEntitiesOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedSqlEntitiesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedSqlEntity_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedSqlEntityResource + EvaluatedSqlEntityCollection collection = businessCase.GetEvaluatedSqlEntities(); + + // invoke the operation + string evaluatedSqlEntityName = "MyEntity"; + NullableResponse response = await collection.GetIfExistsAsync(evaluatedSqlEntityName); + EvaluatedSqlEntityResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EvaluatedSqlEntityData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedSqlEntityResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedSqlEntityResource.cs new file mode 100644 index 000000000000..019076fe6d4d --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedSqlEntityResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_EvaluatedSqlEntityResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_EvaluatedSqlEntitiesOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedSqlEntitiesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedSqlEntity_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EvaluatedSqlEntityResource created on azure + // for more information of creating EvaluatedSqlEntityResource, please refer to the document of EvaluatedSqlEntityResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + string evaluatedSqlEntityName = "MyEntity"; + ResourceIdentifier evaluatedSqlEntityResourceId = EvaluatedSqlEntityResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName, evaluatedSqlEntityName); + EvaluatedSqlEntityResource evaluatedSqlEntity = client.GetEvaluatedSqlEntityResource(evaluatedSqlEntityResourceId); + + // invoke the operation + EvaluatedSqlEntityResource result = await evaluatedSqlEntity.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EvaluatedSqlEntityData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedWebAppCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedWebAppCollection.cs new file mode 100644 index 000000000000..a411b7c71a0f --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedWebAppCollection.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_EvaluatedWebAppCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_EvaluatedWebAppsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedWebAppsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedWebApp_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedWebAppResource + EvaluatedWebAppCollection collection = businessCase.GetEvaluatedWebApps(); + + // invoke the operation + string evaluatedWebAppName = "MyWebApp"; + EvaluatedWebAppResource result = await collection.GetAsync(evaluatedWebAppName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EvaluatedWebAppData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_EvaluatedWebAppsOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedWebAppsOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedWebApp_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedWebAppResource + EvaluatedWebAppCollection collection = businessCase.GetEvaluatedWebApps(); + + // invoke the operation and iterate over the result + int? pageSize = 20; + string continuationToken = "giprsbjufkenlzmqf"; + int? totalRecordCount = 12; + await foreach (EvaluatedWebAppResource item in collection.GetAllAsync(pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EvaluatedWebAppData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_EvaluatedWebAppsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedWebAppsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedWebApp_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedWebAppResource + EvaluatedWebAppCollection collection = businessCase.GetEvaluatedWebApps(); + + // invoke the operation + string evaluatedWebAppName = "MyWebApp"; + bool result = await collection.ExistsAsync(evaluatedWebAppName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_EvaluatedWebAppsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedWebAppsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedWebApp_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedWebAppResource + EvaluatedWebAppCollection collection = businessCase.GetEvaluatedWebApps(); + + // invoke the operation + string evaluatedWebAppName = "MyWebApp"; + NullableResponse response = await collection.GetIfExistsAsync(evaluatedWebAppName); + EvaluatedWebAppResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EvaluatedWebAppData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedWebAppResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedWebAppResource.cs new file mode 100644 index 000000000000..3ebf4f0822f0 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedWebAppResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_EvaluatedWebAppResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_EvaluatedWebAppsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedWebAppsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedWebApp_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EvaluatedWebAppResource created on azure + // for more information of creating EvaluatedWebAppResource, please refer to the document of EvaluatedWebAppResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + string evaluatedWebAppName = "MyWebApp"; + ResourceIdentifier evaluatedWebAppResourceId = EvaluatedWebAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName, evaluatedWebAppName); + EvaluatedWebAppResource evaluatedWebApp = client.GetEvaluatedWebAppResource(evaluatedWebAppResourceId); + + // invoke the operation + EvaluatedWebAppResource result = await evaluatedWebApp.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EvaluatedWebAppData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentCollection.cs new file mode 100644 index 000000000000..de3126bc528c --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentCollection.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_HeterogeneousAssessmentCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_HeterogeneousAssessmentOperationsCreate() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessment_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this HeterogeneousAssessmentResource + string projectName = "contosoProject"; + HeterogeneousAssessmentCollection collection = resourceGroupResource.GetHeterogeneousAssessments(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + HeterogeneousAssessmentData data = new HeterogeneousAssessmentData + { + Properties = new HeterogeneousAssessmentProperties + { + AssessmentArmIds = { "gartykxgfvqccfs" }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, assessmentName, data); + HeterogeneousAssessmentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + HeterogeneousAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_HeterogeneousAssessmentOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this HeterogeneousAssessmentResource + string projectName = "contosoProject"; + HeterogeneousAssessmentCollection collection = resourceGroupResource.GetHeterogeneousAssessments(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + HeterogeneousAssessmentResource result = await collection.GetAsync(assessmentName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + HeterogeneousAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_HeterogeneousAssessmentOperationsListByParent() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessment_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this HeterogeneousAssessmentResource + string projectName = "contosoProject"; + HeterogeneousAssessmentCollection collection = resourceGroupResource.GetHeterogeneousAssessments(projectName); + + // invoke the operation and iterate over the result + await foreach (HeterogeneousAssessmentResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + HeterogeneousAssessmentData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_HeterogeneousAssessmentOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this HeterogeneousAssessmentResource + string projectName = "contosoProject"; + HeterogeneousAssessmentCollection collection = resourceGroupResource.GetHeterogeneousAssessments(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + bool result = await collection.ExistsAsync(assessmentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_HeterogeneousAssessmentOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this HeterogeneousAssessmentResource + string projectName = "contosoProject"; + HeterogeneousAssessmentCollection collection = resourceGroupResource.GetHeterogeneousAssessments(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + NullableResponse response = await collection.GetIfExistsAsync(assessmentName); + HeterogeneousAssessmentResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + HeterogeneousAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentResource.cs new file mode 100644 index 000000000000..fc9135ee77cd --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentResource.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_HeterogeneousAssessmentResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_HeterogeneousAssessmentOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HeterogeneousAssessmentResource created on azure + // for more information of creating HeterogeneousAssessmentResource, please refer to the document of HeterogeneousAssessmentResource + string subscriptionId = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier heterogeneousAssessmentResourceId = HeterogeneousAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + HeterogeneousAssessmentResource heterogeneousAssessment = client.GetHeterogeneousAssessmentResource(heterogeneousAssessmentResourceId); + + // invoke the operation + HeterogeneousAssessmentResource result = await heterogeneousAssessment.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + HeterogeneousAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_HeterogeneousAssessmentOperationsDelete() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessment_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HeterogeneousAssessmentResource created on azure + // for more information of creating HeterogeneousAssessmentResource, please refer to the document of HeterogeneousAssessmentResource + string subscriptionId = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier heterogeneousAssessmentResourceId = HeterogeneousAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + HeterogeneousAssessmentResource heterogeneousAssessment = client.GetHeterogeneousAssessmentResource(heterogeneousAssessmentResourceId); + + // invoke the operation + await heterogeneousAssessment.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_HeterogeneousAssessmentOperationsCreate() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessment_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HeterogeneousAssessmentResource created on azure + // for more information of creating HeterogeneousAssessmentResource, please refer to the document of HeterogeneousAssessmentResource + string subscriptionId = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier heterogeneousAssessmentResourceId = HeterogeneousAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + HeterogeneousAssessmentResource heterogeneousAssessment = client.GetHeterogeneousAssessmentResource(heterogeneousAssessmentResourceId); + + // invoke the operation + HeterogeneousAssessmentData data = new HeterogeneousAssessmentData + { + Properties = new HeterogeneousAssessmentProperties + { + AssessmentArmIds = { "gartykxgfvqccfs" }, + }, + }; + ArmOperation lro = await heterogeneousAssessment.UpdateAsync(WaitUntil.Completed, data); + HeterogeneousAssessmentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + HeterogeneousAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentSummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentSummaryCollection.cs new file mode 100644 index 000000000000..1731b0a1ae97 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentSummaryCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_HeterogeneousAssessmentSummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_HeterogeneousAssessmentSummaryOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessmentSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HeterogeneousAssessmentResource created on azure + // for more information of creating HeterogeneousAssessmentResource, please refer to the document of HeterogeneousAssessmentResource + string subscriptionId = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier heterogeneousAssessmentResourceId = HeterogeneousAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + HeterogeneousAssessmentResource heterogeneousAssessment = client.GetHeterogeneousAssessmentResource(heterogeneousAssessmentResourceId); + + // get the collection of this HeterogeneousAssessmentSummaryResource + HeterogeneousAssessmentSummaryCollection collection = heterogeneousAssessment.GetHeterogeneousAssessmentSummaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + HeterogeneousAssessmentSummaryResource result = await collection.GetAsync(summaryName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + HeterogeneousAssessmentSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_HeterogeneousAssessmentSummaryOperationsListByParent() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentSummaryOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessmentSummary_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HeterogeneousAssessmentResource created on azure + // for more information of creating HeterogeneousAssessmentResource, please refer to the document of HeterogeneousAssessmentResource + string subscriptionId = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier heterogeneousAssessmentResourceId = HeterogeneousAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + HeterogeneousAssessmentResource heterogeneousAssessment = client.GetHeterogeneousAssessmentResource(heterogeneousAssessmentResourceId); + + // get the collection of this HeterogeneousAssessmentSummaryResource + HeterogeneousAssessmentSummaryCollection collection = heterogeneousAssessment.GetHeterogeneousAssessmentSummaries(); + + // invoke the operation and iterate over the result + await foreach (HeterogeneousAssessmentSummaryResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + HeterogeneousAssessmentSummaryData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_HeterogeneousAssessmentSummaryOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessmentSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HeterogeneousAssessmentResource created on azure + // for more information of creating HeterogeneousAssessmentResource, please refer to the document of HeterogeneousAssessmentResource + string subscriptionId = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier heterogeneousAssessmentResourceId = HeterogeneousAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + HeterogeneousAssessmentResource heterogeneousAssessment = client.GetHeterogeneousAssessmentResource(heterogeneousAssessmentResourceId); + + // get the collection of this HeterogeneousAssessmentSummaryResource + HeterogeneousAssessmentSummaryCollection collection = heterogeneousAssessment.GetHeterogeneousAssessmentSummaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + bool result = await collection.ExistsAsync(summaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_HeterogeneousAssessmentSummaryOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessmentSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HeterogeneousAssessmentResource created on azure + // for more information of creating HeterogeneousAssessmentResource, please refer to the document of HeterogeneousAssessmentResource + string subscriptionId = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier heterogeneousAssessmentResourceId = HeterogeneousAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + HeterogeneousAssessmentResource heterogeneousAssessment = client.GetHeterogeneousAssessmentResource(heterogeneousAssessmentResourceId); + + // get the collection of this HeterogeneousAssessmentSummaryResource + HeterogeneousAssessmentSummaryCollection collection = heterogeneousAssessment.GetHeterogeneousAssessmentSummaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + NullableResponse response = await collection.GetIfExistsAsync(summaryName); + HeterogeneousAssessmentSummaryResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + HeterogeneousAssessmentSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentSummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentSummaryResource.cs new file mode 100644 index 000000000000..8d60f7b81cd9 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentSummaryResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_HeterogeneousAssessmentSummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_HeterogeneousAssessmentSummaryOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessmentSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HeterogeneousAssessmentSummaryResource created on azure + // for more information of creating HeterogeneousAssessmentSummaryResource, please refer to the document of HeterogeneousAssessmentSummaryResource + string subscriptionId = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + string summaryName = "PaaSPreferred"; + ResourceIdentifier heterogeneousAssessmentSummaryResourceId = HeterogeneousAssessmentSummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, summaryName); + HeterogeneousAssessmentSummaryResource heterogeneousAssessmentSummary = client.GetHeterogeneousAssessmentSummaryResource(heterogeneousAssessmentSummaryResourceId); + + // invoke the operation + HeterogeneousAssessmentSummaryResource result = await heterogeneousAssessmentSummary.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + HeterogeneousAssessmentSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HypervCollectorCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HypervCollectorCollection.cs new file mode 100644 index 000000000000..871a26bc2f69 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HypervCollectorCollection.cs @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_HypervCollectorCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_HypervCollectorsOperationsCreate() + { + // Generated from example definition: 2024-03-03-preview/HypervCollectorsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "HypervCollector_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this HypervCollectorResource + string projectName = "app18700project"; + HypervCollectorCollection collection = resourceGroupResource.GetHypervCollectors(projectName); + + // invoke the operation + string hypervCollectorName = "test-697cecollector"; + HypervCollectorData data = new HypervCollectorData + { + Properties = new CollectorPropertiesBaseWithAgent + { + AgentProperties = new CollectorAgentPropertiesBase + { + Id = "12f1d90f-b3fa-4926-8893-e56803a09af0", + Version = "2.0.1993.19", + LastHeartbeatUtc = DateTimeOffset.Parse("2022-07-07T14:25:35.708325Z"), + SpnDetails = new CollectorAgentSpnPropertiesBase + { + Authority = "https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", + ApplicationId = "e3bd6eaa-980b-40ae-a30e-2a5069ba097c", + Audience = "e3bd6eaa-980b-40ae-a30e-2a5069ba097c", + ObjectId = "01b9f9e2-2d82-414c-adaa-09ce259b6b44", + TenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47", + }, + }, + DiscoverySiteId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawRG/providers/Microsoft.OffAzure/HyperVSites/test-60527site", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, hypervCollectorName, data); + HypervCollectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + HypervCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_HypervCollectorsOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/HypervCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HypervCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this HypervCollectorResource + string projectName = "app18700project"; + HypervCollectorCollection collection = resourceGroupResource.GetHypervCollectors(projectName); + + // invoke the operation + string hypervCollectorName = "test-697cecollector"; + HypervCollectorResource result = await collection.GetAsync(hypervCollectorName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + HypervCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_HypervCollectorsOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/HypervCollectorsOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "HypervCollector_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this HypervCollectorResource + string projectName = "app18700project"; + HypervCollectorCollection collection = resourceGroupResource.GetHypervCollectors(projectName); + + // invoke the operation and iterate over the result + await foreach (HypervCollectorResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + HypervCollectorData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_HypervCollectorsOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/HypervCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HypervCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this HypervCollectorResource + string projectName = "app18700project"; + HypervCollectorCollection collection = resourceGroupResource.GetHypervCollectors(projectName); + + // invoke the operation + string hypervCollectorName = "test-697cecollector"; + bool result = await collection.ExistsAsync(hypervCollectorName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_HypervCollectorsOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/HypervCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HypervCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this HypervCollectorResource + string projectName = "app18700project"; + HypervCollectorCollection collection = resourceGroupResource.GetHypervCollectors(projectName); + + // invoke the operation + string hypervCollectorName = "test-697cecollector"; + NullableResponse response = await collection.GetIfExistsAsync(hypervCollectorName); + HypervCollectorResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + HypervCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HypervCollectorResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HypervCollectorResource.cs new file mode 100644 index 000000000000..18a0f22d6699 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HypervCollectorResource.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_HypervCollectorResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_HypervCollectorsOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/HypervCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HypervCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HypervCollectorResource created on azure + // for more information of creating HypervCollectorResource, please refer to the document of HypervCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + string hypervCollectorName = "test-697cecollector"; + ResourceIdentifier hypervCollectorResourceId = HypervCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, hypervCollectorName); + HypervCollectorResource hypervCollector = client.GetHypervCollectorResource(hypervCollectorResourceId); + + // invoke the operation + HypervCollectorResource result = await hypervCollector.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + HypervCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_HypervCollectorsOperationsDelete() + { + // Generated from example definition: 2024-03-03-preview/HypervCollectorsOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "HypervCollector_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HypervCollectorResource created on azure + // for more information of creating HypervCollectorResource, please refer to the document of HypervCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + string hypervCollectorName = "test-697cecollector"; + ResourceIdentifier hypervCollectorResourceId = HypervCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, hypervCollectorName); + HypervCollectorResource hypervCollector = client.GetHypervCollectorResource(hypervCollectorResourceId); + + // invoke the operation + await hypervCollector.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_HypervCollectorsOperationsCreate() + { + // Generated from example definition: 2024-03-03-preview/HypervCollectorsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "HypervCollector_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HypervCollectorResource created on azure + // for more information of creating HypervCollectorResource, please refer to the document of HypervCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + string hypervCollectorName = "test-697cecollector"; + ResourceIdentifier hypervCollectorResourceId = HypervCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, hypervCollectorName); + HypervCollectorResource hypervCollector = client.GetHypervCollectorResource(hypervCollectorResourceId); + + // invoke the operation + HypervCollectorData data = new HypervCollectorData + { + Properties = new CollectorPropertiesBaseWithAgent + { + AgentProperties = new CollectorAgentPropertiesBase + { + Id = "12f1d90f-b3fa-4926-8893-e56803a09af0", + Version = "2.0.1993.19", + LastHeartbeatUtc = DateTimeOffset.Parse("2022-07-07T14:25:35.708325Z"), + SpnDetails = new CollectorAgentSpnPropertiesBase + { + Authority = "https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", + ApplicationId = "e3bd6eaa-980b-40ae-a30e-2a5069ba097c", + Audience = "e3bd6eaa-980b-40ae-a30e-2a5069ba097c", + ObjectId = "01b9f9e2-2d82-414c-adaa-09ce259b6b44", + TenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47", + }, + }, + DiscoverySiteId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawRG/providers/Microsoft.OffAzure/HyperVSites/test-60527site", + }, + }; + ArmOperation lro = await hypervCollector.UpdateAsync(WaitUntil.Completed, data); + HypervCollectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + HypervCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_IaasSummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_IaasSummaryCollection.cs new file mode 100644 index 000000000000..36fb13618834 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_IaasSummaryCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_IaasSummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BusinessCaseIaasSummaryOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseIaasSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "IaasSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this IaasSummaryResource + IaasSummaryCollection collection = businessCase.GetIaasSummaries(); + + // invoke the operation + string iaasSummaryName = "MySummary"; + IaasSummaryResource result = await collection.GetAsync(iaasSummaryName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IaasSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_BusinessCaseIaasSummaryOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseIaasSummaryOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "IaasSummary_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this IaasSummaryResource + IaasSummaryCollection collection = businessCase.GetIaasSummaries(); + + // invoke the operation and iterate over the result + await foreach (IaasSummaryResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IaasSummaryData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_BusinessCaseIaasSummaryOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseIaasSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "IaasSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this IaasSummaryResource + IaasSummaryCollection collection = businessCase.GetIaasSummaries(); + + // invoke the operation + string iaasSummaryName = "MySummary"; + bool result = await collection.ExistsAsync(iaasSummaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_BusinessCaseIaasSummaryOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseIaasSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "IaasSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this IaasSummaryResource + IaasSummaryCollection collection = businessCase.GetIaasSummaries(); + + // invoke the operation + string iaasSummaryName = "MySummary"; + NullableResponse response = await collection.GetIfExistsAsync(iaasSummaryName); + IaasSummaryResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IaasSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_IaasSummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_IaasSummaryResource.cs new file mode 100644 index 000000000000..7cac5d617705 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_IaasSummaryResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_IaasSummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BusinessCaseIaasSummaryOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseIaasSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "IaasSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IaasSummaryResource created on azure + // for more information of creating IaasSummaryResource, please refer to the document of IaasSummaryResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + string iaasSummaryName = "MySummary"; + ResourceIdentifier iaasSummaryResourceId = IaasSummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName, iaasSummaryName); + IaasSummaryResource iaasSummary = client.GetIaasSummaryResource(iaasSummaryResourceId); + + // invoke the operation + IaasSummaryResource result = await iaasSummary.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IaasSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_ImportCollectorCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_ImportCollectorCollection.cs new file mode 100644 index 000000000000..2f2a96fb582d --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_ImportCollectorCollection.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_ImportCollectorCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ImportCollectorsOperationsCreate() + { + // Generated from example definition: 2024-03-03-preview/ImportCollectorsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "ImportCollector_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ImportCollectorResource + string projectName = "app18700project"; + ImportCollectorCollection collection = resourceGroupResource.GetImportCollectors(projectName); + + // invoke the operation + string importCollectorName = "importCollectore7d5"; + ImportCollectorData data = new ImportCollectorData + { + Properties = new CollectorPropertiesBase + { + DiscoverySiteId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourcegroups/ayagrawRG/providers/microsoft.offazure/importsites/actualSEA37d4importSite", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, importCollectorName, data); + ImportCollectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ImportCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ImportCollectorsOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/ImportCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ImportCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ImportCollectorResource + string projectName = "app18700project"; + ImportCollectorCollection collection = resourceGroupResource.GetImportCollectors(projectName); + + // invoke the operation + string importCollectorName = "importCollectore7d5"; + ImportCollectorResource result = await collection.GetAsync(importCollectorName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ImportCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ImportCollectorsOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/ImportCollectorsOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "ImportCollector_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ImportCollectorResource + string projectName = "app18700project"; + ImportCollectorCollection collection = resourceGroupResource.GetImportCollectors(projectName); + + // invoke the operation and iterate over the result + await foreach (ImportCollectorResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ImportCollectorData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_ImportCollectorsOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/ImportCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ImportCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ImportCollectorResource + string projectName = "app18700project"; + ImportCollectorCollection collection = resourceGroupResource.GetImportCollectors(projectName); + + // invoke the operation + string importCollectorName = "importCollectore7d5"; + bool result = await collection.ExistsAsync(importCollectorName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ImportCollectorsOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/ImportCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ImportCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ImportCollectorResource + string projectName = "app18700project"; + ImportCollectorCollection collection = resourceGroupResource.GetImportCollectors(projectName); + + // invoke the operation + string importCollectorName = "importCollectore7d5"; + NullableResponse response = await collection.GetIfExistsAsync(importCollectorName); + ImportCollectorResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ImportCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_ImportCollectorResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_ImportCollectorResource.cs new file mode 100644 index 000000000000..b7f39df1f397 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_ImportCollectorResource.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_ImportCollectorResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ImportCollectorsOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/ImportCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ImportCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ImportCollectorResource created on azure + // for more information of creating ImportCollectorResource, please refer to the document of ImportCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + string importCollectorName = "importCollectore7d5"; + ResourceIdentifier importCollectorResourceId = ImportCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, importCollectorName); + ImportCollectorResource importCollector = client.GetImportCollectorResource(importCollectorResourceId); + + // invoke the operation + ImportCollectorResource result = await importCollector.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ImportCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_ImportCollectorsOperationsDelete() + { + // Generated from example definition: 2024-03-03-preview/ImportCollectorsOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "ImportCollector_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ImportCollectorResource created on azure + // for more information of creating ImportCollectorResource, please refer to the document of ImportCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + string importCollectorName = "importCollectore7d5"; + ResourceIdentifier importCollectorResourceId = ImportCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, importCollectorName); + ImportCollectorResource importCollector = client.GetImportCollectorResource(importCollectorResourceId); + + // invoke the operation + await importCollector.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ImportCollectorsOperationsCreate() + { + // Generated from example definition: 2024-03-03-preview/ImportCollectorsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "ImportCollector_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ImportCollectorResource created on azure + // for more information of creating ImportCollectorResource, please refer to the document of ImportCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + string importCollectorName = "importCollectore7d5"; + ResourceIdentifier importCollectorResourceId = ImportCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, importCollectorName); + ImportCollectorResource importCollector = client.GetImportCollectorResource(importCollectorResourceId); + + // invoke the operation + ImportCollectorData data = new ImportCollectorData + { + Properties = new CollectorPropertiesBase + { + DiscoverySiteId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourcegroups/ayagrawRG/providers/microsoft.offazure/importsites/actualSEA37d4importSite", + }, + }; + ArmOperation lro = await importCollector.UpdateAsync(WaitUntil.Completed, data); + ImportCollectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ImportCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_ImportSqlCollectorCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_ImportSqlCollectorCollection.cs new file mode 100644 index 000000000000..d3d8f941a2ff --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_ImportSqlCollectorCollection.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_ImportSqlCollectorCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ImportSqlCollectorOperationsCreateMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/ImportSqlCollectorOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "ImportSqlCollector_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "C1DB66AE-BCF9-42FD-ADC2-390E0721C351"; + string resourceGroupName = "rgsqlAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ImportSqlCollectorResource + string projectName = "contosoProject"; + ImportSqlCollectorCollection collection = resourceGroupResource.GetImportSqlCollectors(projectName); + + // invoke the operation + string importSqlCollectorsName = "importCollector"; + ImportSqlCollectorData data = new ImportSqlCollectorData + { + Properties = new ImportSqlCollectorProperties + { + DiscoverySiteId = "/subscriptions/C1DB66AE-BCF9-42FD-ADC2-390E0721C351/resourceGroups/rgsqlAssessments/providers/Microsoft.OffAzure/MasterSites/testproject8566mastersite/SqlSites/testproject8566sqlsites", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, importSqlCollectorsName, data); + ImportSqlCollectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ImportSqlCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ImportSqlCollectorOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/ImportSqlCollectorOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ImportSqlCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "C1DB66AE-BCF9-42FD-ADC2-390E0721C351"; + string resourceGroupName = "rgsqlAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ImportSqlCollectorResource + string projectName = "contosoProject"; + ImportSqlCollectorCollection collection = resourceGroupResource.GetImportSqlCollectors(projectName); + + // invoke the operation + string importSqlCollectorsName = "importCollector"; + ImportSqlCollectorResource result = await collection.GetAsync(importSqlCollectorsName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ImportSqlCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ImportSqlCollectorOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/ImportSqlCollectorOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "ImportSqlCollector_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "C1DB66AE-BCF9-42FD-ADC2-390E0721C351"; + string resourceGroupName = "rgsqlAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ImportSqlCollectorResource + string projectName = "contosoProject"; + ImportSqlCollectorCollection collection = resourceGroupResource.GetImportSqlCollectors(projectName); + + // invoke the operation and iterate over the result + await foreach (ImportSqlCollectorResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ImportSqlCollectorData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_ImportSqlCollectorOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/ImportSqlCollectorOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ImportSqlCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "C1DB66AE-BCF9-42FD-ADC2-390E0721C351"; + string resourceGroupName = "rgsqlAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ImportSqlCollectorResource + string projectName = "contosoProject"; + ImportSqlCollectorCollection collection = resourceGroupResource.GetImportSqlCollectors(projectName); + + // invoke the operation + string importSqlCollectorsName = "importCollector"; + bool result = await collection.ExistsAsync(importSqlCollectorsName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ImportSqlCollectorOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/ImportSqlCollectorOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ImportSqlCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "C1DB66AE-BCF9-42FD-ADC2-390E0721C351"; + string resourceGroupName = "rgsqlAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ImportSqlCollectorResource + string projectName = "contosoProject"; + ImportSqlCollectorCollection collection = resourceGroupResource.GetImportSqlCollectors(projectName); + + // invoke the operation + string importSqlCollectorsName = "importCollector"; + NullableResponse response = await collection.GetIfExistsAsync(importSqlCollectorsName); + ImportSqlCollectorResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ImportSqlCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_ImportSqlCollectorResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_ImportSqlCollectorResource.cs new file mode 100644 index 000000000000..8db36c6efca1 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_ImportSqlCollectorResource.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_ImportSqlCollectorResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ImportSqlCollectorOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/ImportSqlCollectorOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ImportSqlCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ImportSqlCollectorResource created on azure + // for more information of creating ImportSqlCollectorResource, please refer to the document of ImportSqlCollectorResource + string subscriptionId = "C1DB66AE-BCF9-42FD-ADC2-390E0721C351"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string importSqlCollectorsName = "importCollector"; + ResourceIdentifier importSqlCollectorResourceId = ImportSqlCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, importSqlCollectorsName); + ImportSqlCollectorResource importSqlCollector = client.GetImportSqlCollectorResource(importSqlCollectorResourceId); + + // invoke the operation + ImportSqlCollectorResource result = await importSqlCollector.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ImportSqlCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_ImportSqlCollectorOperationsDeleteMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/ImportSqlCollectorOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "ImportSqlCollector_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ImportSqlCollectorResource created on azure + // for more information of creating ImportSqlCollectorResource, please refer to the document of ImportSqlCollectorResource + string subscriptionId = "C1DB66AE-BCF9-42FD-ADC2-390E0721C351"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string importSqlCollectorsName = "importCollector"; + ResourceIdentifier importSqlCollectorResourceId = ImportSqlCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, importSqlCollectorsName); + ImportSqlCollectorResource importSqlCollector = client.GetImportSqlCollectorResource(importSqlCollectorResourceId); + + // invoke the operation + await importSqlCollector.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ImportSqlCollectorOperationsCreateMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/ImportSqlCollectorOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "ImportSqlCollector_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ImportSqlCollectorResource created on azure + // for more information of creating ImportSqlCollectorResource, please refer to the document of ImportSqlCollectorResource + string subscriptionId = "C1DB66AE-BCF9-42FD-ADC2-390E0721C351"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string importSqlCollectorsName = "importCollector"; + ResourceIdentifier importSqlCollectorResourceId = ImportSqlCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, importSqlCollectorsName); + ImportSqlCollectorResource importSqlCollector = client.GetImportSqlCollectorResource(importSqlCollectorResourceId); + + // invoke the operation + ImportSqlCollectorData data = new ImportSqlCollectorData + { + Properties = new ImportSqlCollectorProperties + { + DiscoverySiteId = "/subscriptions/C1DB66AE-BCF9-42FD-ADC2-390E0721C351/resourceGroups/rgsqlAssessments/providers/Microsoft.OffAzure/MasterSites/testproject8566mastersite/SqlSites/testproject8566sqlsites", + }, + }; + ArmOperation lro = await importSqlCollector.UpdateAsync(WaitUntil.Completed, data); + ImportSqlCollectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ImportSqlCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2Collection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2Collection.cs new file mode 100644 index 000000000000..5dea4351339d --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2Collection.cs @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_MachineAssessmentV2Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_MachineAssessmentsV2OperationsCreateMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentsV2Operations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineAssessmentV2Resource + string projectName = "contosoProject"; + MachineAssessmentV2Collection collection = resourceGroupResource.GetMachineAssessmentV2s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + MachineAssessmentV2Data data = new MachineAssessmentV2Data + { + Properties = new MachineAssessmentV2Properties + { + Scope = new Scope + { + ScopeType = ScopeType.ServerGroupId, + ServerGroupId = "f", + AzureResourceGraphQuery = "hfhwuqalmenpcttboxvo", + }, + Settings = new MachineAssessmentSettings + { + AzureLocation = "rsequlcso", + Currency = AzureCurrency.Unknown, + ScalingFactor = 9F, + DiscountPercentage = 5F, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased, + PerformanceData = new PerformanceData + { + Percentile = new Percentile("Unknown"), + TimeRange = TimeRange.Day, + PerfDataStartOn = DateTimeOffset.Parse("2025-02-21T05:47:51.336Z"), + PerfDataEndOn = DateTimeOffset.Parse("2025-02-21T05:47:51.336Z"), + }, + SavingsSettings = new SavingsSettings + { + SavingsOptions = SavingsOption.None, + AzureOfferCode = AzureOffer.Unknown, + }, + BillingSettings = new BillingSettings + { + LicensingProgram = LicensingProgram.Retail, + SubscriptionId = "lee", + }, + EnvironmentType = EnvironmentType.Production, + AzureSecurityOfferingType = AzureSecurityOfferingType.NO, + AzureDiskTypes = { AzureDiskType.Unknown }, + AzurePricingTier = AzurePricingTier.Standard, + AzureStorageRedundancy = AzureStorageRedundancy.Unknown, + AzureHybridUseBenefit = AzureHybridUseBenefit.Unknown, + LinuxAzureHybridUseBenefit = AzureHybridUseBenefit.Unknown, + AzureVmFamilies = { AzureVmFamily.Unknown }, + VmUptime = new VmUptime + { + DaysPerMonth = 9, + HoursPerDay = 10, + }, + AzureVmSecurityOptions = { AzureVmSecurityType.TVM }, + }, + Details = new AssessmentDetails(), + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, assessmentName, data); + MachineAssessmentV2Resource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineAssessmentV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_MachineAssessmentsV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentsV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineAssessmentV2Resource + string projectName = "contosoProject"; + MachineAssessmentV2Collection collection = resourceGroupResource.GetMachineAssessmentV2s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + MachineAssessmentV2Resource result = await collection.GetAsync(assessmentName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineAssessmentV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_MachineAssessmentsV2OperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentsV2Operations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineAssessmentV2Resource + string projectName = "contosoProject"; + MachineAssessmentV2Collection collection = resourceGroupResource.GetMachineAssessmentV2s(projectName); + + // invoke the operation and iterate over the result + await foreach (MachineAssessmentV2Resource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineAssessmentV2Data resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_MachineAssessmentsV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentsV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineAssessmentV2Resource + string projectName = "contosoProject"; + MachineAssessmentV2Collection collection = resourceGroupResource.GetMachineAssessmentV2s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + bool result = await collection.ExistsAsync(assessmentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_MachineAssessmentsV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentsV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineAssessmentV2Resource + string projectName = "contosoProject"; + MachineAssessmentV2Collection collection = resourceGroupResource.GetMachineAssessmentV2s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + NullableResponse response = await collection.GetIfExistsAsync(assessmentName); + MachineAssessmentV2Resource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineAssessmentV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2Resource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2Resource.cs new file mode 100644 index 000000000000..ba3a049f0cab --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2Resource.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_MachineAssessmentV2Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_MachineAssessmentsV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentsV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineAssessmentV2Resource created on azure + // for more information of creating MachineAssessmentV2Resource, please refer to the document of MachineAssessmentV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier machineAssessmentV2ResourceId = MachineAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + MachineAssessmentV2Resource machineAssessmentV2 = client.GetMachineAssessmentV2Resource(machineAssessmentV2ResourceId); + + // invoke the operation + MachineAssessmentV2Resource result = await machineAssessmentV2.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineAssessmentV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_MachineAssessmentsV2OperationsDeleteMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentsV2Operations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineAssessmentV2Resource created on azure + // for more information of creating MachineAssessmentV2Resource, please refer to the document of MachineAssessmentV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier machineAssessmentV2ResourceId = MachineAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + MachineAssessmentV2Resource machineAssessmentV2 = client.GetMachineAssessmentV2Resource(machineAssessmentV2ResourceId); + + // invoke the operation + await machineAssessmentV2.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_MachineAssessmentsV2OperationsCreateMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentsV2Operations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineAssessmentV2Resource created on azure + // for more information of creating MachineAssessmentV2Resource, please refer to the document of MachineAssessmentV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier machineAssessmentV2ResourceId = MachineAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + MachineAssessmentV2Resource machineAssessmentV2 = client.GetMachineAssessmentV2Resource(machineAssessmentV2ResourceId); + + // invoke the operation + MachineAssessmentV2Data data = new MachineAssessmentV2Data + { + Properties = new MachineAssessmentV2Properties + { + Scope = new Scope + { + ScopeType = ScopeType.ServerGroupId, + ServerGroupId = "f", + AzureResourceGraphQuery = "hfhwuqalmenpcttboxvo", + }, + Settings = new MachineAssessmentSettings + { + AzureLocation = "rsequlcso", + Currency = AzureCurrency.Unknown, + ScalingFactor = 9F, + DiscountPercentage = 5F, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased, + PerformanceData = new PerformanceData + { + Percentile = new Percentile("Unknown"), + TimeRange = TimeRange.Day, + PerfDataStartOn = DateTimeOffset.Parse("2025-02-21T05:47:51.336Z"), + PerfDataEndOn = DateTimeOffset.Parse("2025-02-21T05:47:51.336Z"), + }, + SavingsSettings = new SavingsSettings + { + SavingsOptions = SavingsOption.None, + AzureOfferCode = AzureOffer.Unknown, + }, + BillingSettings = new BillingSettings + { + LicensingProgram = LicensingProgram.Retail, + SubscriptionId = "lee", + }, + EnvironmentType = EnvironmentType.Production, + AzureSecurityOfferingType = AzureSecurityOfferingType.NO, + AzureDiskTypes = { AzureDiskType.Unknown }, + AzurePricingTier = AzurePricingTier.Standard, + AzureStorageRedundancy = AzureStorageRedundancy.Unknown, + AzureHybridUseBenefit = AzureHybridUseBenefit.Unknown, + LinuxAzureHybridUseBenefit = AzureHybridUseBenefit.Unknown, + AzureVmFamilies = { AzureVmFamily.Unknown }, + VmUptime = new VmUptime + { + DaysPerMonth = 9, + HoursPerDay = 10, + }, + AzureVmSecurityOptions = { AzureVmSecurityType.TVM }, + }, + Details = new AssessmentDetails(), + }, + }; + ArmOperation lro = await machineAssessmentV2.UpdateAsync(WaitUntil.Completed, data); + MachineAssessmentV2Resource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineAssessmentV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task DownloadUrl_GetDownloadURLForTheAssessmentReport() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentsV2Operations_DownloadUrl_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentsV2Operations_DownloadUrl" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineAssessmentV2Resource created on azure + // for more information of creating MachineAssessmentV2Resource, please refer to the document of MachineAssessmentV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier machineAssessmentV2ResourceId = MachineAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + MachineAssessmentV2Resource machineAssessmentV2 = client.GetMachineAssessmentV2Resource(machineAssessmentV2ResourceId); + + // invoke the operation + DownloadUrlContent content = new DownloadUrlContent(); + ArmOperation lro = await machineAssessmentV2.DownloadUrlAsync(WaitUntil.Completed, content); + DownloadUri result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2SummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2SummaryCollection.cs new file mode 100644 index 000000000000..9d704d70c9dc --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2SummaryCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_MachineAssessmentV2SummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_MachineAssessmentV2SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineAssessmentV2Resource created on azure + // for more information of creating MachineAssessmentV2Resource, please refer to the document of MachineAssessmentV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier machineAssessmentV2ResourceId = MachineAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + MachineAssessmentV2Resource machineAssessmentV2 = client.GetMachineAssessmentV2Resource(machineAssessmentV2ResourceId); + + // get the collection of this MachineAssessmentV2SummaryResource + MachineAssessmentV2SummaryCollection collection = machineAssessmentV2.GetMachineAssessmentV2Summaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + MachineAssessmentV2SummaryResource result = await collection.GetAsync(summaryName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineAssessmentV2SummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_MachineAssessmentV2SummaryOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentV2SummaryOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2Summary_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineAssessmentV2Resource created on azure + // for more information of creating MachineAssessmentV2Resource, please refer to the document of MachineAssessmentV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier machineAssessmentV2ResourceId = MachineAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + MachineAssessmentV2Resource machineAssessmentV2 = client.GetMachineAssessmentV2Resource(machineAssessmentV2ResourceId); + + // get the collection of this MachineAssessmentV2SummaryResource + MachineAssessmentV2SummaryCollection collection = machineAssessmentV2.GetMachineAssessmentV2Summaries(); + + // invoke the operation and iterate over the result + await foreach (MachineAssessmentV2SummaryResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineAssessmentV2SummaryData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_MachineAssessmentV2SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineAssessmentV2Resource created on azure + // for more information of creating MachineAssessmentV2Resource, please refer to the document of MachineAssessmentV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier machineAssessmentV2ResourceId = MachineAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + MachineAssessmentV2Resource machineAssessmentV2 = client.GetMachineAssessmentV2Resource(machineAssessmentV2ResourceId); + + // get the collection of this MachineAssessmentV2SummaryResource + MachineAssessmentV2SummaryCollection collection = machineAssessmentV2.GetMachineAssessmentV2Summaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + bool result = await collection.ExistsAsync(summaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_MachineAssessmentV2SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineAssessmentV2Resource created on azure + // for more information of creating MachineAssessmentV2Resource, please refer to the document of MachineAssessmentV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier machineAssessmentV2ResourceId = MachineAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + MachineAssessmentV2Resource machineAssessmentV2 = client.GetMachineAssessmentV2Resource(machineAssessmentV2ResourceId); + + // get the collection of this MachineAssessmentV2SummaryResource + MachineAssessmentV2SummaryCollection collection = machineAssessmentV2.GetMachineAssessmentV2Summaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + NullableResponse response = await collection.GetIfExistsAsync(summaryName); + MachineAssessmentV2SummaryResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineAssessmentV2SummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2SummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2SummaryResource.cs new file mode 100644 index 000000000000..ddec47394136 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2SummaryResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_MachineAssessmentV2SummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_MachineAssessmentV2SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineAssessmentV2SummaryResource created on azure + // for more information of creating MachineAssessmentV2SummaryResource, please refer to the document of MachineAssessmentV2SummaryResource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + string summaryName = "PaaSPreferred"; + ResourceIdentifier machineAssessmentV2SummaryResourceId = MachineAssessmentV2SummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, summaryName); + MachineAssessmentV2SummaryResource machineAssessmentV2Summary = client.GetMachineAssessmentV2SummaryResource(machineAssessmentV2SummaryResourceId); + + // invoke the operation + MachineAssessmentV2SummaryResource result = await machineAssessmentV2Summary.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineAssessmentV2SummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineGraphAssessmentOptionCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineGraphAssessmentOptionCollection.cs new file mode 100644 index 000000000000..c5ac346d6d0e --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineGraphAssessmentOptionCollection.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_MachineGraphAssessmentOptionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_MachineGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachineGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineGraphAssessmentOptionResource + string projectName = "contosoProject"; + MachineGraphAssessmentOptionCollection collection = resourceGroupResource.GetMachineGraphAssessmentOptions(projectName); + + // invoke the operation + MachineGraphAssessmentOptionResource result = await collection.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineGraphAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_MachineGraphAssessmentOptionsOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineGraphAssessmentOptionsOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "MachineGraphAssessmentOptions_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineGraphAssessmentOptionResource + string projectName = "contosoProject"; + MachineGraphAssessmentOptionCollection collection = resourceGroupResource.GetMachineGraphAssessmentOptions(projectName); + + // invoke the operation and iterate over the result + await foreach (MachineGraphAssessmentOptionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineGraphAssessmentOptionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_MachineGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachineGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineGraphAssessmentOptionResource + string projectName = "contosoProject"; + MachineGraphAssessmentOptionCollection collection = resourceGroupResource.GetMachineGraphAssessmentOptions(projectName); + + // invoke the operation + bool result = await collection.ExistsAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_MachineGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachineGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineGraphAssessmentOptionResource + string projectName = "contosoProject"; + MachineGraphAssessmentOptionCollection collection = resourceGroupResource.GetMachineGraphAssessmentOptions(projectName); + + // invoke the operation + NullableResponse response = await collection.GetIfExistsAsync(); + MachineGraphAssessmentOptionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineGraphAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineGraphAssessmentOptionResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineGraphAssessmentOptionResource.cs new file mode 100644 index 000000000000..9c1d9800b130 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineGraphAssessmentOptionResource.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_MachineGraphAssessmentOptionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_MachineGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachineGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineGraphAssessmentOptionResource created on azure + // for more information of creating MachineGraphAssessmentOptionResource, please refer to the document of MachineGraphAssessmentOptionResource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + ResourceIdentifier machineGraphAssessmentOptionResourceId = MachineGraphAssessmentOptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MachineGraphAssessmentOptionResource machineGraphAssessmentOption = client.GetMachineGraphAssessmentOptionResource(machineGraphAssessmentOptionResourceId); + + // invoke the operation + MachineGraphAssessmentOptionResource result = await machineGraphAssessmentOption.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineGraphAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateEndpointConnectionCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateEndpointConnectionCollection.cs new file mode 100644 index 000000000000..1896cf67e173 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateEndpointConnectionCollection.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_MigratePrivateEndpointConnectionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PrivateEndpointConnectionOperationsUpdate() + { + // Generated from example definition: 2024-03-03-preview/PrivateEndpointConnectionOperations_Update_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnection_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this MigratePrivateEndpointConnectionResource + MigratePrivateEndpointConnectionCollection collection = assessmentProject.GetMigratePrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7"; + MigratePrivateEndpointConnectionData data = new MigratePrivateEndpointConnectionData + { + Properties = new PrivateEndpointConnectionProperties(new MigratePrivateLinkServiceConnectionState + { + Status = MigratePrivateEndpointServiceConnectionStatus.Approved, + ActionsRequired = "", + }), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, privateEndpointConnectionName, data); + MigratePrivateEndpointConnectionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigratePrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_PrivateEndpointConnectionOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/PrivateEndpointConnectionOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this MigratePrivateEndpointConnectionResource + MigratePrivateEndpointConnectionCollection collection = assessmentProject.GetMigratePrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7"; + MigratePrivateEndpointConnectionResource result = await collection.GetAsync(privateEndpointConnectionName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigratePrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_PrivateEndpointConnectionOperationsListByParent() + { + // Generated from example definition: 2024-03-03-preview/PrivateEndpointConnectionOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnection_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this MigratePrivateEndpointConnectionResource + MigratePrivateEndpointConnectionCollection collection = assessmentProject.GetMigratePrivateEndpointConnections(); + + // invoke the operation and iterate over the result + await foreach (MigratePrivateEndpointConnectionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigratePrivateEndpointConnectionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_PrivateEndpointConnectionOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/PrivateEndpointConnectionOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this MigratePrivateEndpointConnectionResource + MigratePrivateEndpointConnectionCollection collection = assessmentProject.GetMigratePrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7"; + bool result = await collection.ExistsAsync(privateEndpointConnectionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_PrivateEndpointConnectionOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/PrivateEndpointConnectionOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this MigratePrivateEndpointConnectionResource + MigratePrivateEndpointConnectionCollection collection = assessmentProject.GetMigratePrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7"; + NullableResponse response = await collection.GetIfExistsAsync(privateEndpointConnectionName); + MigratePrivateEndpointConnectionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigratePrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateEndpointConnectionResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateEndpointConnectionResource.cs new file mode 100644 index 000000000000..f5d8185fafcf --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateEndpointConnectionResource.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_MigratePrivateEndpointConnectionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_PrivateEndpointConnectionOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/PrivateEndpointConnectionOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigratePrivateEndpointConnectionResource created on azure + // for more information of creating MigratePrivateEndpointConnectionResource, please refer to the document of MigratePrivateEndpointConnectionResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + string privateEndpointConnectionName = "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7"; + ResourceIdentifier migratePrivateEndpointConnectionResourceId = MigratePrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, privateEndpointConnectionName); + MigratePrivateEndpointConnectionResource migratePrivateEndpointConnection = client.GetMigratePrivateEndpointConnectionResource(migratePrivateEndpointConnectionResourceId); + + // invoke the operation + MigratePrivateEndpointConnectionResource result = await migratePrivateEndpointConnection.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigratePrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_PrivateEndpointConnectionOperationsDelete() + { + // Generated from example definition: 2024-03-03-preview/PrivateEndpointConnectionOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnection_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigratePrivateEndpointConnectionResource created on azure + // for more information of creating MigratePrivateEndpointConnectionResource, please refer to the document of MigratePrivateEndpointConnectionResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + string privateEndpointConnectionName = "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7"; + ResourceIdentifier migratePrivateEndpointConnectionResourceId = MigratePrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, privateEndpointConnectionName); + MigratePrivateEndpointConnectionResource migratePrivateEndpointConnection = client.GetMigratePrivateEndpointConnectionResource(migratePrivateEndpointConnectionResourceId); + + // invoke the operation + await migratePrivateEndpointConnection.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_PrivateEndpointConnectionOperationsUpdate() + { + // Generated from example definition: 2024-03-03-preview/PrivateEndpointConnectionOperations_Update_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnection_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigratePrivateEndpointConnectionResource created on azure + // for more information of creating MigratePrivateEndpointConnectionResource, please refer to the document of MigratePrivateEndpointConnectionResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + string privateEndpointConnectionName = "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7"; + ResourceIdentifier migratePrivateEndpointConnectionResourceId = MigratePrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, privateEndpointConnectionName); + MigratePrivateEndpointConnectionResource migratePrivateEndpointConnection = client.GetMigratePrivateEndpointConnectionResource(migratePrivateEndpointConnectionResourceId); + + // invoke the operation + MigratePrivateEndpointConnectionData data = new MigratePrivateEndpointConnectionData + { + Properties = new PrivateEndpointConnectionProperties(new MigratePrivateLinkServiceConnectionState + { + Status = MigratePrivateEndpointServiceConnectionStatus.Approved, + ActionsRequired = "", + }), + }; + ArmOperation lro = await migratePrivateEndpointConnection.UpdateAsync(WaitUntil.Completed, data); + MigratePrivateEndpointConnectionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigratePrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateLinkResourceDataCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateLinkResourceDataCollection.cs new file mode 100644 index 000000000000..f9f2b4e97472 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateLinkResourceDataCollection.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_MigratePrivateLinkResourceDataCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_PrivateLinkResourceOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/PrivateLinkResourceOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateLinkResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this MigratePrivateLinkResourceDataResource + MigratePrivateLinkResourceDataCollection collection = assessmentProject.GetAllMigratePrivateLinkResourceData(); + + // invoke the operation + string privateLinkResourceName = "Default"; + MigratePrivateLinkResourceDataResource result = await collection.GetAsync(privateLinkResourceName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigratePrivateLinkResourceDataData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_PrivateLinkResourceOperationsListByParent() + { + // Generated from example definition: 2024-03-03-preview/PrivateLinkResourceOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateLinkResource_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this MigratePrivateLinkResourceDataResource + MigratePrivateLinkResourceDataCollection collection = assessmentProject.GetAllMigratePrivateLinkResourceData(); + + // invoke the operation and iterate over the result + await foreach (MigratePrivateLinkResourceDataResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigratePrivateLinkResourceDataData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_PrivateLinkResourceOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/PrivateLinkResourceOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateLinkResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this MigratePrivateLinkResourceDataResource + MigratePrivateLinkResourceDataCollection collection = assessmentProject.GetAllMigratePrivateLinkResourceData(); + + // invoke the operation + string privateLinkResourceName = "Default"; + bool result = await collection.ExistsAsync(privateLinkResourceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_PrivateLinkResourceOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/PrivateLinkResourceOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateLinkResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this MigratePrivateLinkResourceDataResource + MigratePrivateLinkResourceDataCollection collection = assessmentProject.GetAllMigratePrivateLinkResourceData(); + + // invoke the operation + string privateLinkResourceName = "Default"; + NullableResponse response = await collection.GetIfExistsAsync(privateLinkResourceName); + MigratePrivateLinkResourceDataResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigratePrivateLinkResourceDataData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateLinkResourceDataResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateLinkResourceDataResource.cs new file mode 100644 index 000000000000..1df86a0dd65d --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateLinkResourceDataResource.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_MigratePrivateLinkResourceDataResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_PrivateLinkResourceOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/PrivateLinkResourceOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateLinkResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigratePrivateLinkResourceDataResource created on azure + // for more information of creating MigratePrivateLinkResourceDataResource, please refer to the document of MigratePrivateLinkResourceDataResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + string privateLinkResourceName = "Default"; + ResourceIdentifier migratePrivateLinkResourceDataResourceId = MigratePrivateLinkResourceDataResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, privateLinkResourceName); + MigratePrivateLinkResourceDataResource migratePrivateLinkResourceData = client.GetMigratePrivateLinkResourceDataResource(migratePrivateLinkResourceDataResourceId); + + // invoke the operation + MigratePrivateLinkResourceDataResource result = await migratePrivateLinkResourceData.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigratePrivateLinkResourceDataData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_OverviewSummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_OverviewSummaryCollection.cs new file mode 100644 index 000000000000..b3bd231ff47f --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_OverviewSummaryCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_OverviewSummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BusinessCaseOverviewSummaryOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOverviewSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "OverviewSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this OverviewSummaryResource + OverviewSummaryCollection collection = businessCase.GetOverviewSummaries(); + + // invoke the operation + string overviewSummaryName = "MySummary"; + OverviewSummaryResource result = await collection.GetAsync(overviewSummaryName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + OverviewSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_BusinessCaseOverviewSummaryOperationsListByParentMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOverviewSummaryOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "OverviewSummary_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this OverviewSummaryResource + OverviewSummaryCollection collection = businessCase.GetOverviewSummaries(); + + // invoke the operation and iterate over the result + await foreach (OverviewSummaryResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + OverviewSummaryData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_BusinessCaseOverviewSummaryOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOverviewSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "OverviewSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this OverviewSummaryResource + OverviewSummaryCollection collection = businessCase.GetOverviewSummaries(); + + // invoke the operation + string overviewSummaryName = "MySummary"; + bool result = await collection.ExistsAsync(overviewSummaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_BusinessCaseOverviewSummaryOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOverviewSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "OverviewSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this OverviewSummaryResource + OverviewSummaryCollection collection = businessCase.GetOverviewSummaries(); + + // invoke the operation + string overviewSummaryName = "MySummary"; + NullableResponse response = await collection.GetIfExistsAsync(overviewSummaryName); + OverviewSummaryResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + OverviewSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_OverviewSummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_OverviewSummaryResource.cs new file mode 100644 index 000000000000..d68466a4639c --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_OverviewSummaryResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_OverviewSummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BusinessCaseOverviewSummaryOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOverviewSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "OverviewSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this OverviewSummaryResource created on azure + // for more information of creating OverviewSummaryResource, please refer to the document of OverviewSummaryResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + string overviewSummaryName = "MySummary"; + ResourceIdentifier overviewSummaryResourceId = OverviewSummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName, overviewSummaryName); + OverviewSummaryResource overviewSummary = client.GetOverviewSummaryResource(overviewSummaryResourceId); + + // invoke the operation + OverviewSummaryResource result = await overviewSummary.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + OverviewSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_PaasSummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_PaasSummaryCollection.cs new file mode 100644 index 000000000000..be326b3c0dea --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_PaasSummaryCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_PaasSummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BusinessCasePaasSummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCasePaasSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PaasSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this PaasSummaryResource + PaasSummaryCollection collection = businessCase.GetPaasSummaries(); + + // invoke the operation + string paasSummaryName = "MySummary"; + PaasSummaryResource result = await collection.GetAsync(paasSummaryName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PaasSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_BusinessCasePaasSummaryOperationsListByParentMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCasePaasSummaryOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "PaasSummary_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this PaasSummaryResource + PaasSummaryCollection collection = businessCase.GetPaasSummaries(); + + // invoke the operation and iterate over the result + await foreach (PaasSummaryResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PaasSummaryData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_BusinessCasePaasSummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCasePaasSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PaasSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this PaasSummaryResource + PaasSummaryCollection collection = businessCase.GetPaasSummaries(); + + // invoke the operation + string paasSummaryName = "MySummary"; + bool result = await collection.ExistsAsync(paasSummaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_BusinessCasePaasSummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCasePaasSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PaasSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this PaasSummaryResource + PaasSummaryCollection collection = businessCase.GetPaasSummaries(); + + // invoke the operation + string paasSummaryName = "MySummary"; + NullableResponse response = await collection.GetIfExistsAsync(paasSummaryName); + PaasSummaryResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PaasSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_PaasSummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_PaasSummaryResource.cs new file mode 100644 index 000000000000..ad0ec059bd3e --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_PaasSummaryResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_PaasSummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BusinessCasePaasSummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCasePaasSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PaasSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this PaasSummaryResource created on azure + // for more information of creating PaasSummaryResource, please refer to the document of PaasSummaryResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + string paasSummaryName = "MySummary"; + ResourceIdentifier paasSummaryResourceId = PaasSummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName, paasSummaryName); + PaasSummaryResource paasSummary = client.GetPaasSummaryResource(paasSummaryResourceId); + + // invoke the operation + PaasSummaryResource result = await paasSummary.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PaasSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_ServerCollectorCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_ServerCollectorCollection.cs new file mode 100644 index 000000000000..46929e1e5b4b --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_ServerCollectorCollection.cs @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_ServerCollectorCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ServerCollectorsOperationsCreate() + { + // Generated from example definition: 2024-03-03-preview/ServerCollectorsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "ServerCollector_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ServerCollectorResource + string projectName = "app18700project"; + ServerCollectorCollection collection = resourceGroupResource.GetServerCollectors(projectName); + + // invoke the operation + string serverCollectorName = "walter389fcollector"; + ServerCollectorData data = new ServerCollectorData + { + Properties = new CollectorPropertiesBaseWithAgent + { + AgentProperties = new CollectorAgentPropertiesBase + { + Id = "498e4965-bbb1-47c2-8613-345baff9c509", + SpnDetails = new CollectorAgentSpnPropertiesBase + { + Authority = "https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", + ApplicationId = "65153d2f-9afb-44e8-b3ca-1369150b7354", + Audience = "65153d2f-9afb-44e8-b3ca-1369150b7354", + ObjectId = "ddde6f96-87c8-420b-9d4d-f16a5090519e", + TenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47", + }, + }, + DiscoverySiteId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawRG/providers/Microsoft.OffAzure/ServerSites/walter7155site", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serverCollectorName, data); + ServerCollectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ServerCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ServerCollectorsOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/ServerCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ServerCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ServerCollectorResource + string projectName = "app18700project"; + ServerCollectorCollection collection = resourceGroupResource.GetServerCollectors(projectName); + + // invoke the operation + string serverCollectorName = "walter389fcollector"; + ServerCollectorResource result = await collection.GetAsync(serverCollectorName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ServerCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ServerCollectorsOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/ServerCollectorsOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "ServerCollector_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ServerCollectorResource + string projectName = "app18700project"; + ServerCollectorCollection collection = resourceGroupResource.GetServerCollectors(projectName); + + // invoke the operation and iterate over the result + await foreach (ServerCollectorResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ServerCollectorData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_ServerCollectorsOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/ServerCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ServerCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ServerCollectorResource + string projectName = "app18700project"; + ServerCollectorCollection collection = resourceGroupResource.GetServerCollectors(projectName); + + // invoke the operation + string serverCollectorName = "walter389fcollector"; + bool result = await collection.ExistsAsync(serverCollectorName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ServerCollectorsOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/ServerCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ServerCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ServerCollectorResource + string projectName = "app18700project"; + ServerCollectorCollection collection = resourceGroupResource.GetServerCollectors(projectName); + + // invoke the operation + string serverCollectorName = "walter389fcollector"; + NullableResponse response = await collection.GetIfExistsAsync(serverCollectorName); + ServerCollectorResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ServerCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_ServerCollectorResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_ServerCollectorResource.cs new file mode 100644 index 000000000000..7ee487c647dd --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_ServerCollectorResource.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_ServerCollectorResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ServerCollectorsOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/ServerCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ServerCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServerCollectorResource created on azure + // for more information of creating ServerCollectorResource, please refer to the document of ServerCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + string serverCollectorName = "walter389fcollector"; + ResourceIdentifier serverCollectorResourceId = ServerCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, serverCollectorName); + ServerCollectorResource serverCollector = client.GetServerCollectorResource(serverCollectorResourceId); + + // invoke the operation + ServerCollectorResource result = await serverCollector.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ServerCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_ServerCollectorsOperationsDelete() + { + // Generated from example definition: 2024-03-03-preview/ServerCollectorsOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "ServerCollector_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServerCollectorResource created on azure + // for more information of creating ServerCollectorResource, please refer to the document of ServerCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + string serverCollectorName = "walter389fcollector"; + ResourceIdentifier serverCollectorResourceId = ServerCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, serverCollectorName); + ServerCollectorResource serverCollector = client.GetServerCollectorResource(serverCollectorResourceId); + + // invoke the operation + await serverCollector.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ServerCollectorsOperationsCreate() + { + // Generated from example definition: 2024-03-03-preview/ServerCollectorsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "ServerCollector_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServerCollectorResource created on azure + // for more information of creating ServerCollectorResource, please refer to the document of ServerCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + string serverCollectorName = "walter389fcollector"; + ResourceIdentifier serverCollectorResourceId = ServerCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, serverCollectorName); + ServerCollectorResource serverCollector = client.GetServerCollectorResource(serverCollectorResourceId); + + // invoke the operation + ServerCollectorData data = new ServerCollectorData + { + Properties = new CollectorPropertiesBaseWithAgent + { + AgentProperties = new CollectorAgentPropertiesBase + { + Id = "498e4965-bbb1-47c2-8613-345baff9c509", + SpnDetails = new CollectorAgentSpnPropertiesBase + { + Authority = "https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", + ApplicationId = "65153d2f-9afb-44e8-b3ca-1369150b7354", + Audience = "65153d2f-9afb-44e8-b3ca-1369150b7354", + ObjectId = "ddde6f96-87c8-420b-9d4d-f16a5090519e", + TenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47", + }, + }, + DiscoverySiteId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawRG/providers/Microsoft.OffAzure/ServerSites/walter7155site", + }, + }; + ArmOperation lro = await serverCollector.UpdateAsync(WaitUntil.Completed, data); + ServerCollectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ServerCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3Collection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3Collection.cs new file mode 100644 index 000000000000..974d4666a0a8 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3Collection.cs @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_SqlAssessmentV3Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_SqlAssessmentV3OperationsCreateMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3Operations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SqlAssessmentV3Resource + string projectName = "contosoProject"; + SqlAssessmentV3Collection collection = resourceGroupResource.GetSqlAssessmentV3s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + SqlAssessmentV3Data data = new SqlAssessmentV3Data + { + Properties = new SqlAssessmentV3Properties + { + Scope = new Scope + { + ScopeType = ScopeType.ServerGroupId, + ServerGroupId = "ppxcjyrxfmpm", + AzureResourceGraphQuery = "ddqs", + }, + Settings = new SqlAssessmentSettings + { + AzureLocation = "vtpazagckatiezkiwol", + Currency = AzureCurrency.Unknown, + ScalingFactor = 27F, + DiscountPercentage = 8F, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased, + PerformanceData = new PerformanceData + { + Percentile = new Percentile("Unknown"), + TimeRange = TimeRange.Day, + PerfDataStartOn = DateTimeOffset.Parse("2025-02-21T05:15:28.133Z"), + PerfDataEndOn = DateTimeOffset.Parse("2025-02-21T05:15:28.133Z"), + }, + SavingsSettings = new SavingsSettings + { + SavingsOptions = SavingsOption.None, + AzureOfferCode = AzureOffer.Unknown, + }, + BillingSettings = new BillingSettings + { + LicensingProgram = LicensingProgram.Retail, + SubscriptionId = "sp", + }, + EnvironmentType = EnvironmentType.Production, + OSLicense = OSLicense.Unknown, + EntityUptime = new EntityUptime + { + DaysPerMonth = 2, + HoursPerDay = 28, + }, + PreferredTargets = { AzureTarget.Unknown }, + AzureSqlManagedInstanceSettings = new SqlMiSettingsV3 + { + AzureSqlServiceTier = AzureSqlServiceTierV3.SqlServiceUnknown, + AzureSqlInstanceType = AzureSqlInstanceType.Unknown, + }, + AzureSqlDatabaseSettings = new SqlDbSettingsV3 + { + AzureSqlServiceTier = AzureSqlServiceTierV3.SqlServiceUnknown, + AzureSqlDataBaseType = AzureSqlDataBaseType.Unknown, + AzureSqlComputeTier = ComputeTier.Unknown, + AzureSqlPurchaseModel = AzureSqlPurchaseModel.Unknown, + }, + AzureSqlVmInstanceSeries = { AzureVmFamily.Unknown }, + MultiSubnetIntent = MultiSubnetIntent.None, + AsyncCommitModeIntent = AsyncCommitModeIntent.None, + IsInternetAccessAvailable = true, + DisasterRecoveryLocation = Models.AzureLocation.Unknown, + EnableHadrAssessment = true, + AzureSecurityOfferingType = AzureSecurityOfferingType.NO, + SqlServerLicense = SqlServerLicense.Unknown, + }, + Details = new AssessmentDetails(), + FallbackMachineAssessmentArmId = "jfwkifsuigza", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, assessmentName, data); + SqlAssessmentV3Resource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SqlAssessmentV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SqlAssessmentV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SqlAssessmentV3Resource + string projectName = "contosoProject"; + SqlAssessmentV3Collection collection = resourceGroupResource.GetSqlAssessmentV3s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + SqlAssessmentV3Resource result = await collection.GetAsync(assessmentName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SqlAssessmentV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_SqlAssessmentV3OperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3Operations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SqlAssessmentV3Resource + string projectName = "contosoProject"; + SqlAssessmentV3Collection collection = resourceGroupResource.GetSqlAssessmentV3s(projectName); + + // invoke the operation and iterate over the result + await foreach (SqlAssessmentV3Resource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SqlAssessmentV3Data resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_SqlAssessmentV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SqlAssessmentV3Resource + string projectName = "contosoProject"; + SqlAssessmentV3Collection collection = resourceGroupResource.GetSqlAssessmentV3s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + bool result = await collection.ExistsAsync(assessmentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SqlAssessmentV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SqlAssessmentV3Resource + string projectName = "contosoProject"; + SqlAssessmentV3Collection collection = resourceGroupResource.GetSqlAssessmentV3s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + NullableResponse response = await collection.GetIfExistsAsync(assessmentName); + SqlAssessmentV3Resource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SqlAssessmentV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3Resource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3Resource.cs new file mode 100644 index 000000000000..d68c968d5264 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3Resource.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_SqlAssessmentV3Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SqlAssessmentV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // invoke the operation + SqlAssessmentV3Resource result = await sqlAssessmentV3.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SqlAssessmentV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_SqlAssessmentV3OperationsDeleteMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3Operations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // invoke the operation + await sqlAssessmentV3.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_SqlAssessmentV3OperationsCreateMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3Operations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // invoke the operation + SqlAssessmentV3Data data = new SqlAssessmentV3Data + { + Properties = new SqlAssessmentV3Properties + { + Scope = new Scope + { + ScopeType = ScopeType.ServerGroupId, + ServerGroupId = "ppxcjyrxfmpm", + AzureResourceGraphQuery = "ddqs", + }, + Settings = new SqlAssessmentSettings + { + AzureLocation = "vtpazagckatiezkiwol", + Currency = AzureCurrency.Unknown, + ScalingFactor = 27F, + DiscountPercentage = 8F, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased, + PerformanceData = new PerformanceData + { + Percentile = new Percentile("Unknown"), + TimeRange = TimeRange.Day, + PerfDataStartOn = DateTimeOffset.Parse("2025-02-21T05:15:28.133Z"), + PerfDataEndOn = DateTimeOffset.Parse("2025-02-21T05:15:28.133Z"), + }, + SavingsSettings = new SavingsSettings + { + SavingsOptions = SavingsOption.None, + AzureOfferCode = AzureOffer.Unknown, + }, + BillingSettings = new BillingSettings + { + LicensingProgram = LicensingProgram.Retail, + SubscriptionId = "sp", + }, + EnvironmentType = EnvironmentType.Production, + OSLicense = OSLicense.Unknown, + EntityUptime = new EntityUptime + { + DaysPerMonth = 2, + HoursPerDay = 28, + }, + PreferredTargets = { AzureTarget.Unknown }, + AzureSqlManagedInstanceSettings = new SqlMiSettingsV3 + { + AzureSqlServiceTier = AzureSqlServiceTierV3.SqlServiceUnknown, + AzureSqlInstanceType = AzureSqlInstanceType.Unknown, + }, + AzureSqlDatabaseSettings = new SqlDbSettingsV3 + { + AzureSqlServiceTier = AzureSqlServiceTierV3.SqlServiceUnknown, + AzureSqlDataBaseType = AzureSqlDataBaseType.Unknown, + AzureSqlComputeTier = ComputeTier.Unknown, + AzureSqlPurchaseModel = AzureSqlPurchaseModel.Unknown, + }, + AzureSqlVmInstanceSeries = { AzureVmFamily.Unknown }, + MultiSubnetIntent = MultiSubnetIntent.None, + AsyncCommitModeIntent = AsyncCommitModeIntent.None, + IsInternetAccessAvailable = true, + DisasterRecoveryLocation = Models.AzureLocation.Unknown, + EnableHadrAssessment = true, + AzureSecurityOfferingType = AzureSecurityOfferingType.NO, + SqlServerLicense = SqlServerLicense.Unknown, + }, + Details = new AssessmentDetails(), + FallbackMachineAssessmentArmId = "jfwkifsuigza", + }, + }; + ArmOperation lro = await sqlAssessmentV3.UpdateAsync(WaitUntil.Completed, data); + SqlAssessmentV3Resource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SqlAssessmentV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task DownloadUrl_GetDownloadURLForTheAssessmentReport() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3Operations_DownloadUrl_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3Operations_DownloadUrl" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // invoke the operation + DownloadUrlContent content = new DownloadUrlContent(); + ArmOperation lro = await sqlAssessmentV3.DownloadUrlAsync(WaitUntil.Completed, content); + DownloadUri result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3SummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3SummaryCollection.cs new file mode 100644 index 000000000000..9ecb94f3038a --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3SummaryCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_SqlAssessmentV3SummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SqlAssessmentV3SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this SqlAssessmentV3SummaryResource + SqlAssessmentV3SummaryCollection collection = sqlAssessmentV3.GetSqlAssessmentV3Summaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + SqlAssessmentV3SummaryResource result = await collection.GetAsync(summaryName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SqlAssessmentV3SummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_SqlAssessmentV3SummaryOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3SummaryOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3Summary_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this SqlAssessmentV3SummaryResource + SqlAssessmentV3SummaryCollection collection = sqlAssessmentV3.GetSqlAssessmentV3Summaries(); + + // invoke the operation and iterate over the result + await foreach (SqlAssessmentV3SummaryResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SqlAssessmentV3SummaryData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_SqlAssessmentV3SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this SqlAssessmentV3SummaryResource + SqlAssessmentV3SummaryCollection collection = sqlAssessmentV3.GetSqlAssessmentV3Summaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + bool result = await collection.ExistsAsync(summaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SqlAssessmentV3SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this SqlAssessmentV3SummaryResource + SqlAssessmentV3SummaryCollection collection = sqlAssessmentV3.GetSqlAssessmentV3Summaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + NullableResponse response = await collection.GetIfExistsAsync(summaryName); + SqlAssessmentV3SummaryResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SqlAssessmentV3SummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3SummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3SummaryResource.cs new file mode 100644 index 000000000000..0ef7810da944 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3SummaryResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_SqlAssessmentV3SummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SqlAssessmentV3SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3SummaryResource created on azure + // for more information of creating SqlAssessmentV3SummaryResource, please refer to the document of SqlAssessmentV3SummaryResource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + string summaryName = "PaaSPreferred"; + ResourceIdentifier sqlAssessmentV3SummaryResourceId = SqlAssessmentV3SummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, summaryName); + SqlAssessmentV3SummaryResource sqlAssessmentV3Summary = client.GetSqlAssessmentV3SummaryResource(sqlAssessmentV3SummaryResourceId); + + // invoke the operation + SqlAssessmentV3SummaryResource result = await sqlAssessmentV3Summary.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SqlAssessmentV3SummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlCollectorCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlCollectorCollection.cs new file mode 100644 index 000000000000..45c2d10926f4 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlCollectorCollection.cs @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_SqlCollectorCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_SqlCollectorOperationsCreate() + { + // Generated from example definition: 2024-03-03-preview/SqlCollectorOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "SqlCollector_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SqlCollectorResource + string projectName = "fci-test6904project"; + SqlCollectorCollection collection = resourceGroupResource.GetSqlCollectors(projectName); + + // invoke the operation + string collectorName = "fci-test0c1esqlsitecollector"; + SqlCollectorData data = new SqlCollectorData + { + Properties = new CollectorPropertiesBaseWithAgent + { + AgentProperties = new CollectorAgentPropertiesBase + { + Id = "630da710-4d44-41f7-a189-72fe3db5502b-agent", + SpnDetails = new CollectorAgentSpnPropertiesBase + { + Authority = "https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", + ApplicationId = "db9c4c3d-477c-4d5a-817b-318276713565", + Audience = "db9c4c3d-477c-4d5a-817b-318276713565", + ObjectId = "e50236ad-ad07-47d4-af71-ed7b52d200d5", + TenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47", + }, + }, + DiscoverySiteId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/bansalankit-rg/providers/Microsoft.OffAzure/MasterSites/fci-ankit-test6065mastersite/SqlSites/fci-ankit-test6065sqlsites", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, collectorName, data); + SqlCollectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SqlCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SqlCollectorOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/SqlCollectorOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SqlCollectorResource + string projectName = "fci-test6904project"; + SqlCollectorCollection collection = resourceGroupResource.GetSqlCollectors(projectName); + + // invoke the operation + string collectorName = "fci-test0c1esqlsitecollector"; + SqlCollectorResource result = await collection.GetAsync(collectorName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SqlCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_SqlCollectorOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlCollectorOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "SqlCollector_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SqlCollectorResource + string projectName = "fci-test6904project"; + SqlCollectorCollection collection = resourceGroupResource.GetSqlCollectors(projectName); + + // invoke the operation and iterate over the result + await foreach (SqlCollectorResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SqlCollectorData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_SqlCollectorOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/SqlCollectorOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SqlCollectorResource + string projectName = "fci-test6904project"; + SqlCollectorCollection collection = resourceGroupResource.GetSqlCollectors(projectName); + + // invoke the operation + string collectorName = "fci-test0c1esqlsitecollector"; + bool result = await collection.ExistsAsync(collectorName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SqlCollectorOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/SqlCollectorOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SqlCollectorResource + string projectName = "fci-test6904project"; + SqlCollectorCollection collection = resourceGroupResource.GetSqlCollectors(projectName); + + // invoke the operation + string collectorName = "fci-test0c1esqlsitecollector"; + NullableResponse response = await collection.GetIfExistsAsync(collectorName); + SqlCollectorResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SqlCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlCollectorResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlCollectorResource.cs new file mode 100644 index 000000000000..893c6163f868 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlCollectorResource.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_SqlCollectorResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SqlCollectorOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/SqlCollectorOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlCollectorResource created on azure + // for more information of creating SqlCollectorResource, please refer to the document of SqlCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string collectorName = "fci-test0c1esqlsitecollector"; + ResourceIdentifier sqlCollectorResourceId = SqlCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, collectorName); + SqlCollectorResource sqlCollector = client.GetSqlCollectorResource(sqlCollectorResourceId); + + // invoke the operation + SqlCollectorResource result = await sqlCollector.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SqlCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_SqlCollectorOperationsDelete() + { + // Generated from example definition: 2024-03-03-preview/SqlCollectorOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "SqlCollector_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlCollectorResource created on azure + // for more information of creating SqlCollectorResource, please refer to the document of SqlCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string collectorName = "fci-test0c1esqlsitecollector"; + ResourceIdentifier sqlCollectorResourceId = SqlCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, collectorName); + SqlCollectorResource sqlCollector = client.GetSqlCollectorResource(sqlCollectorResourceId); + + // invoke the operation + await sqlCollector.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_SqlCollectorOperationsCreate() + { + // Generated from example definition: 2024-03-03-preview/SqlCollectorOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "SqlCollector_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlCollectorResource created on azure + // for more information of creating SqlCollectorResource, please refer to the document of SqlCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "rgmigrate"; + string projectName = "fci-test6904project"; + string collectorName = "fci-test0c1esqlsitecollector"; + ResourceIdentifier sqlCollectorResourceId = SqlCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, collectorName); + SqlCollectorResource sqlCollector = client.GetSqlCollectorResource(sqlCollectorResourceId); + + // invoke the operation + SqlCollectorData data = new SqlCollectorData + { + Properties = new CollectorPropertiesBaseWithAgent + { + AgentProperties = new CollectorAgentPropertiesBase + { + Id = "630da710-4d44-41f7-a189-72fe3db5502b-agent", + SpnDetails = new CollectorAgentSpnPropertiesBase + { + Authority = "https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", + ApplicationId = "db9c4c3d-477c-4d5a-817b-318276713565", + Audience = "db9c4c3d-477c-4d5a-817b-318276713565", + ObjectId = "e50236ad-ad07-47d4-af71-ed7b52d200d5", + TenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47", + }, + }, + DiscoverySiteId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/bansalankit-rg/providers/Microsoft.OffAzure/MasterSites/fci-ankit-test6065mastersite/SqlSites/fci-ankit-test6065sqlsites", + }, + }; + ArmOperation lro = await sqlCollector.UpdateAsync(WaitUntil.Completed, data); + SqlCollectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SqlCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlGraphAssessmentOptionCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlGraphAssessmentOptionCollection.cs new file mode 100644 index 000000000000..f0ae6c5db983 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlGraphAssessmentOptionCollection.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_SqlGraphAssessmentOptionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SqlGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SqlGraphAssessmentOptionResource + string projectName = "contosoProject"; + SqlGraphAssessmentOptionCollection collection = resourceGroupResource.GetSqlGraphAssessmentOptions(projectName); + + // invoke the operation + SqlGraphAssessmentOptionResource result = await collection.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SqlGraphAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_SqlGraphAssessmentOptionsOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlGraphAssessmentOptionsOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "SqlGraphAssessmentOptions_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "C1DB66AE-BCF9-42FD-ADC2-390E0721C351"; + string resourceGroupName = "rgsqlAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SqlGraphAssessmentOptionResource + string projectName = "contosoProject"; + SqlGraphAssessmentOptionCollection collection = resourceGroupResource.GetSqlGraphAssessmentOptions(projectName); + + // invoke the operation and iterate over the result + await foreach (SqlGraphAssessmentOptionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SqlGraphAssessmentOptionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_SqlGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SqlGraphAssessmentOptionResource + string projectName = "contosoProject"; + SqlGraphAssessmentOptionCollection collection = resourceGroupResource.GetSqlGraphAssessmentOptions(projectName); + + // invoke the operation + bool result = await collection.ExistsAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SqlGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SqlGraphAssessmentOptionResource + string projectName = "contosoProject"; + SqlGraphAssessmentOptionCollection collection = resourceGroupResource.GetSqlGraphAssessmentOptions(projectName); + + // invoke the operation + NullableResponse response = await collection.GetIfExistsAsync(); + SqlGraphAssessmentOptionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SqlGraphAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlGraphAssessmentOptionResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlGraphAssessmentOptionResource.cs new file mode 100644 index 000000000000..59cbf2f76266 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlGraphAssessmentOptionResource.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_SqlGraphAssessmentOptionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SqlGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlGraphAssessmentOptionResource created on azure + // for more information of creating SqlGraphAssessmentOptionResource, please refer to the document of SqlGraphAssessmentOptionResource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + ResourceIdentifier sqlGraphAssessmentOptionResourceId = SqlGraphAssessmentOptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + SqlGraphAssessmentOptionResource sqlGraphAssessmentOption = client.GetSqlGraphAssessmentOptionResource(sqlGraphAssessmentOptionResourceId); + + // invoke the operation + SqlGraphAssessmentOptionResource result = await sqlGraphAssessmentOption.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SqlGraphAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..cfa3841977c8 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAssessmentProjects_AssessmentProjectsOperationsListBySubscription() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectsOperations_ListBySubscription_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProject_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (AssessmentProjectResource item in subscriptionResource.GetAssessmentProjectsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AssessmentProjectData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_VmwareCollectorCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_VmwareCollectorCollection.cs new file mode 100644 index 000000000000..0067fccafd4c --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_VmwareCollectorCollection.cs @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_VmwareCollectorCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_VmwareCollectorsOperationsCreate() + { + // Generated from example definition: 2024-03-03-preview/VmwareCollectorsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "VmwareCollector_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this VmwareCollectorResource + string projectName = "app18700project"; + VmwareCollectorCollection collection = resourceGroupResource.GetVmwareCollectors(projectName); + + // invoke the operation + string vmWareCollectorName = "Vmware2258collector"; + VmwareCollectorData data = new VmwareCollectorData + { + Properties = new CollectorPropertiesBaseWithAgent + { + AgentProperties = new CollectorAgentPropertiesBase + { + Id = "fe243486-3318-41fa-aaba-c48b5df75308", + Version = "1.0.8.383", + LastHeartbeatUtc = DateTimeOffset.Parse("2022-03-29T12:10:08.9167289Z"), + SpnDetails = new CollectorAgentSpnPropertiesBase + { + Authority = "https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", + ApplicationId = "82b3e452-c0e8-4662-8347-58282925ae84", + Audience = "82b3e452-c0e8-4662-8347-58282925ae84", + ObjectId = "3fc89111-1405-4938-9214-37aa4739401d", + TenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47", + }, + }, + DiscoverySiteId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawRG/providers/Microsoft.OffAzure/VMwareSites/Vmware2744site", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, vmWareCollectorName, data); + VmwareCollectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + VmwareCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_VmwareCollectorsOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/VmwareCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "VmwareCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this VmwareCollectorResource + string projectName = "app18700project"; + VmwareCollectorCollection collection = resourceGroupResource.GetVmwareCollectors(projectName); + + // invoke the operation + string vmWareCollectorName = "Vmware2258collector"; + VmwareCollectorResource result = await collection.GetAsync(vmWareCollectorName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + VmwareCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_VmwareCollectorsOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/VmwareCollectorsOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "VmwareCollector_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this VmwareCollectorResource + string projectName = "app18700project"; + VmwareCollectorCollection collection = resourceGroupResource.GetVmwareCollectors(projectName); + + // invoke the operation and iterate over the result + await foreach (VmwareCollectorResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + VmwareCollectorData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_VmwareCollectorsOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/VmwareCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "VmwareCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this VmwareCollectorResource + string projectName = "app18700project"; + VmwareCollectorCollection collection = resourceGroupResource.GetVmwareCollectors(projectName); + + // invoke the operation + string vmWareCollectorName = "Vmware2258collector"; + bool result = await collection.ExistsAsync(vmWareCollectorName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_VmwareCollectorsOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/VmwareCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "VmwareCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this VmwareCollectorResource + string projectName = "app18700project"; + VmwareCollectorCollection collection = resourceGroupResource.GetVmwareCollectors(projectName); + + // invoke the operation + string vmWareCollectorName = "Vmware2258collector"; + NullableResponse response = await collection.GetIfExistsAsync(vmWareCollectorName); + VmwareCollectorResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + VmwareCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_VmwareCollectorResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_VmwareCollectorResource.cs new file mode 100644 index 000000000000..2047218e49f4 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_VmwareCollectorResource.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_VmwareCollectorResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_VmwareCollectorsOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/VmwareCollectorsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "VmwareCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this VmwareCollectorResource created on azure + // for more information of creating VmwareCollectorResource, please refer to the document of VmwareCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + string vmWareCollectorName = "Vmware2258collector"; + ResourceIdentifier vmwareCollectorResourceId = VmwareCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, vmWareCollectorName); + VmwareCollectorResource vmwareCollector = client.GetVmwareCollectorResource(vmwareCollectorResourceId); + + // invoke the operation + VmwareCollectorResource result = await vmwareCollector.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + VmwareCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_VmwareCollectorsOperationsDelete() + { + // Generated from example definition: 2024-03-03-preview/VmwareCollectorsOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "VmwareCollector_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this VmwareCollectorResource created on azure + // for more information of creating VmwareCollectorResource, please refer to the document of VmwareCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + string vmWareCollectorName = "Vmware2258collector"; + ResourceIdentifier vmwareCollectorResourceId = VmwareCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, vmWareCollectorName); + VmwareCollectorResource vmwareCollector = client.GetVmwareCollectorResource(vmwareCollectorResourceId); + + // invoke the operation + await vmwareCollector.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_VmwareCollectorsOperationsCreate() + { + // Generated from example definition: 2024-03-03-preview/VmwareCollectorsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "VmwareCollector_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this VmwareCollectorResource created on azure + // for more information of creating VmwareCollectorResource, please refer to the document of VmwareCollectorResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "ayagrawRG"; + string projectName = "app18700project"; + string vmWareCollectorName = "Vmware2258collector"; + ResourceIdentifier vmwareCollectorResourceId = VmwareCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, vmWareCollectorName); + VmwareCollectorResource vmwareCollector = client.GetVmwareCollectorResource(vmwareCollectorResourceId); + + // invoke the operation + VmwareCollectorData data = new VmwareCollectorData + { + Properties = new CollectorPropertiesBaseWithAgent + { + AgentProperties = new CollectorAgentPropertiesBase + { + Id = "fe243486-3318-41fa-aaba-c48b5df75308", + Version = "1.0.8.383", + LastHeartbeatUtc = DateTimeOffset.Parse("2022-03-29T12:10:08.9167289Z"), + SpnDetails = new CollectorAgentSpnPropertiesBase + { + Authority = "https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", + ApplicationId = "82b3e452-c0e8-4662-8347-58282925ae84", + Audience = "82b3e452-c0e8-4662-8347-58282925ae84", + ObjectId = "3fc89111-1405-4938-9214-37aa4739401d", + TenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47", + }, + }, + DiscoverySiteId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawRG/providers/Microsoft.OffAzure/VMwareSites/Vmware2744site", + }, + }; + ArmOperation lro = await vmwareCollector.UpdateAsync(WaitUntil.Completed, data); + VmwareCollectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + VmwareCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3Collection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3Collection.cs new file mode 100644 index 000000000000..e14f8f9cfd3c --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3Collection.cs @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_WebAppAssessmentV3Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_WebAppAssessmentV3OperationsCreateMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3Operations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WebAppAssessmentV3Resource + string projectName = "contosoProject"; + WebAppAssessmentV3Collection collection = resourceGroupResource.GetWebAppAssessmentV3s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + WebAppAssessmentV3Data data = new WebAppAssessmentV3Data + { + Properties = new WebAppAssessmentV3Properties + { + Scope = new Scope + { + ScopeType = ScopeType.ServerGroupId, + ServerGroupId = "sxwigkygd", + AzureResourceGraphQuery = "mjonozzzflcglhdb", + }, + Settings = new WebAppAssessmentSettings(new AppSvcNativeSettings(true), new AppSvcContainerSettings(true), AzureSecurityOfferingType.NO) + { + AzureLocation = "khzvggbrcnpkzrqdtvvyytc", + Currency = AzureCurrency.Unknown, + ScalingFactor = 6F, + DiscountPercentage = 12F, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased, + PerformanceData = new PerformanceData + { + Percentile = new Percentile("Unknown"), + TimeRange = TimeRange.Day, + PerfDataStartOn = DateTimeOffset.Parse("2025-02-21T06:18:34.789Z"), + PerfDataEndOn = DateTimeOffset.Parse("2025-02-21T06:18:34.789Z"), + }, + SavingsSettings = new SavingsSettings + { + SavingsOptions = SavingsOption.None, + AzureOfferCode = AzureOffer.Unknown, + }, + BillingSettings = new BillingSettings + { + LicensingProgram = LicensingProgram.Retail, + SubscriptionId = "lakvxkjeqpajer", + }, + EnvironmentType = EnvironmentType.Production, + }, + Details = new AssessmentDetails(), + FallbackMachineAssessmentArmId = "gfjcubgnh", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, assessmentName, data); + WebAppAssessmentV3Resource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppAssessmentV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_WebAppAssessmentV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WebAppAssessmentV3Resource + string projectName = "contosoProject"; + WebAppAssessmentV3Collection collection = resourceGroupResource.GetWebAppAssessmentV3s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + WebAppAssessmentV3Resource result = await collection.GetAsync(assessmentName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppAssessmentV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_WebAppAssessmentV3OperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3Operations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WebAppAssessmentV3Resource + string projectName = "contosoProject"; + WebAppAssessmentV3Collection collection = resourceGroupResource.GetWebAppAssessmentV3s(projectName); + + // invoke the operation and iterate over the result + await foreach (WebAppAssessmentV3Resource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppAssessmentV3Data resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_WebAppAssessmentV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WebAppAssessmentV3Resource + string projectName = "contosoProject"; + WebAppAssessmentV3Collection collection = resourceGroupResource.GetWebAppAssessmentV3s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + bool result = await collection.ExistsAsync(assessmentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_WebAppAssessmentV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WebAppAssessmentV3Resource + string projectName = "contosoProject"; + WebAppAssessmentV3Collection collection = resourceGroupResource.GetWebAppAssessmentV3s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + NullableResponse response = await collection.GetIfExistsAsync(assessmentName); + WebAppAssessmentV3Resource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppAssessmentV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3Resource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3Resource.cs new file mode 100644 index 000000000000..622ffc525fcc --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3Resource.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_WebAppAssessmentV3Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_WebAppAssessmentV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // invoke the operation + WebAppAssessmentV3Resource result = await webAppAssessmentV3.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppAssessmentV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_WebAppAssessmentV3OperationsDeleteMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3Operations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // invoke the operation + await webAppAssessmentV3.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_WebAppAssessmentV3OperationsCreateMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3Operations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // invoke the operation + WebAppAssessmentV3Data data = new WebAppAssessmentV3Data + { + Properties = new WebAppAssessmentV3Properties + { + Scope = new Scope + { + ScopeType = ScopeType.ServerGroupId, + ServerGroupId = "sxwigkygd", + AzureResourceGraphQuery = "mjonozzzflcglhdb", + }, + Settings = new WebAppAssessmentSettings(new AppSvcNativeSettings(true), new AppSvcContainerSettings(true), AzureSecurityOfferingType.NO) + { + AzureLocation = "khzvggbrcnpkzrqdtvvyytc", + Currency = AzureCurrency.Unknown, + ScalingFactor = 6F, + DiscountPercentage = 12F, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased, + PerformanceData = new PerformanceData + { + Percentile = new Percentile("Unknown"), + TimeRange = TimeRange.Day, + PerfDataStartOn = DateTimeOffset.Parse("2025-02-21T06:18:34.789Z"), + PerfDataEndOn = DateTimeOffset.Parse("2025-02-21T06:18:34.789Z"), + }, + SavingsSettings = new SavingsSettings + { + SavingsOptions = SavingsOption.None, + AzureOfferCode = AzureOffer.Unknown, + }, + BillingSettings = new BillingSettings + { + LicensingProgram = LicensingProgram.Retail, + SubscriptionId = "lakvxkjeqpajer", + }, + EnvironmentType = EnvironmentType.Production, + }, + Details = new AssessmentDetails(), + FallbackMachineAssessmentArmId = "gfjcubgnh", + }, + }; + ArmOperation lro = await webAppAssessmentV3.UpdateAsync(WaitUntil.Completed, data); + WebAppAssessmentV3Resource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppAssessmentV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task DownloadUrl_WebAppAssessmentV3OperationsDownloadUrlMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3Operations_DownloadUrl_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3Operations_DownloadUrl" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // invoke the operation + DownloadUrlContent content = new DownloadUrlContent(); + ArmOperation lro = await webAppAssessmentV3.DownloadUrlAsync(WaitUntil.Completed, content); + DownloadUri result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3SummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3SummaryCollection.cs new file mode 100644 index 000000000000..698a93b886c1 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3SummaryCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_WebAppAssessmentV3SummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_WebAppAssessmentV3SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // get the collection of this WebAppAssessmentV3SummaryResource + WebAppAssessmentV3SummaryCollection collection = webAppAssessmentV3.GetWebAppAssessmentV3Summaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + WebAppAssessmentV3SummaryResource result = await collection.GetAsync(summaryName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppAssessmentV3SummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_WebAppAssessmentV3SummaryOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3SummaryOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3Summary_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // get the collection of this WebAppAssessmentV3SummaryResource + WebAppAssessmentV3SummaryCollection collection = webAppAssessmentV3.GetWebAppAssessmentV3Summaries(); + + // invoke the operation and iterate over the result + await foreach (WebAppAssessmentV3SummaryResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppAssessmentV3SummaryData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_WebAppAssessmentV3SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // get the collection of this WebAppAssessmentV3SummaryResource + WebAppAssessmentV3SummaryCollection collection = webAppAssessmentV3.GetWebAppAssessmentV3Summaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + bool result = await collection.ExistsAsync(summaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_WebAppAssessmentV3SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // get the collection of this WebAppAssessmentV3SummaryResource + WebAppAssessmentV3SummaryCollection collection = webAppAssessmentV3.GetWebAppAssessmentV3Summaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + NullableResponse response = await collection.GetIfExistsAsync(summaryName); + WebAppAssessmentV3SummaryResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppAssessmentV3SummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3SummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3SummaryResource.cs new file mode 100644 index 000000000000..27f4df03781f --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3SummaryResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_WebAppAssessmentV3SummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_WebAppAssessmentV3SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3SummaryResource created on azure + // for more information of creating WebAppAssessmentV3SummaryResource, please refer to the document of WebAppAssessmentV3SummaryResource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + string summaryName = "PaaSPreferred"; + ResourceIdentifier webAppAssessmentV3SummaryResourceId = WebAppAssessmentV3SummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, summaryName); + WebAppAssessmentV3SummaryResource webAppAssessmentV3Summary = client.GetWebAppAssessmentV3SummaryResource(webAppAssessmentV3SummaryResourceId); + + // invoke the operation + WebAppAssessmentV3SummaryResource result = await webAppAssessmentV3Summary.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppAssessmentV3SummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppCollectorCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppCollectorCollection.cs new file mode 100644 index 000000000000..dca869db8d63 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppCollectorCollection.cs @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_WebAppCollectorCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_WebAppCollectorOperationsCreate() + { + // Generated from example definition: 2024-03-03-preview/WebAppCollectorOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppCollector_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "6D59B561-47B6-4AB8-84B5-39CF2B808C26"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WebAppCollectorResource + string projectName = "sumukk-ccy-bcs4557project"; + WebAppCollectorCollection collection = resourceGroupResource.GetWebAppCollectors(projectName); + + // invoke the operation + string collectorName = "collector1"; + WebAppCollectorData data = new WebAppCollectorData + { + Properties = new CollectorPropertiesBaseWithAgent + { + AgentProperties = new CollectorAgentPropertiesBase + { + Id = "fed93df5-b787-4e3f-a764-e3d2b9101a59-agent", + LastHeartbeatUtc = DateTimeOffset.Parse("2023-11-03T05:43:02.078Z"), + SpnDetails = new CollectorAgentSpnPropertiesBase + { + Authority = "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47", + ApplicationId = "2f70d5e8-7adc-4c64-910a-7031079efc6e", + Audience = "2f70d5e8-7adc-4c64-910a-7031079efc6e", + ObjectId = "2f70d5e8-7adc-4c64-910a-7031079efc6e", + TenantId = "2f70d5e8-7adc-4c64-910a-7031079efc6e", + }, + }, + DiscoverySiteId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sumukk-ccy-bcs/providers/Microsoft.OffAzure/MasterSites/sumukk-ccy-bcs9880mastersite/WebAppSites/sumukk-ccy-bcs9880webappsites", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, collectorName, data); + WebAppCollectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_WebAppCollectorOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/WebAppCollectorOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "6D59B561-47B6-4AB8-84B5-39CF2B808C26"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WebAppCollectorResource + string projectName = "sumukk-ccy-bcs4557project"; + WebAppCollectorCollection collection = resourceGroupResource.GetWebAppCollectors(projectName); + + // invoke the operation + string collectorName = "collector1"; + WebAppCollectorResource result = await collection.GetAsync(collectorName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_WebAppCollectorOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppCollectorOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppCollector_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "6D59B561-47B6-4AB8-84B5-39CF2B808C26"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WebAppCollectorResource + string projectName = "sumukk-ccy-bcs4557project"; + WebAppCollectorCollection collection = resourceGroupResource.GetWebAppCollectors(projectName); + + // invoke the operation and iterate over the result + await foreach (WebAppCollectorResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppCollectorData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_WebAppCollectorOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/WebAppCollectorOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "6D59B561-47B6-4AB8-84B5-39CF2B808C26"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WebAppCollectorResource + string projectName = "sumukk-ccy-bcs4557project"; + WebAppCollectorCollection collection = resourceGroupResource.GetWebAppCollectors(projectName); + + // invoke the operation + string collectorName = "collector1"; + bool result = await collection.ExistsAsync(collectorName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_WebAppCollectorOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/WebAppCollectorOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "6D59B561-47B6-4AB8-84B5-39CF2B808C26"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WebAppCollectorResource + string projectName = "sumukk-ccy-bcs4557project"; + WebAppCollectorCollection collection = resourceGroupResource.GetWebAppCollectors(projectName); + + // invoke the operation + string collectorName = "collector1"; + NullableResponse response = await collection.GetIfExistsAsync(collectorName); + WebAppCollectorResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppCollectorResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppCollectorResource.cs new file mode 100644 index 000000000000..22ff21fc0e91 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppCollectorResource.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_WebAppCollectorResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_WebAppCollectorOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/WebAppCollectorOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppCollector_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppCollectorResource created on azure + // for more information of creating WebAppCollectorResource, please refer to the document of WebAppCollectorResource + string subscriptionId = "6D59B561-47B6-4AB8-84B5-39CF2B808C26"; + string resourceGroupName = "rgopenapi"; + string projectName = "sumukk-ccy-bcs4557project"; + string collectorName = "collector1"; + ResourceIdentifier webAppCollectorResourceId = WebAppCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, collectorName); + WebAppCollectorResource webAppCollector = client.GetWebAppCollectorResource(webAppCollectorResourceId); + + // invoke the operation + WebAppCollectorResource result = await webAppCollector.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_WebAppCollectorOperationsDelete() + { + // Generated from example definition: 2024-03-03-preview/WebAppCollectorOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppCollector_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppCollectorResource created on azure + // for more information of creating WebAppCollectorResource, please refer to the document of WebAppCollectorResource + string subscriptionId = "6D59B561-47B6-4AB8-84B5-39CF2B808C26"; + string resourceGroupName = "rgopenapi"; + string projectName = "sumukk-ccy-bcs4557project"; + string collectorName = "collector1"; + ResourceIdentifier webAppCollectorResourceId = WebAppCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, collectorName); + WebAppCollectorResource webAppCollector = client.GetWebAppCollectorResource(webAppCollectorResourceId); + + // invoke the operation + await webAppCollector.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_WebAppCollectorOperationsCreate() + { + // Generated from example definition: 2024-03-03-preview/WebAppCollectorOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppCollector_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppCollectorResource created on azure + // for more information of creating WebAppCollectorResource, please refer to the document of WebAppCollectorResource + string subscriptionId = "6D59B561-47B6-4AB8-84B5-39CF2B808C26"; + string resourceGroupName = "rgopenapi"; + string projectName = "sumukk-ccy-bcs4557project"; + string collectorName = "collector1"; + ResourceIdentifier webAppCollectorResourceId = WebAppCollectorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, collectorName); + WebAppCollectorResource webAppCollector = client.GetWebAppCollectorResource(webAppCollectorResourceId); + + // invoke the operation + WebAppCollectorData data = new WebAppCollectorData + { + Properties = new CollectorPropertiesBaseWithAgent + { + AgentProperties = new CollectorAgentPropertiesBase + { + Id = "fed93df5-b787-4e3f-a764-e3d2b9101a59-agent", + LastHeartbeatUtc = DateTimeOffset.Parse("2023-11-03T05:43:02.078Z"), + SpnDetails = new CollectorAgentSpnPropertiesBase + { + Authority = "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47", + ApplicationId = "2f70d5e8-7adc-4c64-910a-7031079efc6e", + Audience = "2f70d5e8-7adc-4c64-910a-7031079efc6e", + ObjectId = "2f70d5e8-7adc-4c64-910a-7031079efc6e", + TenantId = "2f70d5e8-7adc-4c64-910a-7031079efc6e", + }, + }, + DiscoverySiteId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sumukk-ccy-bcs/providers/Microsoft.OffAzure/MasterSites/sumukk-ccy-bcs9880mastersite/WebAppSites/sumukk-ccy-bcs9880webappsites", + }, + }; + ArmOperation lro = await webAppCollector.UpdateAsync(WaitUntil.Completed, data); + WebAppCollectorResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppCollectorData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppCompoundAssessmentSummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppCompoundAssessmentSummaryCollection.cs new file mode 100644 index 000000000000..b25cb2846a00 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppCompoundAssessmentSummaryCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_WebAppCompoundAssessmentSummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CompoundAssessmentSummaryOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppCompoundAssessmentSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CompoundAssessmentResource created on azure + // for more information of creating CompoundAssessmentResource, please refer to the document of CompoundAssessmentResource + string subscriptionId = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + string projectName = "contosoProject"; + string compoundAssessmentName = "assessmentName"; + ResourceIdentifier compoundAssessmentResourceId = CompoundAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + CompoundAssessmentResource compoundAssessment = client.GetCompoundAssessmentResource(compoundAssessmentResourceId); + + // get the collection of this WebAppCompoundAssessmentSummaryResource + WebAppCompoundAssessmentSummaryCollection collection = compoundAssessment.GetWebAppCompoundAssessmentSummaries(); + + // invoke the operation + string summaryName = "Modernize"; + WebAppCompoundAssessmentSummaryResource result = await collection.GetAsync(summaryName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppCompoundAssessmentSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_CompoundAssessmentSummaryOperationsListByParent() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentSummaryOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppCompoundAssessmentSummary_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CompoundAssessmentResource created on azure + // for more information of creating CompoundAssessmentResource, please refer to the document of CompoundAssessmentResource + string subscriptionId = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + string projectName = "contosoProject"; + string compoundAssessmentName = "assessmentName"; + ResourceIdentifier compoundAssessmentResourceId = CompoundAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + CompoundAssessmentResource compoundAssessment = client.GetCompoundAssessmentResource(compoundAssessmentResourceId); + + // get the collection of this WebAppCompoundAssessmentSummaryResource + WebAppCompoundAssessmentSummaryCollection collection = compoundAssessment.GetWebAppCompoundAssessmentSummaries(); + + // invoke the operation and iterate over the result + await foreach (WebAppCompoundAssessmentSummaryResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppCompoundAssessmentSummaryData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_CompoundAssessmentSummaryOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppCompoundAssessmentSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CompoundAssessmentResource created on azure + // for more information of creating CompoundAssessmentResource, please refer to the document of CompoundAssessmentResource + string subscriptionId = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + string projectName = "contosoProject"; + string compoundAssessmentName = "assessmentName"; + ResourceIdentifier compoundAssessmentResourceId = CompoundAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + CompoundAssessmentResource compoundAssessment = client.GetCompoundAssessmentResource(compoundAssessmentResourceId); + + // get the collection of this WebAppCompoundAssessmentSummaryResource + WebAppCompoundAssessmentSummaryCollection collection = compoundAssessment.GetWebAppCompoundAssessmentSummaries(); + + // invoke the operation + string summaryName = "Modernize"; + bool result = await collection.ExistsAsync(summaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_CompoundAssessmentSummaryOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppCompoundAssessmentSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CompoundAssessmentResource created on azure + // for more information of creating CompoundAssessmentResource, please refer to the document of CompoundAssessmentResource + string subscriptionId = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + string projectName = "contosoProject"; + string compoundAssessmentName = "assessmentName"; + ResourceIdentifier compoundAssessmentResourceId = CompoundAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + CompoundAssessmentResource compoundAssessment = client.GetCompoundAssessmentResource(compoundAssessmentResourceId); + + // get the collection of this WebAppCompoundAssessmentSummaryResource + WebAppCompoundAssessmentSummaryCollection collection = compoundAssessment.GetWebAppCompoundAssessmentSummaries(); + + // invoke the operation + string summaryName = "Modernize"; + NullableResponse response = await collection.GetIfExistsAsync(summaryName); + WebAppCompoundAssessmentSummaryResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppCompoundAssessmentSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppCompoundAssessmentSummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppCompoundAssessmentSummaryResource.cs new file mode 100644 index 000000000000..de472c398784 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppCompoundAssessmentSummaryResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_WebAppCompoundAssessmentSummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CompoundAssessmentSummaryOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppCompoundAssessmentSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppCompoundAssessmentSummaryResource created on azure + // for more information of creating WebAppCompoundAssessmentSummaryResource, please refer to the document of WebAppCompoundAssessmentSummaryResource + string subscriptionId = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + string projectName = "contosoProject"; + string compoundAssessmentName = "assessmentName"; + string summaryName = "Modernize"; + ResourceIdentifier webAppCompoundAssessmentSummaryResourceId = WebAppCompoundAssessmentSummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, compoundAssessmentName, summaryName); + WebAppCompoundAssessmentSummaryResource webAppCompoundAssessmentSummary = client.GetWebAppCompoundAssessmentSummaryResource(webAppCompoundAssessmentSummaryResourceId); + + // invoke the operation + WebAppCompoundAssessmentSummaryResource result = await webAppCompoundAssessmentSummary.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppCompoundAssessmentSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppServicePlanV3Collection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppServicePlanV3Collection.cs new file mode 100644 index 000000000000..4d43621182ca --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppServicePlanV3Collection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_WebAppServicePlanV3Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_WebAppServicePlansOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppServicePlansOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppServicePlanV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // get the collection of this WebAppServicePlanV3Resource + WebAppServicePlanV3Collection collection = webAppAssessmentV3.GetWebAppServicePlanV3s(); + + // invoke the operation + string servicePlanName = "sp1"; + WebAppServicePlanV3Resource result = await collection.GetAsync(servicePlanName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppServicePlanV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_WebAppServicePlansOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppServicePlansOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppServicePlanV3_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // get the collection of this WebAppServicePlanV3Resource + WebAppServicePlanV3Collection collection = webAppAssessmentV3.GetWebAppServicePlanV3s(); + + // invoke the operation and iterate over the result + await foreach (WebAppServicePlanV3Resource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppServicePlanV3Data resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_WebAppServicePlansOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppServicePlansOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppServicePlanV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // get the collection of this WebAppServicePlanV3Resource + WebAppServicePlanV3Collection collection = webAppAssessmentV3.GetWebAppServicePlanV3s(); + + // invoke the operation + string servicePlanName = "sp1"; + bool result = await collection.ExistsAsync(servicePlanName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_WebAppServicePlansOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppServicePlansOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppServicePlanV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // get the collection of this WebAppServicePlanV3Resource + WebAppServicePlanV3Collection collection = webAppAssessmentV3.GetWebAppServicePlanV3s(); + + // invoke the operation + string servicePlanName = "sp1"; + NullableResponse response = await collection.GetIfExistsAsync(servicePlanName); + WebAppServicePlanV3Resource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppServicePlanV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppServicePlanV3Resource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppServicePlanV3Resource.cs new file mode 100644 index 000000000000..43cf523407a9 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppServicePlanV3Resource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_WebAppServicePlanV3Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_WebAppServicePlansOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppServicePlansOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppServicePlanV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppServicePlanV3Resource created on azure + // for more information of creating WebAppServicePlanV3Resource, please refer to the document of WebAppServicePlanV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + string servicePlanName = "sp1"; + ResourceIdentifier webAppServicePlanV3ResourceId = WebAppServicePlanV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, servicePlanName); + WebAppServicePlanV3Resource webAppServicePlanV3 = client.GetWebAppServicePlanV3Resource(webAppServicePlanV3ResourceId); + + // invoke the operation + WebAppServicePlanV3Resource result = await webAppServicePlanV3.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppServicePlanV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WepAppGraphAssessmentOptionCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WepAppGraphAssessmentOptionCollection.cs new file mode 100644 index 000000000000..98d421c46b37 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WepAppGraphAssessmentOptionCollection.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_WepAppGraphAssessmentOptionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_WebAppGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WepAppGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WepAppGraphAssessmentOptionResource + string projectName = "contosoProject"; + WepAppGraphAssessmentOptionCollection collection = resourceGroupResource.GetWepAppGraphAssessmentOptions(projectName); + + // invoke the operation + WepAppGraphAssessmentOptionResource result = await collection.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WepAppGraphAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_WebAppGraphAssessmentOptionsOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppGraphAssessmentOptionsOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "WepAppGraphAssessmentOptions_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WepAppGraphAssessmentOptionResource + string projectName = "contosoProject"; + WepAppGraphAssessmentOptionCollection collection = resourceGroupResource.GetWepAppGraphAssessmentOptions(projectName); + + // invoke the operation and iterate over the result + await foreach (WepAppGraphAssessmentOptionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WepAppGraphAssessmentOptionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_WebAppGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WepAppGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WepAppGraphAssessmentOptionResource + string projectName = "contosoProject"; + WepAppGraphAssessmentOptionCollection collection = resourceGroupResource.GetWepAppGraphAssessmentOptions(projectName); + + // invoke the operation + bool result = await collection.ExistsAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_WebAppGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WepAppGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WepAppGraphAssessmentOptionResource + string projectName = "contosoProject"; + WepAppGraphAssessmentOptionCollection collection = resourceGroupResource.GetWepAppGraphAssessmentOptions(projectName); + + // invoke the operation + NullableResponse response = await collection.GetIfExistsAsync(); + WepAppGraphAssessmentOptionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WepAppGraphAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WepAppGraphAssessmentOptionResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WepAppGraphAssessmentOptionResource.cs new file mode 100644 index 000000000000..2bd7aa063fca --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WepAppGraphAssessmentOptionResource.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_WepAppGraphAssessmentOptionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_WebAppGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WepAppGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WepAppGraphAssessmentOptionResource created on azure + // for more information of creating WepAppGraphAssessmentOptionResource, please refer to the document of WepAppGraphAssessmentOptionResource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + ResourceIdentifier wepAppGraphAssessmentOptionResourceId = WepAppGraphAssessmentOptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + WepAppGraphAssessmentOptionResource wepAppGraphAssessmentOption = client.GetWepAppGraphAssessmentOptionResource(wepAppGraphAssessmentOptionResourceId); + + // invoke the operation + WepAppGraphAssessmentOptionResource result = await wepAppGraphAssessmentOption.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WepAppGraphAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} 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..1e9a2162550b --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Azure.ResourceManager.Migrate.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider Migrate. + 1.0.0-beta.1 + azure;management;arm;resource manager;migrate + Azure.ResourceManager.Migrate + + diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ArmMigrateModelFactory.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ArmMigrateModelFactory.cs new file mode 100644 index 000000000000..93461692d4ef --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ArmMigrateModelFactory.cs @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Model factory for models. + public static partial class ArmMigrateModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static CompoundAssessmentData CompoundAssessmentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, CompoundAssessmentProperties properties = null) + { + return new CompoundAssessmentData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The status of the last operation. + /// ARM IDs of the target assessments. + /// Fallback machine assessment ARM ID. + /// Details of the compound assessment. + /// A new instance for mocking. + public static CompoundAssessmentProperties CompoundAssessmentProperties(ProvisioningState? provisioningState = null, TargetAssessmentArmIds targetAssessmentArmIds = null, string fallbackMachineAssessmentArmId = null, CompoundAssessmentDetails details = null) + { + return new CompoundAssessmentProperties(provisioningState, targetAssessmentArmIds, fallbackMachineAssessmentArmId, details, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Timestamp when the assessment was created. + /// Timestamp when the assessment was last updated. + /// Status of the assessment. + /// A new instance for mocking. + public static CompoundAssessmentDetails CompoundAssessmentDetails(DateTimeOffset? createdTimestamp = null, DateTimeOffset? updatedTimestamp = null, AssessmentStatus status = default) + { + return new CompoundAssessmentDetails(createdTimestamp, updatedTimestamp, status, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Hyperlink to download report. + /// Expiry date of download url. + /// A new instance for mocking. + public static DownloadUri DownloadUri(string assessmentReportUri = null, DateTimeOffset expireOn = default) + { + return new DownloadUri(assessmentReportUri, expireOn, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static WebAppCompoundAssessmentSummaryData WebAppCompoundAssessmentSummaryData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, WebAppCompoundAssessmentSummaryProperties properties = null) + { + return new WebAppCompoundAssessmentSummaryData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The summary type. + /// The summary name. + /// The source details list. + /// The target details list. + /// The target source mapping. + /// The cost components. + /// The cost components. + /// Name of the assessment. + /// Light summary of the compound assessment. + /// A new instance for mocking. + public static WebAppCompoundAssessmentSummaryProperties WebAppCompoundAssessmentSummaryProperties(SummaryType? summaryType = null, string summaryName = null, IEnumerable sources = null, IEnumerable targets = null, IEnumerable targetSourceMapping = null, IEnumerable costComponents = null, IEnumerable savingsComponents = null, string assessmentName = null, DiscoveredLightSummary discoveredLightSummary = null) + { + sources ??= new List(); + targets ??= new List(); + targetSourceMapping ??= new List(); + costComponents ??= new List(); + savingsComponents ??= new List(); + + return new WebAppCompoundAssessmentSummaryProperties( + summaryType, + summaryName, + sources?.ToList(), + targets?.ToList(), + targetSourceMapping?.ToList(), + costComponents?.ToList(), + savingsComponents?.ToList(), + assessmentName, + discoveredLightSummary, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The source name. + /// The source type. + /// The migration platform. + /// The count of a type of source. + /// A new instance for mocking. + public static SourceDetails SourceDetails(AssessmentSource? sourceName = null, MigrateWorkloadType? sourceType = null, MigrationPlatform? platform = null, int? count = null) + { + return new SourceDetails(sourceName, sourceType, platform, count, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The target name. + /// The target type. + /// The migration platform. + /// The count of a type of source. + /// A new instance for mocking. + public static TargetDetails TargetDetails(AzureTarget? targetName = null, MigrateWorkloadType? targetType = null, MigrationPlatform? platform = null, int? count = null) + { + return new TargetDetails(targetName, targetType, platform, count, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The source name. + /// The target name. + /// The count of a type of source. + /// The count of a type of target. + /// The migration details. + /// The management details. + /// The cost details. + /// The savings details. + /// The confidence score. + /// A new instance for mocking. + public static TargetSourcePair TargetSourcePair(AssessmentSource? sourceRef = null, AzureTarget? targetRef = null, int? sourceCount = null, int? targetCount = null, MigrationDetails migrationDetails = null, IEnumerable managementDetails = null, IEnumerable costDetails = null, IEnumerable savingsDetails = null, double? confidenceScore = null) + { + managementDetails ??= new List(); + costDetails ??= new List(); + savingsDetails ??= new List(); + + return new TargetSourcePair( + sourceRef, + targetRef, + sourceCount, + targetCount, + migrationDetails, + managementDetails?.ToList(), + costDetails?.ToList(), + savingsDetails?.ToList(), + confidenceScore, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The readiness summary. + /// The migration type. + /// A new instance for mocking. + public static MigrationDetails MigrationDetails(IEnumerable readinessSummary = null, MigrationType? migrationType = null) + { + readinessSummary ??= new List(); + + return new MigrationDetails(readinessSummary?.ToList(), migrationType, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name. + /// The value. + /// A new instance for mocking. + public static NameValuePairCloudSuitabilityCommon NameValuePairCloudSuitabilityCommon(CloudSuitabilityCommon? name = null, int? value = null) + { + return new NameValuePairCloudSuitabilityCommon(name, value, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The management summary name. + /// The management suitability summary. + /// A new instance for mocking. + public static ManagementDetails ManagementDetails(AzureManagementOfferingType? name = null, IEnumerable readinessSummary = null) + { + readinessSummary ??= new List(); + + return new ManagementDetails(name, readinessSummary?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The savings options. + /// The sku cost details per azure offer type. + /// A new instance for mocking. + public static CostDetailsCommon CostDetailsCommon(SavingsOption? savingOptions = null, IEnumerable costDetail = null) + { + costDetail ??= new List(); + + return new CostDetailsCommon(savingOptions, costDetail?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name. + /// The value. + /// A new instance for mocking. + public static NameValuePairCostType NameValuePairCostType(CostType? name = null, float? value = null) + { + return new NameValuePairCostType(name, value, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The savings options. + /// The sku cost details per azure offer type. + /// A new instance for mocking. + public static SavingsDetailsCommon SavingsDetailsCommon(SavingsOption? savingOptions = null, IEnumerable savingsDetail = null) + { + savingsDetail ??= new List(); + + return new SavingsDetailsCommon(savingOptions, savingsDetail?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name. + /// The value. + /// A new instance for mocking. + public static NameValuePairSavingsType NameValuePairSavingsType(SavingsType? name = null, float? value = null) + { + return new NameValuePairSavingsType(name, value, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Number of web apps. + /// Number of web apps per type. + /// Number of web servers per type. + /// Number of web servers. + /// Number of servers. + /// A new instance for mocking. + public static DiscoveredLightSummary DiscoveredLightSummary(int numberOfWebApps = default, IEnumerable numberOfWebAppsPerType = null, IEnumerable numberOfWebServersPerType = null, int numberOfWebServers = default, int numberOfServers = default) + { + numberOfWebAppsPerType ??= new List(); + numberOfWebServersPerType ??= new List(); + + return new DiscoveredLightSummary( + numberOfWebApps, + numberOfWebAppsPerType?.ToList(), + numberOfWebServersPerType?.ToList(), + numberOfWebServers, + numberOfServers, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Name of the web app type. + /// Count of the web app type. + /// A new instance for mocking. + public static WebAppsPerType WebAppsPerType(WebAppType webAppType = default, int count = default) + { + return new WebAppsPerType(webAppType, count, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Name of the web app type. + /// Count of the web app type. + /// A new instance for mocking. + public static WebServersPerType WebServersPerType(WebServerType webServerType = default, int count = default) + { + return new WebServersPerType(webServerType, count, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentCollection.cs new file mode 100644 index 000000000000..db2e8f0942f5 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentCollection.cs @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.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 GetCompoundAssessments method from an instance of . + /// + public partial class CompoundAssessmentCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics; + private readonly CompoundAssessmentRestOperations _compoundAssessmentCompoundAssessmentOperationsRestClient; + private readonly string _projectName; + + /// Initializes a new instance of the class for mocking. + protected CompoundAssessmentCollection() + { + } + + /// 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. + /// Assessment Project Name. + /// is null. + /// is an empty string, and was expected to be non-empty. + internal CompoundAssessmentCollection(ArmClient client, ResourceIdentifier id, string projectName) : base(client, id) + { + _projectName = projectName; + _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", CompoundAssessmentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(CompoundAssessmentResource.ResourceType, out string compoundAssessmentCompoundAssessmentOperationsApiVersion); + _compoundAssessmentCompoundAssessmentOperationsRestClient = new CompoundAssessmentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, compoundAssessmentCompoundAssessmentOperationsApiVersion); +#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 CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Create + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Compound Assessment ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string compoundAssessmentName, CompoundAssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, _projectName, compoundAssessmentName, data, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(new CompoundAssessmentOperationSource(Client), _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics, Pipeline, _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, _projectName, compoundAssessmentName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Create + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Compound Assessment ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string compoundAssessmentName, CompoundAssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _compoundAssessmentCompoundAssessmentOperationsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, _projectName, compoundAssessmentName, data, cancellationToken); + var operation = new MigrateArmOperation(new CompoundAssessmentOperationSource(Client), _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics, Pipeline, _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, _projectName, compoundAssessmentName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentCollection.Get"); + scope.Start(); + try + { + var response = await _compoundAssessmentCompoundAssessmentOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _projectName, compoundAssessmentName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CompoundAssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentCollection.Get"); + scope.Start(); + try + { + var response = _compoundAssessmentCompoundAssessmentOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _projectName, compoundAssessmentName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CompoundAssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List CompoundAssessment resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments + /// + /// + /// Operation Id + /// CompoundAssessment_ListByParent + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, _projectName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, _projectName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CompoundAssessmentResource(Client, CompoundAssessmentData.DeserializeCompoundAssessmentData(e)), _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics, Pipeline, "CompoundAssessmentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List CompoundAssessment resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments + /// + /// + /// Operation Id + /// CompoundAssessment_ListByParent + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, _projectName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, _projectName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CompoundAssessmentResource(Client, CompoundAssessmentData.DeserializeCompoundAssessmentData(e)), _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics, Pipeline, "CompoundAssessmentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentCollection.Exists"); + scope.Start(); + try + { + var response = await _compoundAssessmentCompoundAssessmentOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _projectName, compoundAssessmentName, 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}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentCollection.Exists"); + scope.Start(); + try + { + var response = _compoundAssessmentCompoundAssessmentOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _projectName, compoundAssessmentName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _compoundAssessmentCompoundAssessmentOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _projectName, compoundAssessmentName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new CompoundAssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentCollection.GetIfExists"); + scope.Start(); + try + { + var response = _compoundAssessmentCompoundAssessmentOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _projectName, compoundAssessmentName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new CompoundAssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentData.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentData.Serialization.cs new file mode 100644 index 000000000000..5bdf90d848a3 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + public partial class CompoundAssessmentData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CompoundAssessmentData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + CompoundAssessmentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CompoundAssessmentData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCompoundAssessmentData(document.RootElement, options); + } + + internal static CompoundAssessmentData DeserializeCompoundAssessmentData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CompoundAssessmentProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = CompoundAssessmentProperties.DeserializeCompoundAssessmentProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CompoundAssessmentData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CompoundAssessmentData)} does not support writing '{options.Format}' format."); + } + } + + CompoundAssessmentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCompoundAssessmentData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CompoundAssessmentData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentData.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentData.cs new file mode 100644 index 000000000000..a5cafd77c013 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentData.cs @@ -0,0 +1,75 @@ +// 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.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// A class representing the CompoundAssessment data model. + /// Compound assessment resource. + /// + public partial class CompoundAssessmentData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public CompoundAssessmentData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal CompoundAssessmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, CompoundAssessmentProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public CompoundAssessmentProperties Properties { get; set; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentResource.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentResource.Serialization.cs new file mode 100644 index 000000000000..82dbb6cb9f09 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migrate +{ + public partial class CompoundAssessmentResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + CompoundAssessmentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + CompoundAssessmentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentResource.cs new file mode 100644 index 000000000000..6200fb0e173a --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentResource.cs @@ -0,0 +1,514 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// A Class representing a CompoundAssessment 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 GetCompoundAssessmentResource method. + /// Otherwise you can get one from its parent resource using the GetCompoundAssessment method. + /// + public partial class CompoundAssessmentResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The compoundAssessmentName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics; + private readonly CompoundAssessmentRestOperations _compoundAssessmentCompoundAssessmentOperationsRestClient; + private readonly CompoundAssessmentData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/webAppCompoundAssessments"; + + /// Initializes a new instance of the class for mocking. + protected CompoundAssessmentResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal CompoundAssessmentResource(ArmClient client, CompoundAssessmentData 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 CompoundAssessmentResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string compoundAssessmentCompoundAssessmentOperationsApiVersion); + _compoundAssessmentCompoundAssessmentOperationsRestClient = new CompoundAssessmentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, compoundAssessmentCompoundAssessmentOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual CompoundAssessmentData 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 WebAppCompoundAssessmentSummaryResources in the CompoundAssessment. + /// An object representing collection of WebAppCompoundAssessmentSummaryResources and their operations over a WebAppCompoundAssessmentSummaryResource. + public virtual WebAppCompoundAssessmentSummaryCollection GetWebAppCompoundAssessmentSummaries() + { + return GetCachedClient(client => new WebAppCompoundAssessmentSummaryCollection(client, Id)); + } + + /// + /// Get a WebAppCompoundAssessmentSummary + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// WebAppCompoundAssessmentSummary_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Gets the Name of the WebApp compound assessment summary. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetWebAppCompoundAssessmentSummaryAsync(string summaryName, CancellationToken cancellationToken = default) + { + return await GetWebAppCompoundAssessmentSummaries().GetAsync(summaryName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a WebAppCompoundAssessmentSummary + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// WebAppCompoundAssessmentSummary_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Gets the Name of the WebApp compound assessment summary. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetWebAppCompoundAssessmentSummary(string summaryName, CancellationToken cancellationToken = default) + { + return GetWebAppCompoundAssessmentSummaries().Get(summaryName, cancellationToken); + } + + /// + /// Get a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentResource.Get"); + scope.Start(); + try + { + var response = await _compoundAssessmentCompoundAssessmentOperationsRestClient.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 CompoundAssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentResource.Get"); + scope.Start(); + try + { + var response = _compoundAssessmentCompoundAssessmentOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CompoundAssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Delete + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentResource.Delete"); + scope.Start(); + try + { + var response = await _compoundAssessmentCompoundAssessmentOperationsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new MigrateArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Delete + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentResource.Delete"); + scope.Start(); + try + { + var response = _compoundAssessmentCompoundAssessmentOperationsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new MigrateArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Create + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, CompoundAssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentResource.Update"); + scope.Start(); + try + { + var response = await _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(new CompoundAssessmentOperationSource(Client), _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics, Pipeline, _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Create + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, CompoundAssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentResource.Update"); + scope.Start(); + try + { + var response = _compoundAssessmentCompoundAssessmentOperationsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MigrateArmOperation(new CompoundAssessmentOperationSource(Client), _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics, Pipeline, _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// A long-running resource action. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/downloadUrl + /// + /// + /// Operation Id + /// CompoundAssessmentOperations_DownloadUrl + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> DownloadUrlAsync(WaitUntil waitUntil, DownloadUrlContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentResource.DownloadUrl"); + scope.Start(); + try + { + var response = await _compoundAssessmentCompoundAssessmentOperationsRestClient.DownloadUrlAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(new DownloadUriOperationSource(), _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics, Pipeline, _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateDownloadUrlRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// A long-running resource action. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/downloadUrl + /// + /// + /// Operation Id + /// CompoundAssessmentOperations_DownloadUrl + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation DownloadUrl(WaitUntil waitUntil, DownloadUrlContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentResource.DownloadUrl"); + scope.Start(); + try + { + var response = _compoundAssessmentCompoundAssessmentOperationsRestClient.DownloadUrl(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new MigrateArmOperation(new DownloadUriOperationSource(), _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics, Pipeline, _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateDownloadUrlRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/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..40abf36fc2e0 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/MigrateExtensions.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.Migrate.Mocking; +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 MockableMigrateArmClient GetMockableMigrateArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableMigrateArmClient(client0)); + } + + private static MockableMigrateResourceGroupResource GetMockableMigrateResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableMigrateResourceGroupResource(client, resource.Id)); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static CompoundAssessmentResource GetCompoundAssessmentResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrateArmClient(client).GetCompoundAssessmentResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static WebAppCompoundAssessmentSummaryResource GetWebAppCompoundAssessmentSummaryResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrateArmClient(client).GetWebAppCompoundAssessmentSummaryResource(id); + } + + /// + /// Gets a collection of CompoundAssessmentResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Assessment Project Name. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// An object representing collection of CompoundAssessmentResources and their operations over a CompoundAssessmentResource. + public static CompoundAssessmentCollection GetCompoundAssessments(this ResourceGroupResource resourceGroupResource, string projectName) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableMigrateResourceGroupResource(resourceGroupResource).GetCompoundAssessments(projectName); + } + + /// + /// Get a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Assessment Project Name. + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetCompoundAssessmentAsync(this ResourceGroupResource resourceGroupResource, string projectName, string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableMigrateResourceGroupResource(resourceGroupResource).GetCompoundAssessmentAsync(projectName, compoundAssessmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Assessment Project Name. + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetCompoundAssessment(this ResourceGroupResource resourceGroupResource, string projectName, string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableMigrateResourceGroupResource(resourceGroupResource).GetCompoundAssessment(projectName, compoundAssessmentName, cancellationToken); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/MockableMigrateArmClient.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/MockableMigrateArmClient.cs new file mode 100644 index 000000000000..73a774a7c7bf --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/MockableMigrateArmClient.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableMigrateArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableMigrateArmClient() + { + } + + /// 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 MockableMigrateArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableMigrateArmClient(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual CompoundAssessmentResource GetCompoundAssessmentResource(ResourceIdentifier id) + { + CompoundAssessmentResource.ValidateResourceId(id); + return new CompoundAssessmentResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual WebAppCompoundAssessmentSummaryResource GetWebAppCompoundAssessmentSummaryResource(ResourceIdentifier id) + { + WebAppCompoundAssessmentSummaryResource.ValidateResourceId(id); + return new WebAppCompoundAssessmentSummaryResource(Client, id); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/MockableMigrateResourceGroupResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/MockableMigrateResourceGroupResource.cs new file mode 100644 index 000000000000..7ac4ba06ad60 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/MockableMigrateResourceGroupResource.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableMigrateResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableMigrateResourceGroupResource() + { + } + + /// 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 MockableMigrateResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of CompoundAssessmentResources in the ResourceGroupResource. + /// Assessment Project Name. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// An object representing collection of CompoundAssessmentResources and their operations over a CompoundAssessmentResource. + public virtual CompoundAssessmentCollection GetCompoundAssessments(string projectName) + { + return new CompoundAssessmentCollection(Client, Id, projectName); + } + + /// + /// Get a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Assessment Project Name. + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCompoundAssessmentAsync(string projectName, string compoundAssessmentName, CancellationToken cancellationToken = default) + { + return await GetCompoundAssessments(projectName).GetAsync(compoundAssessmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Assessment Project Name. + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCompoundAssessment(string projectName, string compoundAssessmentName, CancellationToken cancellationToken = default) + { + return GetCompoundAssessments(projectName).Get(compoundAssessmentName, cancellationToken); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/Argument.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..0182a5196211 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..a66f9d42e55e --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/ChangeTrackingList.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..47489526e8bf --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migrate +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..8f874b8eacb2 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,399 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate +{ + internal static class ModelSerializationExtensions + { + internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions { MaxDepth = 256 }; + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/Optional.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..e41b97ffe4ae --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.ResourceManager.Migrate +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..6922a99f93ea --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/CompoundAssessmentOperationSource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/CompoundAssessmentOperationSource.cs new file mode 100644 index 000000000000..0cd25d377f34 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/CompoundAssessmentOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate +{ + internal class CompoundAssessmentOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal CompoundAssessmentOperationSource(ArmClient client) + { + _client = client; + } + + CompoundAssessmentResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new CompoundAssessmentResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new CompoundAssessmentResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/DownloadUriOperationSource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/DownloadUriOperationSource.cs new file mode 100644 index 000000000000..0386533eec64 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/DownloadUriOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; + +namespace Azure.ResourceManager.Migrate +{ + internal class DownloadUriOperationSource : IOperationSource + { + DownloadUri IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + return DownloadUri.DeserializeDownloadUri(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + return DownloadUri.DeserializeDownloadUri(document.RootElement); + } + } +} 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..74c14408f3f1 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/MigrateArmOperation.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.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; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of MigrateArmOperation for mocking. + protected MigrateArmOperation() + { + } + + internal MigrateArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal MigrateArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "MigrateArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); + + /// + public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/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..c7dc7329573a --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/MigrateArmOperationOfT.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.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; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of MigrateArmOperation for mocking. + protected MigrateArmOperation() + { + } + + internal MigrateArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal MigrateArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "MigrateArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override T Value => _operation.Value; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); + + /// + public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentSource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentSource.cs new file mode 100644 index 000000000000..b43395708522 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentSource.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Assessment Source. + public readonly partial struct AssessmentSource : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AssessmentSource(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string MachineValue = "Machine"; + private const string IISValue = "IIS"; + private const string TomCatValue = "TomCat"; + private const string OracleServerValue = "OracleServer"; + private const string OracleDatabaseValue = "OracleDatabase"; + private const string SAPInstanceValue = "SAPInstance"; + private const string SpringbootApplicationValue = "SpringbootApplication"; + private const string MySQLServerValue = "MySQLServer"; + private const string SqlInstanceValue = "SqlInstance"; + private const string SqlDatabaseValue = "SqlDatabase"; + private const string WebAppsValue = "WebApps"; + + /// Unknown - Assessment Source. + public static AssessmentSource Unknown { get; } = new AssessmentSource(UnknownValue); + /// Machine - Assessment Source. + public static AssessmentSource Machine { get; } = new AssessmentSource(MachineValue); + /// IIS - Assessment Source. + public static AssessmentSource IIS { get; } = new AssessmentSource(IISValue); + /// TomCat - Assessment Source. + public static AssessmentSource TomCat { get; } = new AssessmentSource(TomCatValue); + /// OracleServer - Assessment Source. + public static AssessmentSource OracleServer { get; } = new AssessmentSource(OracleServerValue); + /// OracleDatabase - Assessment Source. + public static AssessmentSource OracleDatabase { get; } = new AssessmentSource(OracleDatabaseValue); + /// SAPInstance - Assessment Source. + public static AssessmentSource SAPInstance { get; } = new AssessmentSource(SAPInstanceValue); + /// SpringbootApplication - Assessment Source. + public static AssessmentSource SpringbootApplication { get; } = new AssessmentSource(SpringbootApplicationValue); + /// MySQLServer - Assessment Source. + public static AssessmentSource MySQLServer { get; } = new AssessmentSource(MySQLServerValue); + /// SqlInstance - Assessment Source. + public static AssessmentSource SqlInstance { get; } = new AssessmentSource(SqlInstanceValue); + /// SqlDatabase - Assessment Source. + public static AssessmentSource SqlDatabase { get; } = new AssessmentSource(SqlDatabaseValue); + /// WebApps - Assessment Source. + public static AssessmentSource WebApps { get; } = new AssessmentSource(WebAppsValue); + /// Determines if two values are the same. + public static bool operator ==(AssessmentSource left, AssessmentSource right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AssessmentSource left, AssessmentSource right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AssessmentSource(string value) => new AssessmentSource(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AssessmentSource other && Equals(other); + /// + public bool Equals(AssessmentSource other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/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..d9730d5c1d38 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentStatus.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 +{ + /// Assessment Status. + public readonly partial struct AssessmentStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AssessmentStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CreatedValue = "Created"; + private const string UpdatedValue = "Updated"; + private const string RunningValue = "Running"; + private const string CompletedValue = "Completed"; + private const string InvalidValue = "Invalid"; + private const string OutOfSyncValue = "OutOfSync"; + private const string OutDatedValue = "OutDated"; + private const string DeletedValue = "Deleted"; + private const string FailedValue = "Failed"; + + /// Assessment is Created. + public static AssessmentStatus Created { get; } = new AssessmentStatus(CreatedValue); + /// Assessment is Updated. + public static AssessmentStatus Updated { get; } = new AssessmentStatus(UpdatedValue); + /// Assessment is currently running. + public static AssessmentStatus Running { get; } = new AssessmentStatus(RunningValue); + /// Assessment is Completed or Ready. + public static AssessmentStatus Completed { get; } = new AssessmentStatus(CompletedValue); + /// Assessment is Failed i.e. it is now invalid. + public static AssessmentStatus Invalid { get; } = new AssessmentStatus(InvalidValue); + /// Assessment is Out of Sync. + public static AssessmentStatus OutOfSync { get; } = new AssessmentStatus(OutOfSyncValue); + /// Assessment is Out Dated. + public static AssessmentStatus OutDated { get; } = new AssessmentStatus(OutDatedValue); + /// Assessment is Deleted. + public static AssessmentStatus Deleted { get; } = new AssessmentStatus(DeletedValue); + /// Assessment has Failed. + public static AssessmentStatus Failed { get; } = new AssessmentStatus(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(AssessmentStatus left, AssessmentStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AssessmentStatus left, AssessmentStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AssessmentStatus(string value) => new AssessmentStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AssessmentStatus other && Equals(other); + /// + public bool Equals(AssessmentStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureManagementOfferingType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureManagementOfferingType.cs new file mode 100644 index 000000000000..9051809d1ebd --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureManagementOfferingType.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 +{ + /// Azure management Offering type. + public readonly partial struct AzureManagementOfferingType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureManagementOfferingType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoValue = "No"; + private const string SCOMMIValue = "SCOMMI"; + private const string AzMonValue = "AzMon"; + private const string AUMValue = "AUM"; + private const string AzureBackupValue = "AzureBackup"; + + /// No - Azure management Offering type. + public static AzureManagementOfferingType No { get; } = new AzureManagementOfferingType(NoValue); + /// SCOMMI - Azure management Offering type. + public static AzureManagementOfferingType SCOMMI { get; } = new AzureManagementOfferingType(SCOMMIValue); + /// AzMon - Azure management Offering type. + public static AzureManagementOfferingType AzMon { get; } = new AzureManagementOfferingType(AzMonValue); + /// AUM - Azure management Offering type. + public static AzureManagementOfferingType AUM { get; } = new AzureManagementOfferingType(AUMValue); + /// AzureBackup - Azure management Offering type. + public static AzureManagementOfferingType AzureBackup { get; } = new AzureManagementOfferingType(AzureBackupValue); + /// Determines if two values are the same. + public static bool operator ==(AzureManagementOfferingType left, AzureManagementOfferingType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureManagementOfferingType left, AzureManagementOfferingType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureManagementOfferingType(string value) => new AzureManagementOfferingType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureManagementOfferingType other && Equals(other); + /// + public bool Equals(AzureManagementOfferingType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureTarget.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureTarget.cs new file mode 100644 index 000000000000..88dd6282ff39 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureTarget.cs @@ -0,0 +1,87 @@ +// 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 Target. + public readonly partial struct AzureTarget : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureTarget(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string SqlDatabaseValue = "SqlDatabase"; + private const string SqlMIValue = "SqlMI"; + private const string FlexServerPGValue = "FlexServerPG"; + private const string OracleIaasVmValue = "OracleIaasVM"; + private const string AzureSpringAppsValue = "AzureSpringApps"; + private const string SAPAzureInstanceValue = "SAPAzureInstance"; + private const string AKSValue = "AKS"; + private const string MySQLAzureFlexServerValue = "MySQLAzureFlexServer"; + private const string AzureSQLVMValue = "AzureSQLVM"; + private const string AzureVmValue = "AzureVM"; + private const string AzureAppServiceValue = "AzureAppService"; + private const string AzureAppServiceContainerValue = "AzureAppServiceContainer"; + private const string AvsValue = "Avs"; + + /// Unknown - Azure Target. + public static AzureTarget Unknown { get; } = new AzureTarget(UnknownValue); + /// SqlDatabase - Azure Target. + public static AzureTarget SqlDatabase { get; } = new AzureTarget(SqlDatabaseValue); + /// SqlMI - Azure Target. + public static AzureTarget SqlMI { get; } = new AzureTarget(SqlMIValue); + /// FlexServerPG - Azure Target. + public static AzureTarget FlexServerPG { get; } = new AzureTarget(FlexServerPGValue); + /// OracleIaasVM - Azure Target. + public static AzureTarget OracleIaasVm { get; } = new AzureTarget(OracleIaasVmValue); + /// AzureSpringApps - Azure Target. + public static AzureTarget AzureSpringApps { get; } = new AzureTarget(AzureSpringAppsValue); + /// SAPAzureInstance - Azure Target. + public static AzureTarget SAPAzureInstance { get; } = new AzureTarget(SAPAzureInstanceValue); + /// AKS - Azure Target. + public static AzureTarget AKS { get; } = new AzureTarget(AKSValue); + /// MySQLAzureFlexServer - Azure Target. + public static AzureTarget MySQLAzureFlexServer { get; } = new AzureTarget(MySQLAzureFlexServerValue); + /// AzureSQLVM - Azure Target. + public static AzureTarget AzureSQLVM { get; } = new AzureTarget(AzureSQLVMValue); + /// AzureVM - Azure Target. + public static AzureTarget AzureVm { get; } = new AzureTarget(AzureVmValue); + /// AzureAppService - Azure Target. + public static AzureTarget AzureAppService { get; } = new AzureTarget(AzureAppServiceValue); + /// AzureAppServiceContainer - Azure Target. + public static AzureTarget AzureAppServiceContainer { get; } = new AzureTarget(AzureAppServiceContainerValue); + /// Avs - Azure Target. + public static AzureTarget Avs { get; } = new AzureTarget(AvsValue); + /// Determines if two values are the same. + public static bool operator ==(AzureTarget left, AzureTarget right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureTarget left, AzureTarget right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureTarget(string value) => new AzureTarget(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureTarget other && Equals(other); + /// + public bool Equals(AzureTarget other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CloudSuitabilityCommon.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CloudSuitabilityCommon.cs new file mode 100644 index 000000000000..f5e2e8468e2d --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CloudSuitabilityCommon.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 +{ + /// Cloud Suitability Common. + public readonly partial struct CloudSuitabilityCommon : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CloudSuitabilityCommon(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"; + private const string SuitableWithWarningsValue = "SuitableWithWarnings"; + + /// Unknown - Cloud Suitability Common. + public static CloudSuitabilityCommon Unknown { get; } = new CloudSuitabilityCommon(UnknownValue); + /// NotSuitable - Cloud Suitability Common. + public static CloudSuitabilityCommon NotSuitable { get; } = new CloudSuitabilityCommon(NotSuitableValue); + /// Suitable - Cloud Suitability Common. + public static CloudSuitabilityCommon Suitable { get; } = new CloudSuitabilityCommon(SuitableValue); + /// ConditionallySuitable - Cloud Suitability Common. + public static CloudSuitabilityCommon ConditionallySuitable { get; } = new CloudSuitabilityCommon(ConditionallySuitableValue); + /// ReadinessUnknown - Cloud Suitability Common. + public static CloudSuitabilityCommon ReadinessUnknown { get; } = new CloudSuitabilityCommon(ReadinessUnknownValue); + /// SuitableWithWarnings - Cloud Suitability Common. + public static CloudSuitabilityCommon SuitableWithWarnings { get; } = new CloudSuitabilityCommon(SuitableWithWarningsValue); + /// Determines if two values are the same. + public static bool operator ==(CloudSuitabilityCommon left, CloudSuitabilityCommon right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CloudSuitabilityCommon left, CloudSuitabilityCommon right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CloudSuitabilityCommon(string value) => new CloudSuitabilityCommon(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CloudSuitabilityCommon other && Equals(other); + /// + public bool Equals(CloudSuitabilityCommon other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentDetails.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentDetails.Serialization.cs new file mode 100644 index 000000000000..d48ce192085a --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentDetails.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class CompoundAssessmentDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CompoundAssessmentDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(CreatedTimestamp)) + { + writer.WritePropertyName("createdTimestamp"u8); + writer.WriteStringValue(CreatedTimestamp.Value, "O"); + } + if (Optional.IsDefined(UpdatedTimestamp)) + { + writer.WritePropertyName("updatedTimestamp"u8); + writer.WriteStringValue(UpdatedTimestamp.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CompoundAssessmentDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CompoundAssessmentDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCompoundAssessmentDetails(document.RootElement, options); + } + + internal static CompoundAssessmentDetails DeserializeCompoundAssessmentDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset? createdTimestamp = default; + DateTimeOffset? updatedTimestamp = default; + AssessmentStatus status = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdTimestamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdTimestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("updatedTimestamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedTimestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new AssessmentStatus(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CompoundAssessmentDetails(createdTimestamp, updatedTimestamp, status, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CompoundAssessmentDetails)} does not support writing '{options.Format}' format."); + } + } + + CompoundAssessmentDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCompoundAssessmentDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CompoundAssessmentDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentDetails.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentDetails.cs new file mode 100644 index 000000000000..e6208bffb04a --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentDetails.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Details of the compound assessment. + public partial class CompoundAssessmentDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Status of the assessment. + internal CompoundAssessmentDetails(AssessmentStatus status) + { + Status = status; + } + + /// Initializes a new instance of . + /// Timestamp when the assessment was created. + /// Timestamp when the assessment was last updated. + /// Status of the assessment. + /// Keeps track of any properties unknown to the library. + internal CompoundAssessmentDetails(DateTimeOffset? createdTimestamp, DateTimeOffset? updatedTimestamp, AssessmentStatus status, IDictionary serializedAdditionalRawData) + { + CreatedTimestamp = createdTimestamp; + UpdatedTimestamp = updatedTimestamp; + Status = status; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CompoundAssessmentDetails() + { + } + + /// Timestamp when the assessment was created. + public DateTimeOffset? CreatedTimestamp { get; } + /// Timestamp when the assessment was last updated. + public DateTimeOffset? UpdatedTimestamp { get; } + /// Status of the assessment. + public AssessmentStatus Status { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentListResult.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentListResult.Serialization.cs new file mode 100644 index 000000000000..bc739e98c801 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + internal partial class CompoundAssessmentListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CompoundAssessmentListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CompoundAssessmentListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CompoundAssessmentListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCompoundAssessmentListResult(document.RootElement, options); + } + + internal static CompoundAssessmentListResult DeserializeCompoundAssessmentListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CompoundAssessmentData.DeserializeCompoundAssessmentData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CompoundAssessmentListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CompoundAssessmentListResult)} does not support writing '{options.Format}' format."); + } + } + + CompoundAssessmentListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCompoundAssessmentListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CompoundAssessmentListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentListResult.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentListResult.cs new file mode 100644 index 000000000000..10b06ede3a6b --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// The response of a CompoundAssessment list operation. + internal partial class CompoundAssessmentListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The CompoundAssessment items on this page. + /// is null. + internal CompoundAssessmentListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The CompoundAssessment items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal CompoundAssessmentListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CompoundAssessmentListResult() + { + } + + /// The CompoundAssessment items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentProperties.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentProperties.Serialization.cs new file mode 100644 index 000000000000..1dcee4848fb7 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentProperties.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class CompoundAssessmentProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CompoundAssessmentProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("targetAssessmentArmIds"u8); + writer.WriteObjectValue(TargetAssessmentArmIds, options); + if (Optional.IsDefined(FallbackMachineAssessmentArmId)) + { + writer.WritePropertyName("fallbackMachineAssessmentArmId"u8); + writer.WriteStringValue(FallbackMachineAssessmentArmId); + } + if (options.Format != "W" && Optional.IsDefined(Details)) + { + writer.WritePropertyName("details"u8); + writer.WriteObjectValue(Details, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CompoundAssessmentProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CompoundAssessmentProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCompoundAssessmentProperties(document.RootElement, options); + } + + internal static CompoundAssessmentProperties DeserializeCompoundAssessmentProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProvisioningState? provisioningState = default; + TargetAssessmentArmIds targetAssessmentArmIds = default; + string fallbackMachineAssessmentArmId = default; + CompoundAssessmentDetails details = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetAssessmentArmIds"u8)) + { + targetAssessmentArmIds = TargetAssessmentArmIds.DeserializeTargetAssessmentArmIds(property.Value, options); + continue; + } + if (property.NameEquals("fallbackMachineAssessmentArmId"u8)) + { + fallbackMachineAssessmentArmId = property.Value.GetString(); + continue; + } + if (property.NameEquals("details"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + details = CompoundAssessmentDetails.DeserializeCompoundAssessmentDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CompoundAssessmentProperties(provisioningState, targetAssessmentArmIds, fallbackMachineAssessmentArmId, details, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CompoundAssessmentProperties)} does not support writing '{options.Format}' format."); + } + } + + CompoundAssessmentProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCompoundAssessmentProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CompoundAssessmentProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentProperties.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentProperties.cs new file mode 100644 index 000000000000..303861f005f6 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentProperties.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Properties of a compound assessment. + public partial class CompoundAssessmentProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// ARM IDs of the target assessments. + /// is null. + public CompoundAssessmentProperties(TargetAssessmentArmIds targetAssessmentArmIds) + { + Argument.AssertNotNull(targetAssessmentArmIds, nameof(targetAssessmentArmIds)); + + TargetAssessmentArmIds = targetAssessmentArmIds; + } + + /// Initializes a new instance of . + /// The status of the last operation. + /// ARM IDs of the target assessments. + /// Fallback machine assessment ARM ID. + /// Details of the compound assessment. + /// Keeps track of any properties unknown to the library. + internal CompoundAssessmentProperties(ProvisioningState? provisioningState, TargetAssessmentArmIds targetAssessmentArmIds, string fallbackMachineAssessmentArmId, CompoundAssessmentDetails details, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + TargetAssessmentArmIds = targetAssessmentArmIds; + FallbackMachineAssessmentArmId = fallbackMachineAssessmentArmId; + Details = details; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CompoundAssessmentProperties() + { + } + + /// The status of the last operation. + public ProvisioningState? ProvisioningState { get; } + /// ARM IDs of the target assessments. + public TargetAssessmentArmIds TargetAssessmentArmIds { get; set; } + /// Fallback machine assessment ARM ID. + public string FallbackMachineAssessmentArmId { get; set; } + /// Details of the compound assessment. + public CompoundAssessmentDetails Details { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CostDetailsCommon.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CostDetailsCommon.Serialization.cs new file mode 100644 index 000000000000..a7b6e54aeecb --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CostDetailsCommon.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class CostDetailsCommon : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CostDetailsCommon)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(SavingOptions)) + { + writer.WritePropertyName("savingOptions"u8); + writer.WriteStringValue(SavingOptions.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(CostDetail)) + { + writer.WritePropertyName("costDetail"u8); + writer.WriteStartArray(); + foreach (var item in CostDetail) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CostDetailsCommon IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CostDetailsCommon)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCostDetailsCommon(document.RootElement, options); + } + + internal static CostDetailsCommon DeserializeCostDetailsCommon(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SavingsOption? savingOptions = default; + IReadOnlyList costDetail = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("savingOptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + savingOptions = new SavingsOption(property.Value.GetString()); + continue; + } + if (property.NameEquals("costDetail"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NameValuePairCostType.DeserializeNameValuePairCostType(item, options)); + } + costDetail = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CostDetailsCommon(savingOptions, costDetail ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CostDetailsCommon)} does not support writing '{options.Format}' format."); + } + } + + CostDetailsCommon IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCostDetailsCommon(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CostDetailsCommon)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CostDetailsCommon.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CostDetailsCommon.cs new file mode 100644 index 000000000000..d3622f49c7b9 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CostDetailsCommon.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// The cost details. + public partial class CostDetailsCommon + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal CostDetailsCommon() + { + CostDetail = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The savings options. + /// The sku cost details per azure offer type. + /// Keeps track of any properties unknown to the library. + internal CostDetailsCommon(SavingsOption? savingOptions, IReadOnlyList costDetail, IDictionary serializedAdditionalRawData) + { + SavingOptions = savingOptions; + CostDetail = costDetail; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The savings options. + public SavingsOption? SavingOptions { get; } + /// The sku cost details per azure offer type. + public IReadOnlyList CostDetail { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CostType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CostType.cs new file mode 100644 index 000000000000..5dd1094db057 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CostType.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Cost type. + public readonly partial struct CostType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CostType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MonthlyStorageCostValue = "MonthlyStorageCost"; + private const string MonthlyComputeCostValue = "MonthlyComputeCost"; + private const string MonthlyLicensingCostValue = "MonthlyLicensingCost"; + private const string MonthlySecurityCostValue = "MonthlySecurityCost"; + private const string MonthlyManagementCostValue = "MonthlyManagementCost"; + private const string MonitoringServiceValue = "MonitoringService"; + private const string DataProtectionServiceValue = "DataProtectionService"; + private const string PatchingServiceValue = "PatchingService"; + private const string MonthlyAzureHybridCostValue = "MonthlyAzureHybridCost"; + private const string MonthlyPremiumV2StorageCostValue = "MonthlyPremiumV2StorageCost"; + private const string MonthlyLinuxAzureHybridCostValue = "MonthlyLinuxAzureHybridCost"; + private const string MonthlyUltraStorageCostValue = "MonthlyUltraStorageCost"; + private const string MonthlyStandardSsdStorageCostValue = "MonthlyStandardSsdStorageCost"; + private const string MonthlyBandwidthCostValue = "MonthlyBandwidthCost"; + private const string MonthlyPremiumStorageCostValue = "MonthlyPremiumStorageCost"; + private const string MonthlyUltraDiskCostValue = "MonthlyUltraDiskCost"; + private const string MonthlyStandardHddStorageCostValue = "MonthlyStandardHddStorageCost"; + private const string MonthlyAvsExternalStorageCostValue = "MonthlyAvsExternalStorageCost"; + private const string MonthlyAvsNetworkCostValue = "MonthlyAvsNetworkCost"; + private const string MonthlyAvsNodeCostValue = "MonthlyAvsNodeCost"; + private const string TotalMonthlyCostValue = "TotalMonthlyCost"; + + /// MonthlyStorageCost - Cost type. + public static CostType MonthlyStorageCost { get; } = new CostType(MonthlyStorageCostValue); + /// MonthlyComputeCost - Cost type. + public static CostType MonthlyComputeCost { get; } = new CostType(MonthlyComputeCostValue); + /// MonthlyLicensingCost - Cost type. + public static CostType MonthlyLicensingCost { get; } = new CostType(MonthlyLicensingCostValue); + /// MonthlySecurityCost - Cost type. + public static CostType MonthlySecurityCost { get; } = new CostType(MonthlySecurityCostValue); + /// MonthlyManagementCost - Cost type. + public static CostType MonthlyManagementCost { get; } = new CostType(MonthlyManagementCostValue); + /// MonitoringService - Cost type. + public static CostType MonitoringService { get; } = new CostType(MonitoringServiceValue); + /// DataProtectionService - Cost type. + public static CostType DataProtectionService { get; } = new CostType(DataProtectionServiceValue); + /// PatchingService - Cost type. + public static CostType PatchingService { get; } = new CostType(PatchingServiceValue); + /// MonthlyAzureHybridCost - Cost type. + public static CostType MonthlyAzureHybridCost { get; } = new CostType(MonthlyAzureHybridCostValue); + /// MonthlyPremiumV2StorageCost - Cost type. + public static CostType MonthlyPremiumV2StorageCost { get; } = new CostType(MonthlyPremiumV2StorageCostValue); + /// MonthlyLinuxAzureHybridCost - Cost type. + public static CostType MonthlyLinuxAzureHybridCost { get; } = new CostType(MonthlyLinuxAzureHybridCostValue); + /// MonthlyUltraStorageCost - Cost type. + public static CostType MonthlyUltraStorageCost { get; } = new CostType(MonthlyUltraStorageCostValue); + /// MonthlyStandardSsdStorageCost - Cost type. + public static CostType MonthlyStandardSsdStorageCost { get; } = new CostType(MonthlyStandardSsdStorageCostValue); + /// MonthlyBandwidthCost - Cost type. + public static CostType MonthlyBandwidthCost { get; } = new CostType(MonthlyBandwidthCostValue); + /// MonthlyPremiumStorageCost - Cost type. + public static CostType MonthlyPremiumStorageCost { get; } = new CostType(MonthlyPremiumStorageCostValue); + /// MonthlyUltraDiskCost - Cost type. + public static CostType MonthlyUltraDiskCost { get; } = new CostType(MonthlyUltraDiskCostValue); + /// MonthlyStandardHddStorageCost - Cost type. + public static CostType MonthlyStandardHddStorageCost { get; } = new CostType(MonthlyStandardHddStorageCostValue); + /// MonthlyAvsExternalStorageCost - Cost type. + public static CostType MonthlyAvsExternalStorageCost { get; } = new CostType(MonthlyAvsExternalStorageCostValue); + /// MonthlyAvsNetworkCost - Cost type. + public static CostType MonthlyAvsNetworkCost { get; } = new CostType(MonthlyAvsNetworkCostValue); + /// MonthlyAvsNodeCost - Cost type. + public static CostType MonthlyAvsNodeCost { get; } = new CostType(MonthlyAvsNodeCostValue); + /// TotalMonthlyCost - Cost type. + public static CostType TotalMonthlyCost { get; } = new CostType(TotalMonthlyCostValue); + /// Determines if two values are the same. + public static bool operator ==(CostType left, CostType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CostType left, CostType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CostType(string value) => new CostType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CostType other && Equals(other); + /// + public bool Equals(CostType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DiscoveredLightSummary.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DiscoveredLightSummary.Serialization.cs new file mode 100644 index 000000000000..3fcd9c3cebfc --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DiscoveredLightSummary.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class DiscoveredLightSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoveredLightSummary)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("numberOfWebApps"u8); + writer.WriteNumberValue(NumberOfWebApps); + if (Optional.IsCollectionDefined(NumberOfWebAppsPerType)) + { + writer.WritePropertyName("numberOfWebAppsPerType"u8); + writer.WriteStartArray(); + foreach (var item in NumberOfWebAppsPerType) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(NumberOfWebServersPerType)) + { + writer.WritePropertyName("numberOfWebServersPerType"u8); + writer.WriteStartArray(); + foreach (var item in NumberOfWebServersPerType) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("numberOfWebServers"u8); + writer.WriteNumberValue(NumberOfWebServers); + writer.WritePropertyName("numberOfServers"u8); + writer.WriteNumberValue(NumberOfServers); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiscoveredLightSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoveredLightSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiscoveredLightSummary(document.RootElement, options); + } + + internal static DiscoveredLightSummary DeserializeDiscoveredLightSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int numberOfWebApps = default; + IReadOnlyList numberOfWebAppsPerType = default; + IReadOnlyList numberOfWebServersPerType = default; + int numberOfWebServers = default; + int numberOfServers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("numberOfWebApps"u8)) + { + numberOfWebApps = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("numberOfWebAppsPerType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(WebAppsPerType.DeserializeWebAppsPerType(item, options)); + } + numberOfWebAppsPerType = array; + continue; + } + if (property.NameEquals("numberOfWebServersPerType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(WebServersPerType.DeserializeWebServersPerType(item, options)); + } + numberOfWebServersPerType = array; + continue; + } + if (property.NameEquals("numberOfWebServers"u8)) + { + numberOfWebServers = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("numberOfServers"u8)) + { + numberOfServers = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiscoveredLightSummary( + numberOfWebApps, + numberOfWebAppsPerType ?? new ChangeTrackingList(), + numberOfWebServersPerType ?? new ChangeTrackingList(), + numberOfWebServers, + numberOfServers, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DiscoveredLightSummary)} does not support writing '{options.Format}' format."); + } + } + + DiscoveredLightSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDiscoveredLightSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiscoveredLightSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DiscoveredLightSummary.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DiscoveredLightSummary.cs new file mode 100644 index 000000000000..3580e422fec8 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DiscoveredLightSummary.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Summary of the compound assessment. + public partial class DiscoveredLightSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Number of web apps. + /// Number of web servers. + /// Number of servers. + internal DiscoveredLightSummary(int numberOfWebApps, int numberOfWebServers, int numberOfServers) + { + NumberOfWebApps = numberOfWebApps; + NumberOfWebAppsPerType = new ChangeTrackingList(); + NumberOfWebServersPerType = new ChangeTrackingList(); + NumberOfWebServers = numberOfWebServers; + NumberOfServers = numberOfServers; + } + + /// Initializes a new instance of . + /// Number of web apps. + /// Number of web apps per type. + /// Number of web servers per type. + /// Number of web servers. + /// Number of servers. + /// Keeps track of any properties unknown to the library. + internal DiscoveredLightSummary(int numberOfWebApps, IReadOnlyList numberOfWebAppsPerType, IReadOnlyList numberOfWebServersPerType, int numberOfWebServers, int numberOfServers, IDictionary serializedAdditionalRawData) + { + NumberOfWebApps = numberOfWebApps; + NumberOfWebAppsPerType = numberOfWebAppsPerType; + NumberOfWebServersPerType = numberOfWebServersPerType; + NumberOfWebServers = numberOfWebServers; + NumberOfServers = numberOfServers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DiscoveredLightSummary() + { + } + + /// Number of web apps. + public int NumberOfWebApps { get; } + /// Number of web apps per type. + public IReadOnlyList NumberOfWebAppsPerType { get; } + /// Number of web servers per type. + public IReadOnlyList NumberOfWebServersPerType { get; } + /// Number of web servers. + public int NumberOfWebServers { get; } + /// Number of servers. + public int NumberOfServers { 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..03ba25513355 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUri.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class DownloadUri : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DownloadUri)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("assessmentReportUrl"u8); + writer.WriteStringValue(AssessmentReportUri); + } + if (options.Format != "W") + { + writer.WritePropertyName("expirationTime"u8); + writer.WriteStringValue(ExpireOn, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DownloadUri IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DownloadUri)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDownloadUri(document.RootElement, options); + } + + internal static DownloadUri DeserializeDownloadUri(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string assessmentReportUrl = default; + DateTimeOffset expirationTime = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("assessmentReportUrl"u8)) + { + assessmentReportUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("expirationTime"u8)) + { + expirationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DownloadUri(assessmentReportUrl, expirationTime, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DownloadUri)} does not support writing '{options.Format}' format."); + } + } + + DownloadUri IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDownloadUri(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DownloadUri)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} 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..0c9097700df3 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUri.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Data model of Download URL for assessment report. + public partial class DownloadUri + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Hyperlink to download report. + /// Expiry date of download url. + internal DownloadUri(string assessmentReportUri, DateTimeOffset expireOn) + { + AssessmentReportUri = assessmentReportUri; + ExpireOn = expireOn; + } + + /// Initializes a new instance of . + /// Hyperlink to download report. + /// Expiry date of download url. + /// Keeps track of any properties unknown to the library. + internal DownloadUri(string assessmentReportUri, DateTimeOffset expireOn, IDictionary serializedAdditionalRawData) + { + AssessmentReportUri = assessmentReportUri; + ExpireOn = expireOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DownloadUri() + { + } + + /// Hyperlink to download report. + public string AssessmentReportUri { get; } + /// Expiry date of download url. + public DateTimeOffset ExpireOn { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUrlContent.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUrlContent.Serialization.cs new file mode 100644 index 000000000000..566a552c5f00 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUrlContent.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class DownloadUrlContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DownloadUrlContent)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DownloadUrlContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DownloadUrlContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDownloadUrlContent(document.RootElement, options); + } + + internal static DownloadUrlContent DeserializeDownloadUrlContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DownloadUrlContent(serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DownloadUrlContent)} does not support writing '{options.Format}' format."); + } + } + + DownloadUrlContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDownloadUrlContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DownloadUrlContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUrlContent.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUrlContent.cs new file mode 100644 index 000000000000..3462a4b54d91 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUrlContent.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// The DownloadUrlContent. + public partial class DownloadUrlContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DownloadUrlContent() + { + } + + /// Initializes a new instance of . + /// Keeps track of any properties unknown to the library. + internal DownloadUrlContent(IDictionary serializedAdditionalRawData) + { + _serializedAdditionalRawData = serializedAdditionalRawData; + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ManagementDetails.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ManagementDetails.Serialization.cs new file mode 100644 index 000000000000..64bcfe75e83e --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ManagementDetails.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class ManagementDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagementDetails)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ReadinessSummary)) + { + writer.WritePropertyName("readinessSummary"u8); + writer.WriteStartArray(); + foreach (var item in ReadinessSummary) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagementDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagementDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagementDetails(document.RootElement, options); + } + + internal static ManagementDetails DeserializeManagementDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureManagementOfferingType? name = default; + IReadOnlyList readinessSummary = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + name = new AzureManagementOfferingType(property.Value.GetString()); + continue; + } + if (property.NameEquals("readinessSummary"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NameValuePairCloudSuitabilityCommon.DeserializeNameValuePairCloudSuitabilityCommon(item, options)); + } + readinessSummary = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagementDetails(name, readinessSummary ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ManagementDetails)} does not support writing '{options.Format}' format."); + } + } + + ManagementDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeManagementDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagementDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ManagementDetails.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ManagementDetails.cs new file mode 100644 index 000000000000..9bc65418c800 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ManagementDetails.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Management details. + public partial class ManagementDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ManagementDetails() + { + ReadinessSummary = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The management summary name. + /// The management suitability summary. + /// Keeps track of any properties unknown to the library. + internal ManagementDetails(AzureManagementOfferingType? name, IReadOnlyList readinessSummary, IDictionary serializedAdditionalRawData) + { + Name = name; + ReadinessSummary = readinessSummary; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The management summary name. + public AzureManagementOfferingType? Name { get; } + /// The management suitability summary. + public IReadOnlyList ReadinessSummary { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrateWorkloadType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrateWorkloadType.cs new file mode 100644 index 000000000000..641ca43c6a0f --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrateWorkloadType.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 +{ + /// Migration Workload type. + public readonly partial struct MigrateWorkloadType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MigrateWorkloadType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string MachineValue = "Machine"; + private const string ServerValue = "Server"; + private const string InstanceValue = "Instance"; + private const string WebServerValue = "WebServer"; + private const string WebApplicationValue = "WebApplication"; + private const string DatabaseValue = "Database"; + private const string HostValue = "Host"; + private const string ManagementServerValue = "ManagementServer"; + + /// Unknown - Migration Workload type. + public static MigrateWorkloadType Unknown { get; } = new MigrateWorkloadType(UnknownValue); + /// Machine - Migration Workload type. + public static MigrateWorkloadType Machine { get; } = new MigrateWorkloadType(MachineValue); + /// Server - Migration Workload type. + public static MigrateWorkloadType Server { get; } = new MigrateWorkloadType(ServerValue); + /// Instance - Migration Workload type. + public static MigrateWorkloadType Instance { get; } = new MigrateWorkloadType(InstanceValue); + /// WebServer - Migration Workload type. + public static MigrateWorkloadType WebServer { get; } = new MigrateWorkloadType(WebServerValue); + /// WebApplication - Migration Workload type. + public static MigrateWorkloadType WebApplication { get; } = new MigrateWorkloadType(WebApplicationValue); + /// Database - Migration Workload type. + public static MigrateWorkloadType Database { get; } = new MigrateWorkloadType(DatabaseValue); + /// Host - Migration Workload type. + public static MigrateWorkloadType Host { get; } = new MigrateWorkloadType(HostValue); + /// ManagementServer - Migration Workload type. + public static MigrateWorkloadType ManagementServer { get; } = new MigrateWorkloadType(ManagementServerValue); + /// Determines if two values are the same. + public static bool operator ==(MigrateWorkloadType left, MigrateWorkloadType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MigrateWorkloadType left, MigrateWorkloadType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MigrateWorkloadType(string value) => new MigrateWorkloadType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MigrateWorkloadType other && Equals(other); + /// + public bool Equals(MigrateWorkloadType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationDetails.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationDetails.Serialization.cs new file mode 100644 index 000000000000..3833a2532a1b --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationDetails.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class MigrationDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationDetails)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsCollectionDefined(ReadinessSummary)) + { + writer.WritePropertyName("readinessSummary"u8); + writer.WriteStartArray(); + foreach (var item in ReadinessSummary) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(MigrationType)) + { + writer.WritePropertyName("migrationType"u8); + writer.WriteStringValue(MigrationType.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MigrationDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationDetails(document.RootElement, options); + } + + internal static MigrationDetails DeserializeMigrationDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList readinessSummary = default; + MigrationType? migrationType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("readinessSummary"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NameValuePairCloudSuitabilityCommon.DeserializeNameValuePairCloudSuitabilityCommon(item, options)); + } + readinessSummary = array; + continue; + } + if (property.NameEquals("migrationType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + migrationType = new MigrationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationDetails(readinessSummary ?? new ChangeTrackingList(), migrationType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MigrationDetails)} does not support writing '{options.Format}' format."); + } + } + + MigrationDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMigrationDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationDetails.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationDetails.cs new file mode 100644 index 000000000000..e7d8527d8404 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationDetails.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Migration details. + public partial class MigrationDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal MigrationDetails() + { + ReadinessSummary = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The readiness summary. + /// The migration type. + /// Keeps track of any properties unknown to the library. + internal MigrationDetails(IReadOnlyList readinessSummary, MigrationType? migrationType, IDictionary serializedAdditionalRawData) + { + ReadinessSummary = readinessSummary; + MigrationType = migrationType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The readiness summary. + public IReadOnlyList ReadinessSummary { get; } + /// The migration type. + public MigrationType? MigrationType { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationPlatform.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationPlatform.cs new file mode 100644 index 000000000000..23c1c59296d0 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationPlatform.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 +{ + /// Migration Platform. + public readonly partial struct MigrationPlatform : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MigrationPlatform(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string PaaSValue = "PaaS"; + private const string IaaSValue = "IaaS"; + private const string SaaSValue = "SaaS"; + + /// Unknown - Migration Platform. + public static MigrationPlatform Unknown { get; } = new MigrationPlatform(UnknownValue); + /// PaaS - Migration Platform. + public static MigrationPlatform PaaS { get; } = new MigrationPlatform(PaaSValue); + /// IaaS - Migration Platform. + public static MigrationPlatform IaaS { get; } = new MigrationPlatform(IaaSValue); + /// SaaS - Migration Platform. + public static MigrationPlatform SaaS { get; } = new MigrationPlatform(SaaSValue); + /// Determines if two values are the same. + public static bool operator ==(MigrationPlatform left, MigrationPlatform right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MigrationPlatform left, MigrationPlatform right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MigrationPlatform(string value) => new MigrationPlatform(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MigrationPlatform other && Equals(other); + /// + public bool Equals(MigrationPlatform other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationType.cs new file mode 100644 index 000000000000..29cc281ea563 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationType.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 +{ + /// Migration Type. + public readonly partial struct MigrationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MigrationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string ReplatformValue = "Replatform"; + private const string RehostValue = "Rehost"; + private const string RetainValue = "Retain"; + private const string RearchitectValue = "Rearchitect"; + + /// Unknown - Migration Type. + public static MigrationType Unknown { get; } = new MigrationType(UnknownValue); + /// Replatform - Migration Type. + public static MigrationType Replatform { get; } = new MigrationType(ReplatformValue); + /// Rehost - Migration Type. + public static MigrationType Rehost { get; } = new MigrationType(RehostValue); + /// Retain - Migration Type. + public static MigrationType Retain { get; } = new MigrationType(RetainValue); + /// Rearchitect - Migration Type. + public static MigrationType Rearchitect { get; } = new MigrationType(RearchitectValue); + /// Determines if two values are the same. + public static bool operator ==(MigrationType left, MigrationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MigrationType left, MigrationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MigrationType(string value) => new MigrationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MigrationType other && Equals(other); + /// + public bool Equals(MigrationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCloudSuitabilityCommon.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCloudSuitabilityCommon.Serialization.cs new file mode 100644 index 000000000000..be6ac047c213 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCloudSuitabilityCommon.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class NameValuePairCloudSuitabilityCommon : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NameValuePairCloudSuitabilityCommon)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteNumberValue(Value.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NameValuePairCloudSuitabilityCommon IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NameValuePairCloudSuitabilityCommon)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNameValuePairCloudSuitabilityCommon(document.RootElement, options); + } + + internal static NameValuePairCloudSuitabilityCommon DeserializeNameValuePairCloudSuitabilityCommon(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CloudSuitabilityCommon? name = default; + int? value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + name = new CloudSuitabilityCommon(property.Value.GetString()); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + value = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NameValuePairCloudSuitabilityCommon(name, value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NameValuePairCloudSuitabilityCommon)} does not support writing '{options.Format}' format."); + } + } + + NameValuePairCloudSuitabilityCommon IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNameValuePairCloudSuitabilityCommon(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NameValuePairCloudSuitabilityCommon)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCloudSuitabilityCommon.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCloudSuitabilityCommon.cs new file mode 100644 index 000000000000..f784ba115d0c --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCloudSuitabilityCommon.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// The generic name value pair. + public partial class NameValuePairCloudSuitabilityCommon + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal NameValuePairCloudSuitabilityCommon() + { + } + + /// Initializes a new instance of . + /// The name. + /// The value. + /// Keeps track of any properties unknown to the library. + internal NameValuePairCloudSuitabilityCommon(CloudSuitabilityCommon? name, int? value, IDictionary serializedAdditionalRawData) + { + Name = name; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name. + public CloudSuitabilityCommon? Name { get; } + /// The value. + public int? Value { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCostType.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCostType.Serialization.cs new file mode 100644 index 000000000000..52cb3d12a2a4 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCostType.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class NameValuePairCostType : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NameValuePairCostType)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteNumberValue(Value.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NameValuePairCostType IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NameValuePairCostType)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNameValuePairCostType(document.RootElement, options); + } + + internal static NameValuePairCostType DeserializeNameValuePairCostType(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CostType? name = default; + float? value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + name = new CostType(property.Value.GetString()); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + value = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NameValuePairCostType(name, value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NameValuePairCostType)} does not support writing '{options.Format}' format."); + } + } + + NameValuePairCostType IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNameValuePairCostType(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NameValuePairCostType)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCostType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCostType.cs new file mode 100644 index 000000000000..7bd605067c22 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCostType.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// The generic name value pair. + public partial class NameValuePairCostType + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal NameValuePairCostType() + { + } + + /// Initializes a new instance of . + /// The name. + /// The value. + /// Keeps track of any properties unknown to the library. + internal NameValuePairCostType(CostType? name, float? value, IDictionary serializedAdditionalRawData) + { + Name = name; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name. + public CostType? Name { get; } + /// The value. + public float? Value { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairSavingsType.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairSavingsType.Serialization.cs new file mode 100644 index 000000000000..bdc3cab36011 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairSavingsType.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class NameValuePairSavingsType : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NameValuePairSavingsType)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteNumberValue(Value.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NameValuePairSavingsType IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NameValuePairSavingsType)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNameValuePairSavingsType(document.RootElement, options); + } + + internal static NameValuePairSavingsType DeserializeNameValuePairSavingsType(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SavingsType? name = default; + float? value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + name = new SavingsType(property.Value.GetString()); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + value = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NameValuePairSavingsType(name, value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NameValuePairSavingsType)} does not support writing '{options.Format}' format."); + } + } + + NameValuePairSavingsType IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNameValuePairSavingsType(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NameValuePairSavingsType)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairSavingsType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairSavingsType.cs new file mode 100644 index 000000000000..44fc6408906f --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairSavingsType.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// The generic name value pair. + public partial class NameValuePairSavingsType + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal NameValuePairSavingsType() + { + } + + /// Initializes a new instance of . + /// The name. + /// The value. + /// Keeps track of any properties unknown to the library. + internal NameValuePairSavingsType(SavingsType? name, float? value, IDictionary serializedAdditionalRawData) + { + Name = name; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name. + public SavingsType? Name { get; } + /// The value. + public float? Value { get; } + } +} 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..d0511295ed34 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProvisioningState.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 +{ + /// The status of the current operation. + 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 SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string ProvisioningValue = "Provisioning"; + private const string UpdatingValue = "Updating"; + private const string DeletingValue = "Deleting"; + private const string AcceptedValue = "Accepted"; + + /// Resource provisioning Successful. + public static ProvisioningState Succeeded { get; } = new ProvisioningState(SucceededValue); + /// Resource provisioning Failed. + public static ProvisioningState Failed { get; } = new ProvisioningState(FailedValue); + /// Resource provisioning Canceled. + public static ProvisioningState Canceled { get; } = new ProvisioningState(CanceledValue); + /// Resource is being Provisioned. + public static ProvisioningState Provisioning { get; } = new ProvisioningState(ProvisioningValue); + /// Resource is being Updated. + public static ProvisioningState Updating { get; } = new ProvisioningState(UpdatingValue); + /// Resource is being Deleted. + public static ProvisioningState Deleting { get; } = new ProvisioningState(DeletingValue); + /// Resource is being Accepted. + public static ProvisioningState Accepted { get; } = new ProvisioningState(AcceptedValue); + /// 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 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 != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsDetailsCommon.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsDetailsCommon.Serialization.cs new file mode 100644 index 000000000000..7e1f080240c7 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsDetailsCommon.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class SavingsDetailsCommon : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SavingsDetailsCommon)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(SavingOptions)) + { + writer.WritePropertyName("savingOptions"u8); + writer.WriteStringValue(SavingOptions.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(SavingsDetail)) + { + writer.WritePropertyName("savingsDetail"u8); + writer.WriteStartArray(); + foreach (var item in SavingsDetail) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SavingsDetailsCommon IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SavingsDetailsCommon)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSavingsDetailsCommon(document.RootElement, options); + } + + internal static SavingsDetailsCommon DeserializeSavingsDetailsCommon(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SavingsOption? savingOptions = default; + IReadOnlyList savingsDetail = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("savingOptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + savingOptions = new SavingsOption(property.Value.GetString()); + continue; + } + if (property.NameEquals("savingsDetail"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NameValuePairSavingsType.DeserializeNameValuePairSavingsType(item, options)); + } + savingsDetail = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SavingsDetailsCommon(savingOptions, savingsDetail ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SavingsDetailsCommon)} does not support writing '{options.Format}' format."); + } + } + + SavingsDetailsCommon IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSavingsDetailsCommon(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SavingsDetailsCommon)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsDetailsCommon.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsDetailsCommon.cs new file mode 100644 index 000000000000..ae06d672509a --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsDetailsCommon.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// The savings details. + public partial class SavingsDetailsCommon + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SavingsDetailsCommon() + { + SavingsDetail = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The savings options. + /// The sku cost details per azure offer type. + /// Keeps track of any properties unknown to the library. + internal SavingsDetailsCommon(SavingsOption? savingOptions, IReadOnlyList savingsDetail, IDictionary serializedAdditionalRawData) + { + SavingOptions = savingOptions; + SavingsDetail = savingsDetail; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The savings options. + public SavingsOption? SavingOptions { get; } + /// The sku cost details per azure offer type. + public IReadOnlyList SavingsDetail { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsOption.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsOption.cs new file mode 100644 index 000000000000..1e590848ca6d --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsOption.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 +{ + /// The savings options. + public readonly partial struct SavingsOption : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SavingsOption(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string RI1YearValue = "RI1Year"; + private const string RI3YearValue = "RI3Year"; + private const string SavingsPlan1YearValue = "SavingsPlan1Year"; + private const string SavingsPlan3YearValue = "SavingsPlan3Year"; + private const string CustomAzureOfferCodeValue = "CustomAzureOfferCode"; + + /// No savings options. + public static SavingsOption None { get; } = new SavingsOption(NoneValue); + /// Reserved Instance for 1 year. + public static SavingsOption RI1Year { get; } = new SavingsOption(RI1YearValue); + /// Reserved Instance for 3 years. + public static SavingsOption RI3Year { get; } = new SavingsOption(RI3YearValue); + /// The savings plan for 1 year. + public static SavingsOption SavingsPlan1Year { get; } = new SavingsOption(SavingsPlan1YearValue); + /// The savings plan for 3 years. + public static SavingsOption SavingsPlan3Year { get; } = new SavingsOption(SavingsPlan3YearValue); + /// Custom azure offer code. + public static SavingsOption CustomAzureOfferCode { get; } = new SavingsOption(CustomAzureOfferCodeValue); + /// Determines if two values are the same. + public static bool operator ==(SavingsOption left, SavingsOption right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SavingsOption left, SavingsOption right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SavingsOption(string value) => new SavingsOption(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SavingsOption other && Equals(other); + /// + public bool Equals(SavingsOption other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsType.cs new file mode 100644 index 000000000000..87aa1949e515 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsType.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 +{ + /// Savings type. + public readonly partial struct SavingsType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SavingsType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MonthlyAzureHybridCostSavingsValue = "MonthlyAzureHybridCostSavings"; + private const string MonthlyLinuxAzureHybridCostSavingsValue = "MonthlyLinuxAzureHybridCostSavings"; + private const string MonthlyAhubSqlCostSavingsValue = "MonthlyAhubSqlCostSavings"; + private const string MonthlyVcfByolCostDifferenceValue = "MonthlyVcfByolCostDifference"; + + /// MonthlyAzureHybridCostSavings - Savings type. + public static SavingsType MonthlyAzureHybridCostSavings { get; } = new SavingsType(MonthlyAzureHybridCostSavingsValue); + /// MonthlyLinuxAzureHybridCostSavings - Savings type. + public static SavingsType MonthlyLinuxAzureHybridCostSavings { get; } = new SavingsType(MonthlyLinuxAzureHybridCostSavingsValue); + /// MonthlyAhubSqlCostSavings - Savings type. + public static SavingsType MonthlyAhubSqlCostSavings { get; } = new SavingsType(MonthlyAhubSqlCostSavingsValue); + /// MonthlyVcfByolCostDifference - Savings type. + public static SavingsType MonthlyVcfByolCostDifference { get; } = new SavingsType(MonthlyVcfByolCostDifferenceValue); + /// Determines if two values are the same. + public static bool operator ==(SavingsType left, SavingsType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SavingsType left, SavingsType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SavingsType(string value) => new SavingsType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SavingsType other && Equals(other); + /// + public bool Equals(SavingsType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SourceDetails.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SourceDetails.Serialization.cs new file mode 100644 index 000000000000..a7825e38c300 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SourceDetails.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class SourceDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SourceDetails)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(SourceName)) + { + writer.WritePropertyName("sourceName"u8); + writer.WriteStringValue(SourceName.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(SourceType)) + { + writer.WritePropertyName("sourceType"u8); + writer.WriteStringValue(SourceType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Platform)) + { + writer.WritePropertyName("platform"u8); + writer.WriteStringValue(Platform.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Count)) + { + writer.WritePropertyName("count"u8); + writer.WriteNumberValue(Count.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SourceDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SourceDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSourceDetails(document.RootElement, options); + } + + internal static SourceDetails DeserializeSourceDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AssessmentSource? sourceName = default; + MigrateWorkloadType? sourceType = default; + MigrationPlatform? platform = default; + int? count = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sourceName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceName = new AssessmentSource(property.Value.GetString()); + continue; + } + if (property.NameEquals("sourceType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceType = new MigrateWorkloadType(property.Value.GetString()); + continue; + } + if (property.NameEquals("platform"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + platform = new MigrationPlatform(property.Value.GetString()); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SourceDetails(sourceName, sourceType, platform, count, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SourceDetails)} does not support writing '{options.Format}' format."); + } + } + + SourceDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSourceDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SourceDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SourceDetails.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SourceDetails.cs new file mode 100644 index 000000000000..26f61c43f6e9 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SourceDetails.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Source details. + public partial class SourceDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SourceDetails() + { + } + + /// Initializes a new instance of . + /// The source name. + /// The source type. + /// The migration platform. + /// The count of a type of source. + /// Keeps track of any properties unknown to the library. + internal SourceDetails(AssessmentSource? sourceName, MigrateWorkloadType? sourceType, MigrationPlatform? platform, int? count, IDictionary serializedAdditionalRawData) + { + SourceName = sourceName; + SourceType = sourceType; + Platform = platform; + Count = count; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The source name. + public AssessmentSource? SourceName { get; } + /// The source type. + public MigrateWorkloadType? SourceType { get; } + /// The migration platform. + public MigrationPlatform? Platform { get; } + /// The count of a type of source. + public int? Count { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SummaryType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SummaryType.cs new file mode 100644 index 000000000000..e166c682086e --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SummaryType.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 +{ + /// Summary Type. + public readonly partial struct SummaryType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SummaryType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string StrategyValue = "Strategy"; + private const string TargetValue = "Target"; + + /// Unknown - Summary Type. + public static SummaryType Unknown { get; } = new SummaryType(UnknownValue); + /// Strategy - Summary Type. + public static SummaryType Strategy { get; } = new SummaryType(StrategyValue); + /// Target - Summary Type. + public static SummaryType Target { get; } = new SummaryType(TargetValue); + /// Determines if two values are the same. + public static bool operator ==(SummaryType left, SummaryType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SummaryType left, SummaryType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SummaryType(string value) => new SummaryType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SummaryType other && Equals(other); + /// + public bool Equals(SummaryType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetAssessmentArmIds.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetAssessmentArmIds.Serialization.cs new file mode 100644 index 000000000000..ccaf70ecacf9 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetAssessmentArmIds.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class TargetAssessmentArmIds : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TargetAssessmentArmIds)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Aks)) + { + writer.WritePropertyName("aks"u8); + writer.WriteStringValue(Aks); + } + if (Optional.IsDefined(AzureAppService)) + { + writer.WritePropertyName("azureAppService"u8); + writer.WriteStringValue(AzureAppService); + } + if (Optional.IsDefined(AzureAppServiceContainer)) + { + writer.WritePropertyName("azureAppServiceContainer"u8); + writer.WriteStringValue(AzureAppServiceContainer); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TargetAssessmentArmIds IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TargetAssessmentArmIds)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTargetAssessmentArmIds(document.RootElement, options); + } + + internal static TargetAssessmentArmIds DeserializeTargetAssessmentArmIds(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string aks = default; + string azureAppService = default; + string azureAppServiceContainer = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("aks"u8)) + { + aks = property.Value.GetString(); + continue; + } + if (property.NameEquals("azureAppService"u8)) + { + azureAppService = property.Value.GetString(); + continue; + } + if (property.NameEquals("azureAppServiceContainer"u8)) + { + azureAppServiceContainer = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TargetAssessmentArmIds(aks, azureAppService, azureAppServiceContainer, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TargetAssessmentArmIds)} does not support writing '{options.Format}' format."); + } + } + + TargetAssessmentArmIds IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTargetAssessmentArmIds(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TargetAssessmentArmIds)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetAssessmentArmIds.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetAssessmentArmIds.cs new file mode 100644 index 000000000000..d9515c762f96 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetAssessmentArmIds.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// ARM IDs of the target assessments. + public partial class TargetAssessmentArmIds + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public TargetAssessmentArmIds() + { + } + + /// Initializes a new instance of . + /// ARM ID for Azure Kubernetes Service assessment. + /// ARM ID for Azure App Service assessment. + /// ARM ID for Azure App Service Container assessment. + /// Keeps track of any properties unknown to the library. + internal TargetAssessmentArmIds(string aks, string azureAppService, string azureAppServiceContainer, IDictionary serializedAdditionalRawData) + { + Aks = aks; + AzureAppService = azureAppService; + AzureAppServiceContainer = azureAppServiceContainer; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// ARM ID for Azure Kubernetes Service assessment. + public string Aks { get; set; } + /// ARM ID for Azure App Service assessment. + public string AzureAppService { get; set; } + /// ARM ID for Azure App Service Container assessment. + public string AzureAppServiceContainer { get; set; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetDetails.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetDetails.Serialization.cs new file mode 100644 index 000000000000..3bf097404317 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetDetails.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class TargetDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TargetDetails)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(TargetName)) + { + writer.WritePropertyName("targetName"u8); + writer.WriteStringValue(TargetName.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(TargetType)) + { + writer.WritePropertyName("targetType"u8); + writer.WriteStringValue(TargetType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Platform)) + { + writer.WritePropertyName("platform"u8); + writer.WriteStringValue(Platform.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Count)) + { + writer.WritePropertyName("count"u8); + writer.WriteNumberValue(Count.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TargetDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TargetDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTargetDetails(document.RootElement, options); + } + + internal static TargetDetails DeserializeTargetDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureTarget? targetName = default; + MigrateWorkloadType? targetType = default; + MigrationPlatform? platform = default; + int? count = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("targetName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetName = new AzureTarget(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetType = new MigrateWorkloadType(property.Value.GetString()); + continue; + } + if (property.NameEquals("platform"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + platform = new MigrationPlatform(property.Value.GetString()); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TargetDetails(targetName, targetType, platform, count, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TargetDetails)} does not support writing '{options.Format}' format."); + } + } + + TargetDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTargetDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TargetDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetDetails.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetDetails.cs new file mode 100644 index 000000000000..5d18623d77c5 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetDetails.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Target details. + public partial class TargetDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal TargetDetails() + { + } + + /// Initializes a new instance of . + /// The target name. + /// The target type. + /// The migration platform. + /// The count of a type of source. + /// Keeps track of any properties unknown to the library. + internal TargetDetails(AzureTarget? targetName, MigrateWorkloadType? targetType, MigrationPlatform? platform, int? count, IDictionary serializedAdditionalRawData) + { + TargetName = targetName; + TargetType = targetType; + Platform = platform; + Count = count; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The target name. + public AzureTarget? TargetName { get; } + /// The target type. + public MigrateWorkloadType? TargetType { get; } + /// The migration platform. + public MigrationPlatform? Platform { get; } + /// The count of a type of source. + public int? Count { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetSourcePair.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetSourcePair.Serialization.cs new file mode 100644 index 000000000000..a7ee215dc5cb --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetSourcePair.Serialization.cs @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class TargetSourcePair : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TargetSourcePair)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(SourceRef)) + { + writer.WritePropertyName("sourceRef"u8); + writer.WriteStringValue(SourceRef.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(TargetRef)) + { + writer.WritePropertyName("targetRef"u8); + writer.WriteStringValue(TargetRef.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(SourceCount)) + { + writer.WritePropertyName("sourceCount"u8); + writer.WriteNumberValue(SourceCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(TargetCount)) + { + writer.WritePropertyName("targetCount"u8); + writer.WriteNumberValue(TargetCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(MigrationDetails)) + { + writer.WritePropertyName("migrationDetails"u8); + writer.WriteObjectValue(MigrationDetails, options); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ManagementDetails)) + { + writer.WritePropertyName("managementDetails"u8); + writer.WriteStartArray(); + foreach (var item in ManagementDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(CostDetails)) + { + writer.WritePropertyName("costDetails"u8); + writer.WriteStartArray(); + foreach (var item in CostDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(SavingsDetails)) + { + writer.WritePropertyName("savingsDetails"u8); + writer.WriteStartArray(); + foreach (var item in SavingsDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ConfidenceScore)) + { + writer.WritePropertyName("confidenceScore"u8); + writer.WriteNumberValue(ConfidenceScore.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TargetSourcePair IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TargetSourcePair)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTargetSourcePair(document.RootElement, options); + } + + internal static TargetSourcePair DeserializeTargetSourcePair(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AssessmentSource? sourceRef = default; + AzureTarget? targetRef = default; + int? sourceCount = default; + int? targetCount = default; + MigrationDetails migrationDetails = default; + IReadOnlyList managementDetails = default; + IReadOnlyList costDetails = default; + IReadOnlyList savingsDetails = default; + double? confidenceScore = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sourceRef"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceRef = new AssessmentSource(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetRef"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetRef = new AzureTarget(property.Value.GetString()); + continue; + } + if (property.NameEquals("sourceCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("targetCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("migrationDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + migrationDetails = MigrationDetails.DeserializeMigrationDetails(property.Value, options); + continue; + } + if (property.NameEquals("managementDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.ManagementDetails.DeserializeManagementDetails(item, options)); + } + managementDetails = array; + continue; + } + if (property.NameEquals("costDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CostDetailsCommon.DeserializeCostDetailsCommon(item, options)); + } + costDetails = array; + continue; + } + if (property.NameEquals("savingsDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SavingsDetailsCommon.DeserializeSavingsDetailsCommon(item, options)); + } + savingsDetails = array; + continue; + } + if (property.NameEquals("confidenceScore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + confidenceScore = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TargetSourcePair( + sourceRef, + targetRef, + sourceCount, + targetCount, + migrationDetails, + managementDetails ?? new ChangeTrackingList(), + costDetails ?? new ChangeTrackingList(), + savingsDetails ?? new ChangeTrackingList(), + confidenceScore, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TargetSourcePair)} does not support writing '{options.Format}' format."); + } + } + + TargetSourcePair IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTargetSourcePair(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TargetSourcePair)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetSourcePair.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetSourcePair.cs new file mode 100644 index 000000000000..55fd8e305a01 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetSourcePair.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Target source pair. + public partial class TargetSourcePair + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal TargetSourcePair() + { + ManagementDetails = new ChangeTrackingList(); + CostDetails = new ChangeTrackingList(); + SavingsDetails = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The source name. + /// The target name. + /// The count of a type of source. + /// The count of a type of target. + /// The migration details. + /// The management details. + /// The cost details. + /// The savings details. + /// The confidence score. + /// Keeps track of any properties unknown to the library. + internal TargetSourcePair(AssessmentSource? sourceRef, AzureTarget? targetRef, int? sourceCount, int? targetCount, MigrationDetails migrationDetails, IReadOnlyList managementDetails, IReadOnlyList costDetails, IReadOnlyList savingsDetails, double? confidenceScore, IDictionary serializedAdditionalRawData) + { + SourceRef = sourceRef; + TargetRef = targetRef; + SourceCount = sourceCount; + TargetCount = targetCount; + MigrationDetails = migrationDetails; + ManagementDetails = managementDetails; + CostDetails = costDetails; + SavingsDetails = savingsDetails; + ConfidenceScore = confidenceScore; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The source name. + public AssessmentSource? SourceRef { get; } + /// The target name. + public AzureTarget? TargetRef { get; } + /// The count of a type of source. + public int? SourceCount { get; } + /// The count of a type of target. + public int? TargetCount { get; } + /// The migration details. + public MigrationDetails MigrationDetails { get; } + /// The management details. + public IReadOnlyList ManagementDetails { get; } + /// The cost details. + public IReadOnlyList CostDetails { get; } + /// The savings details. + public IReadOnlyList SavingsDetails { get; } + /// The confidence score. + public double? ConfidenceScore { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryListResult.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryListResult.Serialization.cs new file mode 100644 index 000000000000..941591926a91 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + internal partial class WebAppCompoundAssessmentSummaryListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WebAppCompoundAssessmentSummaryListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + WebAppCompoundAssessmentSummaryListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WebAppCompoundAssessmentSummaryListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebAppCompoundAssessmentSummaryListResult(document.RootElement, options); + } + + internal static WebAppCompoundAssessmentSummaryListResult DeserializeWebAppCompoundAssessmentSummaryListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(WebAppCompoundAssessmentSummaryData.DeserializeWebAppCompoundAssessmentSummaryData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WebAppCompoundAssessmentSummaryListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WebAppCompoundAssessmentSummaryListResult)} does not support writing '{options.Format}' format."); + } + } + + WebAppCompoundAssessmentSummaryListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeWebAppCompoundAssessmentSummaryListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WebAppCompoundAssessmentSummaryListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryListResult.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryListResult.cs new file mode 100644 index 000000000000..b4fc81d66b0c --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// The response of a WebAppCompoundAssessmentSummary list operation. + internal partial class WebAppCompoundAssessmentSummaryListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The WebAppCompoundAssessmentSummary items on this page. + /// is null. + internal WebAppCompoundAssessmentSummaryListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The WebAppCompoundAssessmentSummary items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal WebAppCompoundAssessmentSummaryListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal WebAppCompoundAssessmentSummaryListResult() + { + } + + /// The WebAppCompoundAssessmentSummary items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryProperties.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryProperties.Serialization.cs new file mode 100644 index 000000000000..bfa67fd587f0 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryProperties.Serialization.cs @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class WebAppCompoundAssessmentSummaryProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WebAppCompoundAssessmentSummaryProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(SummaryType)) + { + writer.WritePropertyName("summaryType"u8); + writer.WriteStringValue(SummaryType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(SummaryName)) + { + writer.WritePropertyName("summaryName"u8); + writer.WriteStringValue(SummaryName); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Sources)) + { + writer.WritePropertyName("sources"u8); + writer.WriteStartArray(); + foreach (var item in Sources) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Targets)) + { + writer.WritePropertyName("targets"u8); + writer.WriteStartArray(); + foreach (var item in Targets) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(TargetSourceMapping)) + { + writer.WritePropertyName("targetSourceMapping"u8); + writer.WriteStartArray(); + foreach (var item in TargetSourceMapping) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(CostComponents)) + { + writer.WritePropertyName("costComponents"u8); + writer.WriteStartArray(); + foreach (var item in CostComponents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(SavingsComponents)) + { + writer.WritePropertyName("savingsComponents"u8); + writer.WriteStartArray(); + foreach (var item in SavingsComponents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(AssessmentName)) + { + writer.WritePropertyName("assessmentName"u8); + writer.WriteStringValue(AssessmentName); + } + if (Optional.IsDefined(DiscoveredLightSummary)) + { + writer.WritePropertyName("discoveredLightSummary"u8); + writer.WriteObjectValue(DiscoveredLightSummary, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + WebAppCompoundAssessmentSummaryProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WebAppCompoundAssessmentSummaryProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebAppCompoundAssessmentSummaryProperties(document.RootElement, options); + } + + internal static WebAppCompoundAssessmentSummaryProperties DeserializeWebAppCompoundAssessmentSummaryProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SummaryType? summaryType = default; + string summaryName = default; + IReadOnlyList sources = default; + IReadOnlyList targets = default; + IReadOnlyList targetSourceMapping = default; + IReadOnlyList costComponents = default; + IReadOnlyList savingsComponents = default; + string assessmentName = default; + DiscoveredLightSummary discoveredLightSummary = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("summaryType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + summaryType = new SummaryType(property.Value.GetString()); + continue; + } + if (property.NameEquals("summaryName"u8)) + { + summaryName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SourceDetails.DeserializeSourceDetails(item, options)); + } + sources = array; + continue; + } + if (property.NameEquals("targets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TargetDetails.DeserializeTargetDetails(item, options)); + } + targets = array; + continue; + } + if (property.NameEquals("targetSourceMapping"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TargetSourcePair.DeserializeTargetSourcePair(item, options)); + } + targetSourceMapping = array; + continue; + } + if (property.NameEquals("costComponents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CostDetailsCommon.DeserializeCostDetailsCommon(item, options)); + } + costComponents = array; + continue; + } + if (property.NameEquals("savingsComponents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SavingsDetailsCommon.DeserializeSavingsDetailsCommon(item, options)); + } + savingsComponents = array; + continue; + } + if (property.NameEquals("assessmentName"u8)) + { + assessmentName = property.Value.GetString(); + continue; + } + if (property.NameEquals("discoveredLightSummary"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + discoveredLightSummary = DiscoveredLightSummary.DeserializeDiscoveredLightSummary(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WebAppCompoundAssessmentSummaryProperties( + summaryType, + summaryName, + sources ?? new ChangeTrackingList(), + targets ?? new ChangeTrackingList(), + targetSourceMapping ?? new ChangeTrackingList(), + costComponents ?? new ChangeTrackingList(), + savingsComponents ?? new ChangeTrackingList(), + assessmentName, + discoveredLightSummary, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WebAppCompoundAssessmentSummaryProperties)} does not support writing '{options.Format}' format."); + } + } + + WebAppCompoundAssessmentSummaryProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeWebAppCompoundAssessmentSummaryProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WebAppCompoundAssessmentSummaryProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryProperties.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryProperties.cs new file mode 100644 index 000000000000..cc46cc30d005 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryProperties.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// WebApp compound assessment summary properties class. + public partial class WebAppCompoundAssessmentSummaryProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal WebAppCompoundAssessmentSummaryProperties() + { + Sources = new ChangeTrackingList(); + Targets = new ChangeTrackingList(); + TargetSourceMapping = new ChangeTrackingList(); + CostComponents = new ChangeTrackingList(); + SavingsComponents = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The summary type. + /// The summary name. + /// The source details list. + /// The target details list. + /// The target source mapping. + /// The cost components. + /// The cost components. + /// Name of the assessment. + /// Light summary of the compound assessment. + /// Keeps track of any properties unknown to the library. + internal WebAppCompoundAssessmentSummaryProperties(SummaryType? summaryType, string summaryName, IReadOnlyList sources, IReadOnlyList targets, IReadOnlyList targetSourceMapping, IReadOnlyList costComponents, IReadOnlyList savingsComponents, string assessmentName, DiscoveredLightSummary discoveredLightSummary, IDictionary serializedAdditionalRawData) + { + SummaryType = summaryType; + SummaryName = summaryName; + Sources = sources; + Targets = targets; + TargetSourceMapping = targetSourceMapping; + CostComponents = costComponents; + SavingsComponents = savingsComponents; + AssessmentName = assessmentName; + DiscoveredLightSummary = discoveredLightSummary; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The summary type. + public SummaryType? SummaryType { get; } + /// The summary name. + public string SummaryName { get; } + /// The source details list. + public IReadOnlyList Sources { get; } + /// The target details list. + public IReadOnlyList Targets { get; } + /// The target source mapping. + public IReadOnlyList TargetSourceMapping { get; } + /// The cost components. + public IReadOnlyList CostComponents { get; } + /// The cost components. + public IReadOnlyList SavingsComponents { get; } + /// Name of the assessment. + public string AssessmentName { get; } + /// Light summary of the compound assessment. + public DiscoveredLightSummary DiscoveredLightSummary { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppType.cs new file mode 100644 index 000000000000..7f1943c00e03 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppType.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 +{ + /// Web App Type. + public readonly partial struct WebAppType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public WebAppType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string ASPNETValue = "ASP.Net"; + private const string JavaValue = "Java"; + + /// Unknown. Indicates Missing Data. + public static WebAppType Unknown { get; } = new WebAppType(UnknownValue); + /// ASP.NET Web App. + public static WebAppType ASPNET { get; } = new WebAppType(ASPNETValue); + /// Java Web App. + public static WebAppType Java { get; } = new WebAppType(JavaValue); + /// Determines if two values are the same. + public static bool operator ==(WebAppType left, WebAppType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(WebAppType left, WebAppType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator WebAppType(string value) => new WebAppType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is WebAppType other && Equals(other); + /// + public bool Equals(WebAppType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppsPerType.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppsPerType.Serialization.cs new file mode 100644 index 000000000000..94cd6a2b2892 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppsPerType.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class WebAppsPerType : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WebAppsPerType)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("webAppType"u8); + writer.WriteStringValue(WebAppType.ToString()); + writer.WritePropertyName("count"u8); + writer.WriteNumberValue(Count); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + WebAppsPerType IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WebAppsPerType)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebAppsPerType(document.RootElement, options); + } + + internal static WebAppsPerType DeserializeWebAppsPerType(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WebAppType webAppType = default; + int count = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("webAppType"u8)) + { + webAppType = new WebAppType(property.Value.GetString()); + continue; + } + if (property.NameEquals("count"u8)) + { + count = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WebAppsPerType(webAppType, count, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WebAppsPerType)} does not support writing '{options.Format}' format."); + } + } + + WebAppsPerType IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeWebAppsPerType(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WebAppsPerType)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppsPerType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppsPerType.cs new file mode 100644 index 000000000000..034c06a195de --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppsPerType.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Number of web apps per type. + public partial class WebAppsPerType + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Name of the web app type. + /// Count of the web app type. + internal WebAppsPerType(WebAppType webAppType, int count) + { + WebAppType = webAppType; + Count = count; + } + + /// Initializes a new instance of . + /// Name of the web app type. + /// Count of the web app type. + /// Keeps track of any properties unknown to the library. + internal WebAppsPerType(WebAppType webAppType, int count, IDictionary serializedAdditionalRawData) + { + WebAppType = webAppType; + Count = count; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal WebAppsPerType() + { + } + + /// Name of the web app type. + public WebAppType WebAppType { get; } + /// Count of the web app type. + public int Count { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebServerType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebServerType.cs new file mode 100644 index 000000000000..97e2a3c39605 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebServerType.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 +{ + /// Web Server Type. + public readonly partial struct WebServerType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public WebServerType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string IISValue = "IIS"; + private const string TomcatValue = "Tomcat"; + + /// Unknown. Indicates Missing Data. + public static WebServerType Unknown { get; } = new WebServerType(UnknownValue); + /// ASP.NET Web App. + public static WebServerType IIS { get; } = new WebServerType(IISValue); + /// Java Web App. + public static WebServerType Tomcat { get; } = new WebServerType(TomcatValue); + /// Determines if two values are the same. + public static bool operator ==(WebServerType left, WebServerType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(WebServerType left, WebServerType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator WebServerType(string value) => new WebServerType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is WebServerType other && Equals(other); + /// + public bool Equals(WebServerType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebServersPerType.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebServersPerType.Serialization.cs new file mode 100644 index 000000000000..c0c98541af66 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebServersPerType.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class WebServersPerType : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WebServersPerType)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("webServerType"u8); + writer.WriteStringValue(WebServerType.ToString()); + writer.WritePropertyName("count"u8); + writer.WriteNumberValue(Count); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + WebServersPerType IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WebServersPerType)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebServersPerType(document.RootElement, options); + } + + internal static WebServersPerType DeserializeWebServersPerType(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WebServerType webServerType = default; + int count = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("webServerType"u8)) + { + webServerType = new WebServerType(property.Value.GetString()); + continue; + } + if (property.NameEquals("count"u8)) + { + count = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WebServersPerType(webServerType, count, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WebServersPerType)} does not support writing '{options.Format}' format."); + } + } + + WebServersPerType IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeWebServersPerType(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WebServersPerType)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebServersPerType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebServersPerType.cs new file mode 100644 index 000000000000..b087cd20b119 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebServersPerType.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Number of web servers per type. + public partial class WebServersPerType + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Name of the web app type. + /// Count of the web app type. + internal WebServersPerType(WebServerType webServerType, int count) + { + WebServerType = webServerType; + Count = count; + } + + /// Initializes a new instance of . + /// Name of the web app type. + /// Count of the web app type. + /// Keeps track of any properties unknown to the library. + internal WebServersPerType(WebServerType webServerType, int count, IDictionary serializedAdditionalRawData) + { + WebServerType = webServerType; + Count = count; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal WebServersPerType() + { + } + + /// Name of the web app type. + public WebServerType WebServerType { get; } + /// Count of the web app type. + public int Count { get; } + } +} 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/CompoundAssessmentRestOperations.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/CompoundAssessmentRestOperations.cs new file mode 100644 index 000000000000..336ba5bf1b03 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/CompoundAssessmentRestOperations.cs @@ -0,0 +1,615 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migrate.Models; + +namespace Azure.ResourceManager.Migrate +{ + internal partial class CompoundAssessmentRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of CompoundAssessmentRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public CompoundAssessmentRestOperations(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 ?? "2024-03-03-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName) + { + 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("/webAppCompoundAssessments/", false); + uri.AppendPath(compoundAssessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName) + { + 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("/webAppCompoundAssessments/", false); + uri.AppendPath(compoundAssessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a CompoundAssessment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CompoundAssessmentData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CompoundAssessmentData.DeserializeCompoundAssessmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CompoundAssessmentData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a CompoundAssessment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CompoundAssessmentData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CompoundAssessmentData.DeserializeCompoundAssessmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CompoundAssessmentData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentRequestUri(string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/webAppCompoundAssessments", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByParentRequest(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("/webAppCompoundAssessments", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List CompoundAssessment resources by AssessmentProject. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByParentAsync(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 = CreateListByParentRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CompoundAssessmentListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CompoundAssessmentListResult.DeserializeCompoundAssessmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List CompoundAssessment resources by AssessmentProject. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByParent(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 = CreateListByParentRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CompoundAssessmentListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CompoundAssessmentListResult.DeserializeCompoundAssessmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, CompoundAssessmentData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/webAppCompoundAssessments/", false); + uri.AppendPath(compoundAssessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, CompoundAssessmentData 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("/webAppCompoundAssessments/", false); + uri.AppendPath(compoundAssessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a CompoundAssessment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, CompoundAssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, projectName, compoundAssessmentName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a CompoundAssessment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, CompoundAssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, projectName, compoundAssessmentName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName) + { + 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("/webAppCompoundAssessments/", false); + uri.AppendPath(compoundAssessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName) + { + 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("/webAppCompoundAssessments/", false); + uri.AppendPath(compoundAssessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a CompoundAssessment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + 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 CompoundAssessment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDownloadUrlRequestUri(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, DownloadUrlContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/webAppCompoundAssessments/", false); + uri.AppendPath(compoundAssessmentName, true); + uri.AppendPath("/downloadUrl", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDownloadUrlRequest(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, DownloadUrlContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/webAppCompoundAssessments/", false); + uri.AppendPath(compoundAssessmentName, true); + uri.AppendPath("/downloadUrl", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// A long-running resource action. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM name. + /// The content of the action request. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DownloadUrlAsync(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, DownloadUrlContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateDownloadUrlRequest(subscriptionId, resourceGroupName, projectName, compoundAssessmentName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// A long-running resource action. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM name. + /// The content of the action request. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response DownloadUrl(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, DownloadUrlContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateDownloadUrlRequest(subscriptionId, resourceGroupName, projectName, compoundAssessmentName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByParentNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List CompoundAssessment resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByParentNextPageAsync(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 = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CompoundAssessmentListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CompoundAssessmentListResult.DeserializeCompoundAssessmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List CompoundAssessment resources by AssessmentProject. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByParentNextPage(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 = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CompoundAssessmentListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CompoundAssessmentListResult.DeserializeCompoundAssessmentListResult(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/CompoundAssessmentSummaryRestOperations.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/CompoundAssessmentSummaryRestOperations.cs new file mode 100644 index 000000000000..7b5fb8ad9f92 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/CompoundAssessmentSummaryRestOperations.cs @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migrate.Models; + +namespace Azure.ResourceManager.Migrate +{ + internal partial class CompoundAssessmentSummaryRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of CompoundAssessmentSummaryRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public CompoundAssessmentSummaryRestOperations(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 ?? "2024-03-03-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, string summaryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/webAppCompoundAssessments/", false); + uri.AppendPath(compoundAssessmentName, true); + uri.AppendPath("/summaries/", false); + uri.AppendPath(summaryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, string summaryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/webAppCompoundAssessments/", false); + uri.AppendPath(compoundAssessmentName, true); + uri.AppendPath("/summaries/", false); + uri.AppendPath(summaryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a WebAppCompoundAssessmentSummary. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM name. + /// Gets the Name of the WebApp compound assessment summary. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, string summaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + Argument.AssertNotNullOrEmpty(summaryName, nameof(summaryName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, compoundAssessmentName, summaryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebAppCompoundAssessmentSummaryData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = WebAppCompoundAssessmentSummaryData.DeserializeWebAppCompoundAssessmentSummaryData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((WebAppCompoundAssessmentSummaryData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a WebAppCompoundAssessmentSummary. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM name. + /// Gets the Name of the WebApp compound assessment summary. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, string summaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + Argument.AssertNotNullOrEmpty(summaryName, nameof(summaryName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, compoundAssessmentName, summaryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebAppCompoundAssessmentSummaryData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = WebAppCompoundAssessmentSummaryData.DeserializeWebAppCompoundAssessmentSummaryData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((WebAppCompoundAssessmentSummaryData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentRequestUri(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName) + { + 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("/webAppCompoundAssessments/", false); + uri.AppendPath(compoundAssessmentName, true); + uri.AppendPath("/summaries", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByParentRequest(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName) + { + 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("/webAppCompoundAssessments/", false); + uri.AppendPath(compoundAssessmentName, true); + uri.AppendPath("/summaries", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List WebAppCompoundAssessmentSummary resources by CompoundAssessment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByParentAsync(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebAppCompoundAssessmentSummaryListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = WebAppCompoundAssessmentSummaryListResult.DeserializeWebAppCompoundAssessmentSummaryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List WebAppCompoundAssessmentSummary resources by CompoundAssessment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByParent(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebAppCompoundAssessmentSummaryListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = WebAppCompoundAssessmentSummaryListResult.DeserializeWebAppCompoundAssessmentSummaryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByParentNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List WebAppCompoundAssessmentSummary resources by CompoundAssessment. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByParentNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, 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(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebAppCompoundAssessmentSummaryListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = WebAppCompoundAssessmentSummaryListResult.DeserializeWebAppCompoundAssessmentSummaryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List WebAppCompoundAssessmentSummary resources by CompoundAssessment. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByParentNextPage(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, 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(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebAppCompoundAssessmentSummaryListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = WebAppCompoundAssessmentSummaryListResult.DeserializeWebAppCompoundAssessmentSummaryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryCollection.cs new file mode 100644 index 000000000000..133051600d11 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryCollection.cs @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.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 GetWebAppCompoundAssessmentSummaries method from an instance of . + /// + public partial class WebAppCompoundAssessmentSummaryCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics; + private readonly CompoundAssessmentSummaryRestOperations _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected WebAppCompoundAssessmentSummaryCollection() + { + } + + /// 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 WebAppCompoundAssessmentSummaryCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", WebAppCompoundAssessmentSummaryResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WebAppCompoundAssessmentSummaryResource.ResourceType, out string webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsApiVersion); + _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient = new CompoundAssessmentSummaryRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != CompoundAssessmentResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CompoundAssessmentResource.ResourceType), nameof(id)); + } + + /// + /// Get a WebAppCompoundAssessmentSummary + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// WebAppCompoundAssessmentSummary_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Gets the Name of the WebApp compound assessment summary. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string summaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(summaryName, nameof(summaryName)); + + using var scope = _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics.CreateScope("WebAppCompoundAssessmentSummaryCollection.Get"); + scope.Start(); + try + { + var response = await _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, summaryName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WebAppCompoundAssessmentSummaryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a WebAppCompoundAssessmentSummary + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// WebAppCompoundAssessmentSummary_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Gets the Name of the WebApp compound assessment summary. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string summaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(summaryName, nameof(summaryName)); + + using var scope = _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics.CreateScope("WebAppCompoundAssessmentSummaryCollection.Get"); + scope.Start(); + try + { + var response = _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, summaryName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WebAppCompoundAssessmentSummaryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List WebAppCompoundAssessmentSummary resources by CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries + /// + /// + /// Operation Id + /// WebAppCompoundAssessmentSummary_ListByParent + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WebAppCompoundAssessmentSummaryResource(Client, WebAppCompoundAssessmentSummaryData.DeserializeWebAppCompoundAssessmentSummaryData(e)), _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics, Pipeline, "WebAppCompoundAssessmentSummaryCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List WebAppCompoundAssessmentSummary resources by CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries + /// + /// + /// Operation Id + /// WebAppCompoundAssessmentSummary_ListByParent + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WebAppCompoundAssessmentSummaryResource(Client, WebAppCompoundAssessmentSummaryData.DeserializeWebAppCompoundAssessmentSummaryData(e)), _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics, Pipeline, "WebAppCompoundAssessmentSummaryCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// WebAppCompoundAssessmentSummary_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Gets the Name of the WebApp compound assessment summary. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string summaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(summaryName, nameof(summaryName)); + + using var scope = _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics.CreateScope("WebAppCompoundAssessmentSummaryCollection.Exists"); + scope.Start(); + try + { + var response = await _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, summaryName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// WebAppCompoundAssessmentSummary_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Gets the Name of the WebApp compound assessment summary. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string summaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(summaryName, nameof(summaryName)); + + using var scope = _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics.CreateScope("WebAppCompoundAssessmentSummaryCollection.Exists"); + scope.Start(); + try + { + var response = _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, summaryName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// WebAppCompoundAssessmentSummary_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Gets the Name of the WebApp compound assessment summary. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string summaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(summaryName, nameof(summaryName)); + + using var scope = _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics.CreateScope("WebAppCompoundAssessmentSummaryCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, summaryName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WebAppCompoundAssessmentSummaryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// WebAppCompoundAssessmentSummary_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Gets the Name of the WebApp compound assessment summary. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string summaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(summaryName, nameof(summaryName)); + + using var scope = _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics.CreateScope("WebAppCompoundAssessmentSummaryCollection.GetIfExists"); + scope.Start(); + try + { + var response = _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, summaryName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WebAppCompoundAssessmentSummaryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryData.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryData.Serialization.cs new file mode 100644 index 000000000000..d83cfe5c4031 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + public partial class WebAppCompoundAssessmentSummaryData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WebAppCompoundAssessmentSummaryData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + WebAppCompoundAssessmentSummaryData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WebAppCompoundAssessmentSummaryData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebAppCompoundAssessmentSummaryData(document.RootElement, options); + } + + internal static WebAppCompoundAssessmentSummaryData DeserializeWebAppCompoundAssessmentSummaryData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WebAppCompoundAssessmentSummaryProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = WebAppCompoundAssessmentSummaryProperties.DeserializeWebAppCompoundAssessmentSummaryProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WebAppCompoundAssessmentSummaryData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WebAppCompoundAssessmentSummaryData)} does not support writing '{options.Format}' format."); + } + } + + WebAppCompoundAssessmentSummaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeWebAppCompoundAssessmentSummaryData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WebAppCompoundAssessmentSummaryData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryData.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryData.cs new file mode 100644 index 000000000000..c1b9d84f7d5c --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryData.cs @@ -0,0 +1,75 @@ +// 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.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// A class representing the WebAppCompoundAssessmentSummary data model. + /// WebApp compound assessment summary resource. + /// + public partial class WebAppCompoundAssessmentSummaryData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal WebAppCompoundAssessmentSummaryData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal WebAppCompoundAssessmentSummaryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, WebAppCompoundAssessmentSummaryProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public WebAppCompoundAssessmentSummaryProperties Properties { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryResource.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryResource.Serialization.cs new file mode 100644 index 000000000000..36b704e7606f --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Migrate +{ + public partial class WebAppCompoundAssessmentSummaryResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + WebAppCompoundAssessmentSummaryData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + WebAppCompoundAssessmentSummaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryResource.cs new file mode 100644 index 000000000000..207f351c180d --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryResource.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// A Class representing a WebAppCompoundAssessmentSummary 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 GetWebAppCompoundAssessmentSummaryResource method. + /// Otherwise you can get one from its parent resource using the GetWebAppCompoundAssessmentSummary method. + /// + public partial class WebAppCompoundAssessmentSummaryResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The compoundAssessmentName. + /// The summaryName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, string summaryName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries/{summaryName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics; + private readonly CompoundAssessmentSummaryRestOperations _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient; + private readonly WebAppCompoundAssessmentSummaryData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/webAppCompoundAssessments/summaries"; + + /// Initializes a new instance of the class for mocking. + protected WebAppCompoundAssessmentSummaryResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal WebAppCompoundAssessmentSummaryResource(ArmClient client, WebAppCompoundAssessmentSummaryData 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 WebAppCompoundAssessmentSummaryResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsApiVersion); + _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient = new CompoundAssessmentSummaryRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual WebAppCompoundAssessmentSummaryData 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 WebAppCompoundAssessmentSummary + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// WebAppCompoundAssessmentSummary_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics.CreateScope("WebAppCompoundAssessmentSummaryResource.Get"); + scope.Start(); + try + { + var response = await _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient.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 WebAppCompoundAssessmentSummaryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a WebAppCompoundAssessmentSummary + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// WebAppCompoundAssessmentSummary_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics.CreateScope("WebAppCompoundAssessmentSummaryResource.Get"); + scope.Start(); + try + { + var response = _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient.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 WebAppCompoundAssessmentSummaryResource(Client, response.Value), response.GetRawResponse()); + } + 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..8c9a14318269 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.ResourceManager.Migrate.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("Migrate")] 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..21d451125a20 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/tests/Azure.ResourceManager.Migrate.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + 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..e3e8cef00b7d --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/tests/MigrateManagementTestBase.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager; +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 SubscriptionResource DefaultSubscription { get; private set; } + + protected MigrateManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected MigrateManagementTestBase(bool isAsync) + : base(isAsync) + { + } + + [SetUp] + public async Task CreateCommonClient() + { + Client = GetArmClient(); + DefaultSubscription = await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false); + } + + protected async Task CreateResourceGroup(SubscriptionResource subscription, string rgNamePrefix, AzureLocation location) + { + string rgName = Recording.GenerateAssetName(rgNamePrefix); + ResourceGroupData input = new ResourceGroupData(location); + var lro = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, input); + return lro.Value; + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/tests/MigrateManagementTestEnvironment.cs b/sdk/migrate/Azure.ResourceManager.Migrate/tests/MigrateManagementTestEnvironment.cs new file mode 100644 index 000000000000..251feeecd081 --- /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 + { + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/tsp-location.yaml b/sdk/migrate/Azure.ResourceManager.Migrate/tsp-location.yaml new file mode 100644 index 000000000000..26b6bf5a24da --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/tsp-location.yaml @@ -0,0 +1,5 @@ +directory: specification/migrate/AssessmentProjects.Management/WebAppCompoundAssessments.Management +commit: 89b6ac2f39a795921f0daa82f32e904d9752cda8 +repo: Azure/azure-rest-api-specs +additionalDirectories: +- specification/migrate/AssessmentProjects.Management/Common diff --git a/sdk/migrate/ci.mgmt.yml b/sdk/migrate/ci.mgmt.yml new file mode 100644 index 000000000000..2984f984e1ac --- /dev/null +++ b/sdk/migrate/ci.mgmt.yml @@ -0,0 +1,26 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: none + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/migrate /ci.mgmt.yml + - sdk/migrate /Azure.ResourceManager.Migrate / + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: migrate + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.Migrate + safeName: AzureResourceManagerMigrate diff --git a/sdk/pineconevectordb/ci.yml b/sdk/pineconevectordb/ci.yml deleted file mode 100644 index 0b8325c8c903..000000000000 --- a/sdk/pineconevectordb/ci.yml +++ /dev/null @@ -1,35 +0,0 @@ -# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - -trigger: - branches: - include: - - main - - hotfix/* - - release/* - paths: - include: - - sdk/pineconevectordb - - sdk/pineconevectordb/ci.yml - - sdk/pineconevectordb/Azure.ResourceManager.PineconeVectorDb - -pr: - branches: - include: - - main - - feature/* - - hotfix/* - - release/* - paths: - include: - - sdk/pineconevectordb - - sdk/pineconevectordb/ci.yml - - sdk/pineconevectordb/Azure.ResourceManager.PineconeVectorDb - -extends: - template: /eng/pipelines/templates/stages/archetype-sdk-client.yml - parameters: - ServiceDirectory: pineconevectordb - ArtifactName: packages - Artifacts: - - name: Azure.ResourceManager.PineconeVectorDb - safeName: AzureResourceManagerPineconeVectorDb diff --git a/sdk/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml index 1c0fe85cd2f6..9bfa34e82601 100644 --- a/sdk/resourcemanager/ci.mgmt.yml +++ b/sdk/resourcemanager/ci.mgmt.yml @@ -131,6 +131,7 @@ trigger: - sdk/marketplace/Azure.ResourceManager.Marketplace - sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering - sdk/mediaservices/Azure.ResourceManager.Media + - sdk/migrate/Azure.ResourceManager.Migrate - sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment - sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap - sdk/mixedreality/Azure.ResourceManager.MixedReality @@ -346,6 +347,7 @@ pr: - sdk/marketplace/Azure.ResourceManager.Marketplace - sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering - sdk/mediaservices/Azure.ResourceManager.Media + - sdk/migrate/Azure.ResourceManager.Migrate - sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment - sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap - sdk/mixedreality/Azure.ResourceManager.MixedReality diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 2ca0501b60bd..6d83bf7eebb6 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -9,9 +9,17 @@ trigger: paths: include: - sdk/storage/ + exclude: + - sdk/storage/Azure.ResourceManager.Storage/ - sdk/storage/Azure.Storage.DataMovement/ + exclude: + - sdk/storage/Azure.ResourceManager.Storage/ - sdk/storage/Azure.Storage.DataMovement.Blobs/ + exclude: + - sdk/storage/Azure.ResourceManager.Storage/ - sdk/storage/Azure.Storage.DataMovement.Files/ + exclude: + - sdk/storage/Azure.ResourceManager.Storage/ - sdk/storage/Azure.Storage.DataMovement.Blobs.Files.Shares/ exclude: - sdk/storage/Azure.ResourceManager.Storage/