diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/Azure.ResourceManager.ConnectedCache.sln b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/Azure.ResourceManager.ConnectedCache.sln new file mode 100644 index 000000000000..4247645fb197 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/Azure.ResourceManager.ConnectedCache.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.ConnectedCache.Samples", "samples\Azure.ResourceManager.ConnectedCache.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.ConnectedCache", "src\Azure.ResourceManager.ConnectedCache.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.ConnectedCache.Tests", "tests\Azure.ResourceManager.ConnectedCache.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/connectedcache/Azure.ResourceManager.ConnectedCache/CHANGELOG.md b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/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/connectedcache/Azure.ResourceManager.ConnectedCache/Directory.Build.props b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/README.md b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/README.md new file mode 100644 index 000000000000..1ba4d0fd1b39 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure ConnectedCache 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 ConnectedCache management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.ConnectedCache --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/connectedcache/Azure.ResourceManager.ConnectedCache/api/Azure.ResourceManager.ConnectedCache.net8.0.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/api/Azure.ResourceManager.ConnectedCache.net8.0.cs new file mode 100644 index 000000000000..ecf508d88aa5 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/api/Azure.ResourceManager.ConnectedCache.net8.0.cs @@ -0,0 +1,865 @@ +namespace Azure.ResourceManager.ConnectedCache +{ + public static partial class ConnectedCacheExtensions + { + public static Azure.ResourceManager.ConnectedCache.EnterpriseMccCacheNodeResource GetEnterpriseMccCacheNodeResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ConnectedCache.EnterpriseMccCustomerResource GetEnterpriseMccCustomerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetEnterpriseMccCustomerResource(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetEnterpriseMccCustomerResourceAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ConnectedCache.EnterpriseMccCustomerResourceCollection GetEnterpriseMccCustomerResources(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetEnterpriseMccCustomerResources(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetEnterpriseMccCustomerResourcesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ConnectedCache.IspCacheNodeResource GetIspCacheNodeResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ConnectedCache.IspCustomerResource GetIspCustomerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetIspCustomerResource(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetIspCustomerResourceAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ConnectedCache.IspCustomerResourceCollection GetIspCustomerResources(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetIspCustomerResources(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetIspCustomerResourcesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class EnterpriseMccCacheNodeResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected EnterpriseMccCacheNodeResource() { } + public virtual Azure.ResourceManager.ConnectedCache.EnterpriseMccCacheNodeResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCacheNodeAutoUpdateHistory(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCacheNodeAutoUpdateHistoryAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCacheNodeInstallDetails(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCacheNodeInstallDetailsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCacheNodeMccIssueDetailsHistory(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCacheNodeMccIssueDetailsHistoryAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCacheNodeTlsCertificateHistory(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCacheNodeTlsCertificateHistoryAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ConnectedCache.EnterpriseMccCacheNodeResourceData 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.ConnectedCache.EnterpriseMccCacheNodeResourceData 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.Response Update(Azure.ResourceManager.ConnectedCache.Models.ConnectedCachePatchContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.ConnectedCache.Models.ConnectedCachePatchContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class EnterpriseMccCacheNodeResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected EnterpriseMccCacheNodeResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string cacheNodeResourceName, Azure.ResourceManager.ConnectedCache.EnterpriseMccCacheNodeResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string cacheNodeResourceName, Azure.ResourceManager.ConnectedCache.EnterpriseMccCacheNodeResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string cacheNodeResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string cacheNodeResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string cacheNodeResourceName, 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 cacheNodeResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string cacheNodeResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string cacheNodeResourceName, 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 EnterpriseMccCacheNodeResourceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EnterpriseMccCacheNodeResourceData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.ConnectedCache.Models.CacheNodeProperty Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.EnterpriseMccCacheNodeResourceData 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.ConnectedCache.EnterpriseMccCacheNodeResourceData 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 EnterpriseMccCustomerResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected EnterpriseMccCustomerResource() { } + public virtual Azure.ResourceManager.ConnectedCache.EnterpriseMccCustomerResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string customerResourceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetEnterpriseMccCacheNodeResource(string cacheNodeResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetEnterpriseMccCacheNodeResourceAsync(string cacheNodeResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ConnectedCache.EnterpriseMccCacheNodeResourceCollection GetEnterpriseMccCacheNodeResources() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ConnectedCache.EnterpriseMccCustomerResourceData 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.ConnectedCache.EnterpriseMccCustomerResourceData 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.Response Update(Azure.ResourceManager.ConnectedCache.Models.ConnectedCachePatchContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.ConnectedCache.Models.ConnectedCachePatchContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class EnterpriseMccCustomerResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected EnterpriseMccCustomerResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string customerResourceName, Azure.ResourceManager.ConnectedCache.EnterpriseMccCustomerResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string customerResourceName, Azure.ResourceManager.ConnectedCache.EnterpriseMccCustomerResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string customerResourceName, 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 customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string customerResourceName, 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 EnterpriseMccCustomerResourceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EnterpriseMccCustomerResourceData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.ConnectedCache.Models.CustomerProperty Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.EnterpriseMccCustomerResourceData 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.ConnectedCache.EnterpriseMccCustomerResourceData 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 IspCacheNodeResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected IspCacheNodeResource() { } + public virtual Azure.ResourceManager.ConnectedCache.IspCacheNodeResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetBgpCidrs(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetBgpCidrsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCacheNodeAutoUpdateHistory(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCacheNodeAutoUpdateHistoryAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCacheNodeInstallDetails(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCacheNodeInstallDetailsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCacheNodeMccIssueDetailsHistory(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCacheNodeMccIssueDetailsHistoryAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ConnectedCache.IspCacheNodeResourceData 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.ConnectedCache.IspCacheNodeResourceData 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.Response Update(Azure.ResourceManager.ConnectedCache.Models.ConnectedCachePatchContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.ConnectedCache.Models.ConnectedCachePatchContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class IspCacheNodeResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected IspCacheNodeResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string cacheNodeResourceName, Azure.ResourceManager.ConnectedCache.IspCacheNodeResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string cacheNodeResourceName, Azure.ResourceManager.ConnectedCache.IspCacheNodeResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string cacheNodeResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string cacheNodeResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string cacheNodeResourceName, 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 cacheNodeResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string cacheNodeResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string cacheNodeResourceName, 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 IspCacheNodeResourceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IspCacheNodeResourceData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.ConnectedCache.Models.CacheNodeProperty Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.IspCacheNodeResourceData 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.ConnectedCache.IspCacheNodeResourceData 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 IspCustomerResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected IspCustomerResource() { } + public virtual Azure.ResourceManager.ConnectedCache.IspCustomerResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string customerResourceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetIspCacheNodeResource(string cacheNodeResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIspCacheNodeResourceAsync(string cacheNodeResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ConnectedCache.IspCacheNodeResourceCollection GetIspCacheNodeResources() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ConnectedCache.IspCustomerResourceData 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.ConnectedCache.IspCustomerResourceData 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.Response Update(Azure.ResourceManager.ConnectedCache.Models.ConnectedCachePatchContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.ConnectedCache.Models.ConnectedCachePatchContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class IspCustomerResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected IspCustomerResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string customerResourceName, Azure.ResourceManager.ConnectedCache.IspCustomerResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string customerResourceName, Azure.ResourceManager.ConnectedCache.IspCustomerResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string customerResourceName, 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 customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string customerResourceName, 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 IspCustomerResourceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IspCustomerResourceData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.ConnectedCache.Models.CustomerProperty Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.IspCustomerResourceData 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.ConnectedCache.IspCustomerResourceData 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.ConnectedCache.Mocking +{ + public partial class MockableConnectedCacheArmClient : Azure.ResourceManager.ArmResource + { + protected MockableConnectedCacheArmClient() { } + public virtual Azure.ResourceManager.ConnectedCache.EnterpriseMccCacheNodeResource GetEnterpriseMccCacheNodeResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ConnectedCache.EnterpriseMccCustomerResource GetEnterpriseMccCustomerResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ConnectedCache.IspCacheNodeResource GetIspCacheNodeResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ConnectedCache.IspCustomerResource GetIspCustomerResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableConnectedCacheResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableConnectedCacheResourceGroupResource() { } + public virtual Azure.Response GetEnterpriseMccCustomerResource(string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetEnterpriseMccCustomerResourceAsync(string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ConnectedCache.EnterpriseMccCustomerResourceCollection GetEnterpriseMccCustomerResources() { throw null; } + public virtual Azure.Response GetIspCustomerResource(string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIspCustomerResourceAsync(string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ConnectedCache.IspCustomerResourceCollection GetIspCustomerResources() { throw null; } + } + public partial class MockableConnectedCacheSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableConnectedCacheSubscriptionResource() { } + public virtual Azure.Pageable GetEnterpriseMccCustomerResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetEnterpriseMccCustomerResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetIspCustomerResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetIspCustomerResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.ConnectedCache.Models +{ + public partial class AdditionalCacheNodeProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AdditionalCacheNodeProperties() { } + public int? AggregatedStatusCode { get { throw null; } } + public string AggregatedStatusDetails { get { throw null; } } + public string AggregatedStatusText { get { throw null; } } + public string AutoUpdateAppliedVersion { get { throw null; } } + public string AutoUpdateLastAppliedDetails { get { throw null; } } + public System.DateTimeOffset? AutoUpdateLastAppliedOn { get { throw null; } } + public string AutoUpdateLastAppliedState { get { throw null; } } + public System.DateTimeOffset? AutoUpdateLastTriggeredOn { get { throw null; } } + public System.DateTimeOffset? AutoUpdateNextAvailableOn { get { throw null; } } + public string AutoUpdateNextAvailableVersion { get { throw null; } } + public string AutoUpdateVersion { get { throw null; } set { } } + public string BgpAsnToIPAddressMapping { get { throw null; } set { } } + public System.Collections.Generic.IList CacheNodePropertiesDetailsIssuesList { get { throw null; } } + public int? CacheNodeState { get { throw null; } } + public string CacheNodeStateDetailedText { get { throw null; } } + public string CacheNodeStateShortText { get { throw null; } } + public int? CreationMethod { get { throw null; } set { } } + public Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeTlsCertificate CurrentTlsCertificate { get { throw null; } } + public System.Collections.Generic.IList DriveConfiguration { get { throw null; } } + public bool? IsProvisioned { get { throw null; } } + public Azure.ResourceManager.ConnectedCache.Models.ProxyRequired? IsProxyRequired { get { throw null; } set { } } + public int? IssuesCount { get { throw null; } } + public System.Collections.Generic.IReadOnlyList IssuesList { get { throw null; } } + public Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeAutoUpdateInfo LastAutoUpdateInfo { get { throw null; } } + public string OptionalProperty1 { get { throw null; } set { } } + public string OptionalProperty2 { get { throw null; } set { } } + public string OptionalProperty3 { get { throw null; } set { } } + public string OptionalProperty4 { get { throw null; } set { } } + public string OptionalProperty5 { get { throw null; } set { } } + public Azure.ResourceManager.ConnectedCache.Models.OSType? OSType { get { throw null; } set { } } + public string ProductVersion { get { throw null; } } + public string ProxyUri { get { throw null; } set { } } + public string TlsStatus { get { throw null; } } + public string UpdateInfoDetails { get { throw null; } set { } } + public System.DateTimeOffset? UpdateRequestedOn { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.AdditionalCacheNodeProperties 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.ConnectedCache.Models.AdditionalCacheNodeProperties 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 AdditionalCustomerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AdditionalCustomerProperties() { } + public string CustomerAsn { get { throw null; } set { } } + public float? CustomerAsnEstimatedEgressPeekGbps { get { throw null; } } + public string CustomerEmail { get { throw null; } set { } } + public System.DateTimeOffset? CustomerEntitlementExpiration { get { throw null; } set { } } + public string CustomerEntitlementSkuGuid { get { throw null; } set { } } + public string CustomerEntitlementSkuId { get { throw null; } set { } } + public string CustomerEntitlementSkuName { get { throw null; } set { } } + public string CustomerOrgName { get { throw null; } } + public float? CustomerPropertiesOverviewAverageEgressMbps { get { throw null; } } + public float? CustomerPropertiesOverviewAverageMissMbps { get { throw null; } } + public float? CustomerPropertiesOverviewCacheEfficiency { get { throw null; } } + public int? CustomerPropertiesOverviewCacheNodesHealthyCount { get { throw null; } } + public int? CustomerPropertiesOverviewCacheNodesUnhealthyCount { get { throw null; } } + public float? CustomerPropertiesOverviewEgressMbpsMax { get { throw null; } } + public System.DateTimeOffset? CustomerPropertiesOverviewEgressMbpsMaxOn { get { throw null; } } + public float? CustomerPropertiesOverviewMissMbpsMax { get { throw null; } } + public System.DateTimeOffset? CustomerPropertiesOverviewMissMbpsMaxOn { get { throw null; } } + public string CustomerTransitAsn { get { throw null; } set { } } + public Azure.ResourceManager.ConnectedCache.Models.CustomerTransitState? CustomerTransitState { get { throw null; } set { } } + public string OptionalProperty1 { get { throw null; } set { } } + public string OptionalProperty2 { get { throw null; } set { } } + public string OptionalProperty3 { get { throw null; } set { } } + public string OptionalProperty4 { get { throw null; } set { } } + public string OptionalProperty5 { get { throw null; } set { } } + public System.DateTimeOffset? PeeringDbLastUpdateDateValue { get { throw null; } } + public int? SignupPhaseStatusCode { get { throw null; } } + public string SignupPhaseStatusText { get { throw null; } } + public bool? SignupStatus { get { throw null; } } + public int? SignupStatusCode { get { throw null; } } + public string SignupStatusText { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.AdditionalCustomerProperties 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.ConnectedCache.Models.AdditionalCustomerProperties 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 static partial class ArmConnectedCacheModelFactory + { + public static Azure.ResourceManager.ConnectedCache.Models.AdditionalCacheNodeProperties AdditionalCacheNodeProperties(System.Collections.Generic.IEnumerable cacheNodePropertiesDetailsIssuesList = null, System.Collections.Generic.IEnumerable issuesList = null, int? issuesCount = default(int?), Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeTlsCertificate currentTlsCertificate = null, Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeAutoUpdateInfo lastAutoUpdateInfo = null, string aggregatedStatusDetails = null, string aggregatedStatusText = null, int? aggregatedStatusCode = default(int?), string productVersion = null, bool? isProvisioned = default(bool?), string cacheNodeStateDetailedText = null, string cacheNodeStateShortText = null, int? cacheNodeState = default(int?), System.Collections.Generic.IEnumerable driveConfiguration = null, string bgpAsnToIPAddressMapping = null, string proxyUri = null, Azure.ResourceManager.ConnectedCache.Models.ProxyRequired? isProxyRequired = default(Azure.ResourceManager.ConnectedCache.Models.ProxyRequired?), Azure.ResourceManager.ConnectedCache.Models.OSType? osType = default(Azure.ResourceManager.ConnectedCache.Models.OSType?), string autoUpdateVersion = null, string updateInfoDetails = null, System.DateTimeOffset? updateRequestedOn = default(System.DateTimeOffset?), string autoUpdateNextAvailableVersion = null, System.DateTimeOffset? autoUpdateNextAvailableOn = default(System.DateTimeOffset?), string autoUpdateAppliedVersion = null, string autoUpdateLastAppliedDetails = null, string autoUpdateLastAppliedState = null, System.DateTimeOffset? autoUpdateLastAppliedOn = default(System.DateTimeOffset?), System.DateTimeOffset? autoUpdateLastTriggeredOn = default(System.DateTimeOffset?), int? creationMethod = default(int?), string tlsStatus = null, string optionalProperty1 = null, string optionalProperty2 = null, string optionalProperty3 = null, string optionalProperty4 = null, string optionalProperty5 = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.AdditionalCustomerProperties AdditionalCustomerProperties(float? customerPropertiesOverviewCacheEfficiency = default(float?), float? customerPropertiesOverviewAverageEgressMbps = default(float?), float? customerPropertiesOverviewAverageMissMbps = default(float?), float? customerPropertiesOverviewEgressMbpsMax = default(float?), System.DateTimeOffset? customerPropertiesOverviewEgressMbpsMaxOn = default(System.DateTimeOffset?), float? customerPropertiesOverviewMissMbpsMax = default(float?), System.DateTimeOffset? customerPropertiesOverviewMissMbpsMaxOn = default(System.DateTimeOffset?), int? customerPropertiesOverviewCacheNodesHealthyCount = default(int?), int? customerPropertiesOverviewCacheNodesUnhealthyCount = default(int?), bool? signupStatus = default(bool?), int? signupStatusCode = default(int?), string signupStatusText = null, int? signupPhaseStatusCode = default(int?), string signupPhaseStatusText = null, System.DateTimeOffset? peeringDbLastUpdateDateValue = default(System.DateTimeOffset?), string customerOrgName = null, string customerEmail = null, string customerTransitAsn = null, Azure.ResourceManager.ConnectedCache.Models.CustomerTransitState? customerTransitState = default(Azure.ResourceManager.ConnectedCache.Models.CustomerTransitState?), string customerAsn = null, float? customerAsnEstimatedEgressPeekGbps = default(float?), string customerEntitlementSkuId = null, string customerEntitlementSkuGuid = null, string customerEntitlementSkuName = null, System.DateTimeOffset? customerEntitlementExpiration = default(System.DateTimeOffset?), string optionalProperty1 = null, string optionalProperty2 = null, string optionalProperty3 = null, string optionalProperty4 = null, string optionalProperty5 = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.CacheNodeEntity CacheNodeEntity(string fullyQualifiedResourceId = null, string customerId = null, string customerName = null, string ipAddress = null, string customerIndex = null, string cacheNodeId = null, string cacheNodeName = null, int? customerAsn = default(int?), bool? isEnabled = default(bool?), int? maxAllowableEgressInMbps = default(int?), float? maxAllowableProbability = default(float?), string xCid = null, bool? isEnterpriseManaged = default(bool?), string createAsyncOperationId = null, string deleteAsyncOperationId = null, string clientTenantId = null, string category = null, int? releaseVersion = default(int?), System.DateTimeOffset? lastSyncWithAzureTimestamp = default(System.DateTimeOffset?), System.DateTimeOffset? lastUpdatedTimestamp = default(System.DateTimeOffset?), int? synchWithAzureAttemptsCount = default(int?), string containerConfigurations = null, System.Collections.Generic.IEnumerable cidrCsv = null, System.DateTimeOffset? cidrCsvLastUpdateOn = default(System.DateTimeOffset?), System.DateTimeOffset? bgpCidrCsvLastUpdateOn = default(System.DateTimeOffset?), System.DateTimeOffset? bgpLastReportedOn = default(System.DateTimeOffset?), string bgpReviewStateText = null, Azure.ResourceManager.ConnectedCache.Models.BgpReviewStateEnum? bgpReviewState = default(Azure.ResourceManager.ConnectedCache.Models.BgpReviewStateEnum?), string bgpReviewFeedback = null, int? bgpNumberOfTimesUpdated = default(int?), int? bgpNumberOfRecords = default(int?), int? bgpCidrBlocksCount = default(int?), int? bgpAddressSpace = default(int?), bool? shouldMigrate = default(bool?), int? bgpFileBytesTruncated = default(int?), int? cidrSelectionType = default(int?), bool? isFrozen = default(bool?), int? reviewState = default(int?), string reviewStateText = null, string reviewFeedback = null, Azure.ResourceManager.ConnectedCache.Models.ConfigurationState? configurationState = default(Azure.ResourceManager.ConnectedCache.Models.ConfigurationState?), string configurationStateText = null, int? addressSpace = default(int?), int? workerConnections = default(int?), System.DateTimeOffset? workerConnectionsLastUpdatedOn = default(System.DateTimeOffset?), int? containerResyncTrigger = default(int?), string imageUri = null, string fullyQualifiedDomainName = null, Azure.ResourceManager.ConnectedCache.Models.AutoUpdateRingType? autoUpdateRingType = default(Azure.ResourceManager.ConnectedCache.Models.AutoUpdateRingType?), int? autoUpdateRequestedWeek = default(int?), int? autoUpdateRequestedDay = default(int?), string autoUpdateRequestedTime = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.CacheNodeInstallProperties CacheNodeInstallProperties(string customerId = null, string cacheNodeId = null, string primaryAccountKey = null, string secondaryAccountKey = null, string registrationKey = null, string tlsCertificateProvisioningKey = null, System.Collections.Generic.IEnumerable driveConfiguration = null, string proxyUri = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.CacheNodeProperty CacheNodeProperty(Azure.ResourceManager.ConnectedCache.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ConnectedCache.Models.ProvisioningState?), Azure.ResourceManager.ConnectedCache.Models.CacheNodeEntity cacheNode = null, Azure.ResourceManager.ConnectedCache.Models.AdditionalCacheNodeProperties additionalCacheNodeProperties = null, string statusCode = null, string statusText = null, string statusDetails = null, string status = null, Azure.ResponseError error = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.CustomerEntity CustomerEntity(string fullyQualifiedResourceId = null, string customerId = null, string customerName = null, string contactEmail = null, string contactPhone = null, string contactName = null, bool? isEntitled = default(bool?), int? releaseVersion = default(int?), string createAsyncOperationId = null, string deleteAsyncOperationId = null, string clientTenantId = null, int? synchWithAzureAttemptsCount = default(int?), System.DateTimeOffset? lastSyncWithAzureTimestamp = default(System.DateTimeOffset?), bool? isEnterpriseManaged = default(bool?), bool? shouldMigrate = default(bool?), bool? resendSignupCode = default(bool?), bool? verifySignupCode = default(bool?), string verifySignupPhrase = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.CustomerProperty CustomerProperty(Azure.ResourceManager.ConnectedCache.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ConnectedCache.Models.ProvisioningState?), Azure.ResourceManager.ConnectedCache.Models.CustomerEntity customer = null, Azure.ResourceManager.ConnectedCache.Models.AdditionalCustomerProperties additionalCustomerProperties = null, string statusCode = null, string statusText = null, string statusDetails = null, string status = null, Azure.ResponseError error = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.EnterpriseMccCacheNodeResourceData EnterpriseMccCacheNodeResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ConnectedCache.Models.CacheNodeProperty properties = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.EnterpriseMccCustomerResourceData EnterpriseMccCustomerResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ConnectedCache.Models.CustomerProperty properties = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.IspCacheNodeResourceData IspCacheNodeResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ConnectedCache.Models.CacheNodeProperty properties = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.IspCustomerResourceData IspCustomerResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ConnectedCache.Models.CustomerProperty properties = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeAutoUpdateHistory MccCacheNodeAutoUpdateHistory(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeAutoUpdateHistoryProperties properties = null, System.Collections.Generic.IReadOnlyDictionary tags = null, string location = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeAutoUpdateHistoryProperties MccCacheNodeAutoUpdateHistoryProperties(string customerId = null, string cacheNodeId = null, System.Collections.Generic.IEnumerable autoUpdateHistory = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeAutoUpdateInfo MccCacheNodeAutoUpdateInfo(string imageUriBeforeUpdate = null, string imageUriTargeted = null, string imageUriTerminal = null, int? autoUpdateRingType = default(int?), System.DateTimeOffset? movedToTerminalStateOn = default(System.DateTimeOffset?), int? ruleRequestedWeek = default(int?), int? ruleRequestedDay = default(int?), System.DateTimeOffset? createdDateTimeUtc = default(System.DateTimeOffset?), System.DateTimeOffset? updatedRegistryDateTimeUtc = default(System.DateTimeOffset?), string planChangeLogText = null, int? autoUpdateLastAppliedStatus = default(int?), string autoUpdateLastAppliedStatusText = null, string autoUpdateLastAppliedStatusDetailedText = null, long? planId = default(long?), string timeToGoLiveDateTime = null, string ruleRequestedMinute = null, string ruleRequestedHour = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeBgpCidrDetails MccCacheNodeBgpCidrDetails(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable bgpCidrs = null, System.Collections.Generic.IReadOnlyDictionary tags = null, string location = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeInstallDetails MccCacheNodeInstallDetails(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ConnectedCache.Models.CacheNodeInstallProperties properties = null, System.Collections.Generic.IReadOnlyDictionary tags = null, string location = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeIssueHistory MccCacheNodeIssueHistory(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeIssueHistoryProperties properties = null, System.Collections.Generic.IReadOnlyDictionary tags = null, string location = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeIssueHistoryProperties MccCacheNodeIssueHistoryProperties(string customerId = null, string cacheNodeId = null, System.Collections.Generic.IEnumerable mccIssueHistory = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeTlsCertificate MccCacheNodeTlsCertificate(string actionRequired = null, string certificateFileName = null, string thumbprint = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), System.DateTimeOffset? notBeforeOn = default(System.DateTimeOffset?), string subject = null, string subjectAltName = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeTlsCertificateHistory MccCacheNodeTlsCertificateHistory(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeTlsCertificateProperties properties = null, System.Collections.Generic.IReadOnlyDictionary tags = null, string location = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeTlsCertificateProperties MccCacheNodeTlsCertificateProperties(string customerId = null, string cacheNodeId = null, System.Collections.Generic.IEnumerable tlsCertificateHistory = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.MccIssue MccIssue(string mccIssueType = null, string toastString = null, string detailString = null, string helpLink = null, System.DateTimeOffset? issueStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? issueEndOn = default(System.DateTimeOffset?)) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AutoUpdateRingType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AutoUpdateRingType(string value) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.AutoUpdateRingType Fast { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.AutoUpdateRingType Preview { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.AutoUpdateRingType Slow { get { throw null; } } + public bool Equals(Azure.ResourceManager.ConnectedCache.Models.AutoUpdateRingType 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.ConnectedCache.Models.AutoUpdateRingType left, Azure.ResourceManager.ConnectedCache.Models.AutoUpdateRingType right) { throw null; } + public static implicit operator Azure.ResourceManager.ConnectedCache.Models.AutoUpdateRingType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ConnectedCache.Models.AutoUpdateRingType left, Azure.ResourceManager.ConnectedCache.Models.AutoUpdateRingType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BgpReviewStateEnum : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BgpReviewStateEnum(string value) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.BgpReviewStateEnum Approved { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.BgpReviewStateEnum AttentionRequired { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.BgpReviewStateEnum InReview { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.BgpReviewStateEnum NotConfigured { get { throw null; } } + public bool Equals(Azure.ResourceManager.ConnectedCache.Models.BgpReviewStateEnum 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.ConnectedCache.Models.BgpReviewStateEnum left, Azure.ResourceManager.ConnectedCache.Models.BgpReviewStateEnum right) { throw null; } + public static implicit operator Azure.ResourceManager.ConnectedCache.Models.BgpReviewStateEnum (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ConnectedCache.Models.BgpReviewStateEnum left, Azure.ResourceManager.ConnectedCache.Models.BgpReviewStateEnum right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CacheNodeDriveConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CacheNodeDriveConfiguration() { } + public int? CacheNumber { get { throw null; } set { } } + public string NginxMapping { get { throw null; } set { } } + public string PhysicalPath { get { throw null; } set { } } + public int? SizeInGb { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.CacheNodeDriveConfiguration 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.ConnectedCache.Models.CacheNodeDriveConfiguration 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 CacheNodeEntity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CacheNodeEntity() { } + public int? AddressSpace { get { throw null; } } + public int? AutoUpdateRequestedDay { get { throw null; } set { } } + public string AutoUpdateRequestedTime { get { throw null; } set { } } + public int? AutoUpdateRequestedWeek { get { throw null; } set { } } + public Azure.ResourceManager.ConnectedCache.Models.AutoUpdateRingType? AutoUpdateRingType { get { throw null; } set { } } + public int? BgpAddressSpace { get { throw null; } } + public int? BgpCidrBlocksCount { get { throw null; } } + public System.DateTimeOffset? BgpCidrCsvLastUpdateOn { get { throw null; } } + public int? BgpFileBytesTruncated { get { throw null; } } + public System.DateTimeOffset? BgpLastReportedOn { get { throw null; } } + public int? BgpNumberOfRecords { get { throw null; } } + public int? BgpNumberOfTimesUpdated { get { throw null; } } + public string BgpReviewFeedback { get { throw null; } } + public Azure.ResourceManager.ConnectedCache.Models.BgpReviewStateEnum? BgpReviewState { get { throw null; } } + public string BgpReviewStateText { get { throw null; } } + public string CacheNodeId { get { throw null; } set { } } + public string CacheNodeName { get { throw null; } set { } } + public string Category { get { throw null; } } + public System.Collections.Generic.IList CidrCsv { get { throw null; } } + public System.DateTimeOffset? CidrCsvLastUpdateOn { get { throw null; } } + public int? CidrSelectionType { get { throw null; } set { } } + public string ClientTenantId { get { throw null; } } + public Azure.ResourceManager.ConnectedCache.Models.ConfigurationState? ConfigurationState { get { throw null; } } + public string ConfigurationStateText { get { throw null; } } + public string ContainerConfigurations { get { throw null; } } + public int? ContainerResyncTrigger { get { throw null; } } + public string CreateAsyncOperationId { get { throw null; } } + public int? CustomerAsn { get { throw null; } set { } } + public string CustomerId { get { throw null; } } + public string CustomerIndex { get { throw null; } set { } } + public string CustomerName { get { throw null; } set { } } + public string DeleteAsyncOperationId { get { throw null; } } + public string FullyQualifiedDomainName { get { throw null; } set { } } + public string FullyQualifiedResourceId { get { throw null; } set { } } + public string ImageUri { get { throw null; } } + public string IPAddress { get { throw null; } set { } } + public bool? IsEnabled { get { throw null; } set { } } + public bool? IsEnterpriseManaged { get { throw null; } set { } } + public bool? IsFrozen { get { throw null; } } + public System.DateTimeOffset? LastSyncWithAzureTimestamp { get { throw null; } } + public System.DateTimeOffset? LastUpdatedTimestamp { get { throw null; } } + public int? MaxAllowableEgressInMbps { get { throw null; } set { } } + public float? MaxAllowableProbability { get { throw null; } } + public int? ReleaseVersion { get { throw null; } } + public string ReviewFeedback { get { throw null; } } + public int? ReviewState { get { throw null; } } + public string ReviewStateText { get { throw null; } } + public bool? ShouldMigrate { get { throw null; } set { } } + public int? SynchWithAzureAttemptsCount { get { throw null; } } + public int? WorkerConnections { get { throw null; } } + public System.DateTimeOffset? WorkerConnectionsLastUpdatedOn { get { throw null; } } + public string XCid { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.CacheNodeEntity 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.ConnectedCache.Models.CacheNodeEntity 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 CacheNodeInstallProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CacheNodeInstallProperties() { } + public string CacheNodeId { get { throw null; } } + public string CustomerId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList DriveConfiguration { get { throw null; } } + public string PrimaryAccountKey { get { throw null; } } + public string ProxyUri { get { throw null; } } + public string RegistrationKey { get { throw null; } } + public string SecondaryAccountKey { get { throw null; } } + public string TlsCertificateProvisioningKey { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.CacheNodeInstallProperties 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.ConnectedCache.Models.CacheNodeInstallProperties 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 CacheNodeProperty : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CacheNodeProperty() { } + public Azure.ResourceManager.ConnectedCache.Models.AdditionalCacheNodeProperties AdditionalCacheNodeProperties { get { throw null; } set { } } + public Azure.ResourceManager.ConnectedCache.Models.CacheNodeEntity CacheNode { get { throw null; } set { } } + public Azure.ResponseError Error { get { throw null; } set { } } + public Azure.ResourceManager.ConnectedCache.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string Status { get { throw null; } } + public string StatusCode { get { throw null; } set { } } + public string StatusDetails { get { throw null; } set { } } + public string StatusText { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.CacheNodeProperty 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.ConnectedCache.Models.CacheNodeProperty 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 ConfigurationState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConfigurationState(string value) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.ConfigurationState Configured { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.ConfigurationState NotConfiguredIP { get { throw null; } } + public bool Equals(Azure.ResourceManager.ConnectedCache.Models.ConfigurationState 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.ConnectedCache.Models.ConfigurationState left, Azure.ResourceManager.ConnectedCache.Models.ConfigurationState right) { throw null; } + public static implicit operator Azure.ResourceManager.ConnectedCache.Models.ConfigurationState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ConnectedCache.Models.ConfigurationState left, Azure.ResourceManager.ConnectedCache.Models.ConfigurationState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ConnectedCachePatchContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedCachePatchContent() { } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.ConnectedCachePatchContent 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.ConnectedCache.Models.ConnectedCachePatchContent 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 CustomerEntity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CustomerEntity() { } + public string ClientTenantId { get { throw null; } set { } } + public string ContactEmail { get { throw null; } set { } } + public string ContactName { get { throw null; } set { } } + public string ContactPhone { get { throw null; } set { } } + public string CreateAsyncOperationId { get { throw null; } } + public string CustomerId { get { throw null; } } + public string CustomerName { get { throw null; } set { } } + public string DeleteAsyncOperationId { get { throw null; } } + public string FullyQualifiedResourceId { get { throw null; } set { } } + public bool? IsEnterpriseManaged { get { throw null; } set { } } + public bool? IsEntitled { get { throw null; } set { } } + public System.DateTimeOffset? LastSyncWithAzureTimestamp { get { throw null; } } + public int? ReleaseVersion { get { throw null; } set { } } + public bool? ResendSignupCode { get { throw null; } set { } } + public bool? ShouldMigrate { get { throw null; } set { } } + public int? SynchWithAzureAttemptsCount { get { throw null; } } + public bool? VerifySignupCode { get { throw null; } set { } } + public string VerifySignupPhrase { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.CustomerEntity 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.ConnectedCache.Models.CustomerEntity 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 CustomerProperty : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CustomerProperty() { } + public Azure.ResourceManager.ConnectedCache.Models.AdditionalCustomerProperties AdditionalCustomerProperties { get { throw null; } set { } } + public Azure.ResourceManager.ConnectedCache.Models.CustomerEntity Customer { get { throw null; } set { } } + public Azure.ResponseError Error { get { throw null; } } + public Azure.ResourceManager.ConnectedCache.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string Status { get { throw null; } } + public string StatusCode { get { throw null; } } + public string StatusDetails { get { throw null; } } + public string StatusText { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.CustomerProperty 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.ConnectedCache.Models.CustomerProperty 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 CustomerTransitState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CustomerTransitState(string value) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.CustomerTransitState CombinedTransit { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.CustomerTransitState NoTransit { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.CustomerTransitState TransitOnly { get { throw null; } } + public bool Equals(Azure.ResourceManager.ConnectedCache.Models.CustomerTransitState 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.ConnectedCache.Models.CustomerTransitState left, Azure.ResourceManager.ConnectedCache.Models.CustomerTransitState right) { throw null; } + public static implicit operator Azure.ResourceManager.ConnectedCache.Models.CustomerTransitState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ConnectedCache.Models.CustomerTransitState left, Azure.ResourceManager.ConnectedCache.Models.CustomerTransitState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MccCacheNodeAutoUpdateHistory : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MccCacheNodeAutoUpdateHistory() { } + public string Location { get { throw null; } } + public Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeAutoUpdateHistoryProperties Properties { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeAutoUpdateHistory 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.ConnectedCache.Models.MccCacheNodeAutoUpdateHistory 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 MccCacheNodeAutoUpdateHistoryProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MccCacheNodeAutoUpdateHistoryProperties() { } + public System.Collections.Generic.IReadOnlyList AutoUpdateHistory { get { throw null; } } + public string CacheNodeId { get { throw null; } } + public string CustomerId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeAutoUpdateHistoryProperties 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.ConnectedCache.Models.MccCacheNodeAutoUpdateHistoryProperties 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 MccCacheNodeAutoUpdateInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MccCacheNodeAutoUpdateInfo() { } + public int? AutoUpdateLastAppliedStatus { get { throw null; } } + public string AutoUpdateLastAppliedStatusDetailedText { get { throw null; } } + public string AutoUpdateLastAppliedStatusText { get { throw null; } } + public int? AutoUpdateRingType { get { throw null; } } + public System.DateTimeOffset? CreatedDateTimeUtc { get { throw null; } } + public string ImageUriBeforeUpdate { get { throw null; } } + public string ImageUriTargeted { get { throw null; } } + public string ImageUriTerminal { get { throw null; } } + public System.DateTimeOffset? MovedToTerminalStateOn { get { throw null; } } + public string PlanChangeLogText { get { throw null; } } + public long? PlanId { get { throw null; } } + public int? RuleRequestedDay { get { throw null; } } + public string RuleRequestedHour { get { throw null; } } + public string RuleRequestedMinute { get { throw null; } } + public int? RuleRequestedWeek { get { throw null; } } + public string TimeToGoLiveDateTime { get { throw null; } } + public System.DateTimeOffset? UpdatedRegistryDateTimeUtc { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeAutoUpdateInfo 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.ConnectedCache.Models.MccCacheNodeAutoUpdateInfo 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 MccCacheNodeBgpCidrDetails : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MccCacheNodeBgpCidrDetails() { } + public System.Collections.Generic.IReadOnlyList BgpCidrs { get { throw null; } } + public string Location { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeBgpCidrDetails 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.ConnectedCache.Models.MccCacheNodeBgpCidrDetails 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 MccCacheNodeInstallDetails : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MccCacheNodeInstallDetails() { } + public string Location { get { throw null; } } + public Azure.ResourceManager.ConnectedCache.Models.CacheNodeInstallProperties Properties { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeInstallDetails 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.ConnectedCache.Models.MccCacheNodeInstallDetails 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 MccCacheNodeIssueHistory : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MccCacheNodeIssueHistory() { } + public string Location { get { throw null; } } + public Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeIssueHistoryProperties Properties { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeIssueHistory 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.ConnectedCache.Models.MccCacheNodeIssueHistory 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 MccCacheNodeIssueHistoryProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MccCacheNodeIssueHistoryProperties() { } + public string CacheNodeId { get { throw null; } } + public string CustomerId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList MccIssueHistory { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeIssueHistoryProperties 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.ConnectedCache.Models.MccCacheNodeIssueHistoryProperties 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 MccCacheNodeTlsCertificate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MccCacheNodeTlsCertificate() { } + public string ActionRequired { get { throw null; } } + public string CertificateFileName { get { throw null; } } + public System.DateTimeOffset? ExpiryOn { get { throw null; } } + public System.DateTimeOffset? NotBeforeOn { get { throw null; } } + public string Subject { get { throw null; } } + public string SubjectAltName { get { throw null; } } + public string Thumbprint { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeTlsCertificate 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.ConnectedCache.Models.MccCacheNodeTlsCertificate 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 MccCacheNodeTlsCertificateHistory : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MccCacheNodeTlsCertificateHistory() { } + public string Location { get { throw null; } } + public Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeTlsCertificateProperties Properties { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeTlsCertificateHistory 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.ConnectedCache.Models.MccCacheNodeTlsCertificateHistory 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 MccCacheNodeTlsCertificateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MccCacheNodeTlsCertificateProperties() { } + public string CacheNodeId { get { throw null; } } + public string CustomerId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList TlsCertificateHistory { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeTlsCertificateProperties 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.ConnectedCache.Models.MccCacheNodeTlsCertificateProperties 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 MccIssue : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MccIssue() { } + public string DetailString { get { throw null; } } + public string HelpLink { get { throw null; } } + public System.DateTimeOffset? IssueEndOn { get { throw null; } } + public System.DateTimeOffset? IssueStartOn { get { throw null; } } + public string MccIssueType { get { throw null; } } + public string ToastString { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.MccIssue 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.ConnectedCache.Models.MccIssue 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 OSType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public OSType(string value) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.OSType Eflow { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.OSType Linux { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.OSType Windows { get { throw null; } } + public bool Equals(Azure.ResourceManager.ConnectedCache.Models.OSType 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.ConnectedCache.Models.OSType left, Azure.ResourceManager.ConnectedCache.Models.OSType right) { throw null; } + public static implicit operator Azure.ResourceManager.ConnectedCache.Models.OSType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ConnectedCache.Models.OSType left, Azure.ResourceManager.ConnectedCache.Models.OSType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.ProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.ProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.ProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.ProvisioningState Unknown { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.ProvisioningState Upgrading { get { throw null; } } + public bool Equals(Azure.ResourceManager.ConnectedCache.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.ConnectedCache.Models.ProvisioningState left, Azure.ResourceManager.ConnectedCache.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.ConnectedCache.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ConnectedCache.Models.ProvisioningState left, Azure.ResourceManager.ConnectedCache.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProxyRequired : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProxyRequired(string value) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.ProxyRequired None { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.ProxyRequired Required { get { throw null; } } + public bool Equals(Azure.ResourceManager.ConnectedCache.Models.ProxyRequired 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.ConnectedCache.Models.ProxyRequired left, Azure.ResourceManager.ConnectedCache.Models.ProxyRequired right) { throw null; } + public static implicit operator Azure.ResourceManager.ConnectedCache.Models.ProxyRequired (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ConnectedCache.Models.ProxyRequired left, Azure.ResourceManager.ConnectedCache.Models.ProxyRequired right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/api/Azure.ResourceManager.ConnectedCache.netstandard2.0.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/api/Azure.ResourceManager.ConnectedCache.netstandard2.0.cs new file mode 100644 index 000000000000..ecf508d88aa5 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/api/Azure.ResourceManager.ConnectedCache.netstandard2.0.cs @@ -0,0 +1,865 @@ +namespace Azure.ResourceManager.ConnectedCache +{ + public static partial class ConnectedCacheExtensions + { + public static Azure.ResourceManager.ConnectedCache.EnterpriseMccCacheNodeResource GetEnterpriseMccCacheNodeResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ConnectedCache.EnterpriseMccCustomerResource GetEnterpriseMccCustomerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetEnterpriseMccCustomerResource(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetEnterpriseMccCustomerResourceAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ConnectedCache.EnterpriseMccCustomerResourceCollection GetEnterpriseMccCustomerResources(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetEnterpriseMccCustomerResources(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetEnterpriseMccCustomerResourcesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ConnectedCache.IspCacheNodeResource GetIspCacheNodeResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ConnectedCache.IspCustomerResource GetIspCustomerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetIspCustomerResource(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetIspCustomerResourceAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ConnectedCache.IspCustomerResourceCollection GetIspCustomerResources(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetIspCustomerResources(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetIspCustomerResourcesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class EnterpriseMccCacheNodeResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected EnterpriseMccCacheNodeResource() { } + public virtual Azure.ResourceManager.ConnectedCache.EnterpriseMccCacheNodeResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCacheNodeAutoUpdateHistory(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCacheNodeAutoUpdateHistoryAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCacheNodeInstallDetails(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCacheNodeInstallDetailsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCacheNodeMccIssueDetailsHistory(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCacheNodeMccIssueDetailsHistoryAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCacheNodeTlsCertificateHistory(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCacheNodeTlsCertificateHistoryAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ConnectedCache.EnterpriseMccCacheNodeResourceData 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.ConnectedCache.EnterpriseMccCacheNodeResourceData 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.Response Update(Azure.ResourceManager.ConnectedCache.Models.ConnectedCachePatchContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.ConnectedCache.Models.ConnectedCachePatchContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class EnterpriseMccCacheNodeResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected EnterpriseMccCacheNodeResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string cacheNodeResourceName, Azure.ResourceManager.ConnectedCache.EnterpriseMccCacheNodeResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string cacheNodeResourceName, Azure.ResourceManager.ConnectedCache.EnterpriseMccCacheNodeResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string cacheNodeResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string cacheNodeResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string cacheNodeResourceName, 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 cacheNodeResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string cacheNodeResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string cacheNodeResourceName, 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 EnterpriseMccCacheNodeResourceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EnterpriseMccCacheNodeResourceData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.ConnectedCache.Models.CacheNodeProperty Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.EnterpriseMccCacheNodeResourceData 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.ConnectedCache.EnterpriseMccCacheNodeResourceData 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 EnterpriseMccCustomerResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected EnterpriseMccCustomerResource() { } + public virtual Azure.ResourceManager.ConnectedCache.EnterpriseMccCustomerResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string customerResourceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetEnterpriseMccCacheNodeResource(string cacheNodeResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetEnterpriseMccCacheNodeResourceAsync(string cacheNodeResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ConnectedCache.EnterpriseMccCacheNodeResourceCollection GetEnterpriseMccCacheNodeResources() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ConnectedCache.EnterpriseMccCustomerResourceData 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.ConnectedCache.EnterpriseMccCustomerResourceData 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.Response Update(Azure.ResourceManager.ConnectedCache.Models.ConnectedCachePatchContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.ConnectedCache.Models.ConnectedCachePatchContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class EnterpriseMccCustomerResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected EnterpriseMccCustomerResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string customerResourceName, Azure.ResourceManager.ConnectedCache.EnterpriseMccCustomerResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string customerResourceName, Azure.ResourceManager.ConnectedCache.EnterpriseMccCustomerResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string customerResourceName, 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 customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string customerResourceName, 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 EnterpriseMccCustomerResourceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EnterpriseMccCustomerResourceData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.ConnectedCache.Models.CustomerProperty Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.EnterpriseMccCustomerResourceData 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.ConnectedCache.EnterpriseMccCustomerResourceData 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 IspCacheNodeResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected IspCacheNodeResource() { } + public virtual Azure.ResourceManager.ConnectedCache.IspCacheNodeResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetBgpCidrs(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetBgpCidrsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCacheNodeAutoUpdateHistory(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCacheNodeAutoUpdateHistoryAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCacheNodeInstallDetails(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCacheNodeInstallDetailsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCacheNodeMccIssueDetailsHistory(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCacheNodeMccIssueDetailsHistoryAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ConnectedCache.IspCacheNodeResourceData 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.ConnectedCache.IspCacheNodeResourceData 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.Response Update(Azure.ResourceManager.ConnectedCache.Models.ConnectedCachePatchContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.ConnectedCache.Models.ConnectedCachePatchContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class IspCacheNodeResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected IspCacheNodeResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string cacheNodeResourceName, Azure.ResourceManager.ConnectedCache.IspCacheNodeResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string cacheNodeResourceName, Azure.ResourceManager.ConnectedCache.IspCacheNodeResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string cacheNodeResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string cacheNodeResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string cacheNodeResourceName, 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 cacheNodeResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string cacheNodeResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string cacheNodeResourceName, 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 IspCacheNodeResourceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IspCacheNodeResourceData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.ConnectedCache.Models.CacheNodeProperty Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.IspCacheNodeResourceData 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.ConnectedCache.IspCacheNodeResourceData 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 IspCustomerResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected IspCustomerResource() { } + public virtual Azure.ResourceManager.ConnectedCache.IspCustomerResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string customerResourceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetIspCacheNodeResource(string cacheNodeResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIspCacheNodeResourceAsync(string cacheNodeResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ConnectedCache.IspCacheNodeResourceCollection GetIspCacheNodeResources() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ConnectedCache.IspCustomerResourceData 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.ConnectedCache.IspCustomerResourceData 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.Response Update(Azure.ResourceManager.ConnectedCache.Models.ConnectedCachePatchContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.ConnectedCache.Models.ConnectedCachePatchContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class IspCustomerResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected IspCustomerResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string customerResourceName, Azure.ResourceManager.ConnectedCache.IspCustomerResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string customerResourceName, Azure.ResourceManager.ConnectedCache.IspCustomerResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string customerResourceName, 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 customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string customerResourceName, 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 IspCustomerResourceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IspCustomerResourceData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.ConnectedCache.Models.CustomerProperty Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.IspCustomerResourceData 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.ConnectedCache.IspCustomerResourceData 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.ConnectedCache.Mocking +{ + public partial class MockableConnectedCacheArmClient : Azure.ResourceManager.ArmResource + { + protected MockableConnectedCacheArmClient() { } + public virtual Azure.ResourceManager.ConnectedCache.EnterpriseMccCacheNodeResource GetEnterpriseMccCacheNodeResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ConnectedCache.EnterpriseMccCustomerResource GetEnterpriseMccCustomerResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ConnectedCache.IspCacheNodeResource GetIspCacheNodeResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ConnectedCache.IspCustomerResource GetIspCustomerResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableConnectedCacheResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableConnectedCacheResourceGroupResource() { } + public virtual Azure.Response GetEnterpriseMccCustomerResource(string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetEnterpriseMccCustomerResourceAsync(string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ConnectedCache.EnterpriseMccCustomerResourceCollection GetEnterpriseMccCustomerResources() { throw null; } + public virtual Azure.Response GetIspCustomerResource(string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIspCustomerResourceAsync(string customerResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ConnectedCache.IspCustomerResourceCollection GetIspCustomerResources() { throw null; } + } + public partial class MockableConnectedCacheSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableConnectedCacheSubscriptionResource() { } + public virtual Azure.Pageable GetEnterpriseMccCustomerResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetEnterpriseMccCustomerResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetIspCustomerResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetIspCustomerResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.ConnectedCache.Models +{ + public partial class AdditionalCacheNodeProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AdditionalCacheNodeProperties() { } + public int? AggregatedStatusCode { get { throw null; } } + public string AggregatedStatusDetails { get { throw null; } } + public string AggregatedStatusText { get { throw null; } } + public string AutoUpdateAppliedVersion { get { throw null; } } + public string AutoUpdateLastAppliedDetails { get { throw null; } } + public System.DateTimeOffset? AutoUpdateLastAppliedOn { get { throw null; } } + public string AutoUpdateLastAppliedState { get { throw null; } } + public System.DateTimeOffset? AutoUpdateLastTriggeredOn { get { throw null; } } + public System.DateTimeOffset? AutoUpdateNextAvailableOn { get { throw null; } } + public string AutoUpdateNextAvailableVersion { get { throw null; } } + public string AutoUpdateVersion { get { throw null; } set { } } + public string BgpAsnToIPAddressMapping { get { throw null; } set { } } + public System.Collections.Generic.IList CacheNodePropertiesDetailsIssuesList { get { throw null; } } + public int? CacheNodeState { get { throw null; } } + public string CacheNodeStateDetailedText { get { throw null; } } + public string CacheNodeStateShortText { get { throw null; } } + public int? CreationMethod { get { throw null; } set { } } + public Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeTlsCertificate CurrentTlsCertificate { get { throw null; } } + public System.Collections.Generic.IList DriveConfiguration { get { throw null; } } + public bool? IsProvisioned { get { throw null; } } + public Azure.ResourceManager.ConnectedCache.Models.ProxyRequired? IsProxyRequired { get { throw null; } set { } } + public int? IssuesCount { get { throw null; } } + public System.Collections.Generic.IReadOnlyList IssuesList { get { throw null; } } + public Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeAutoUpdateInfo LastAutoUpdateInfo { get { throw null; } } + public string OptionalProperty1 { get { throw null; } set { } } + public string OptionalProperty2 { get { throw null; } set { } } + public string OptionalProperty3 { get { throw null; } set { } } + public string OptionalProperty4 { get { throw null; } set { } } + public string OptionalProperty5 { get { throw null; } set { } } + public Azure.ResourceManager.ConnectedCache.Models.OSType? OSType { get { throw null; } set { } } + public string ProductVersion { get { throw null; } } + public string ProxyUri { get { throw null; } set { } } + public string TlsStatus { get { throw null; } } + public string UpdateInfoDetails { get { throw null; } set { } } + public System.DateTimeOffset? UpdateRequestedOn { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.AdditionalCacheNodeProperties 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.ConnectedCache.Models.AdditionalCacheNodeProperties 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 AdditionalCustomerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AdditionalCustomerProperties() { } + public string CustomerAsn { get { throw null; } set { } } + public float? CustomerAsnEstimatedEgressPeekGbps { get { throw null; } } + public string CustomerEmail { get { throw null; } set { } } + public System.DateTimeOffset? CustomerEntitlementExpiration { get { throw null; } set { } } + public string CustomerEntitlementSkuGuid { get { throw null; } set { } } + public string CustomerEntitlementSkuId { get { throw null; } set { } } + public string CustomerEntitlementSkuName { get { throw null; } set { } } + public string CustomerOrgName { get { throw null; } } + public float? CustomerPropertiesOverviewAverageEgressMbps { get { throw null; } } + public float? CustomerPropertiesOverviewAverageMissMbps { get { throw null; } } + public float? CustomerPropertiesOverviewCacheEfficiency { get { throw null; } } + public int? CustomerPropertiesOverviewCacheNodesHealthyCount { get { throw null; } } + public int? CustomerPropertiesOverviewCacheNodesUnhealthyCount { get { throw null; } } + public float? CustomerPropertiesOverviewEgressMbpsMax { get { throw null; } } + public System.DateTimeOffset? CustomerPropertiesOverviewEgressMbpsMaxOn { get { throw null; } } + public float? CustomerPropertiesOverviewMissMbpsMax { get { throw null; } } + public System.DateTimeOffset? CustomerPropertiesOverviewMissMbpsMaxOn { get { throw null; } } + public string CustomerTransitAsn { get { throw null; } set { } } + public Azure.ResourceManager.ConnectedCache.Models.CustomerTransitState? CustomerTransitState { get { throw null; } set { } } + public string OptionalProperty1 { get { throw null; } set { } } + public string OptionalProperty2 { get { throw null; } set { } } + public string OptionalProperty3 { get { throw null; } set { } } + public string OptionalProperty4 { get { throw null; } set { } } + public string OptionalProperty5 { get { throw null; } set { } } + public System.DateTimeOffset? PeeringDbLastUpdateDateValue { get { throw null; } } + public int? SignupPhaseStatusCode { get { throw null; } } + public string SignupPhaseStatusText { get { throw null; } } + public bool? SignupStatus { get { throw null; } } + public int? SignupStatusCode { get { throw null; } } + public string SignupStatusText { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.AdditionalCustomerProperties 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.ConnectedCache.Models.AdditionalCustomerProperties 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 static partial class ArmConnectedCacheModelFactory + { + public static Azure.ResourceManager.ConnectedCache.Models.AdditionalCacheNodeProperties AdditionalCacheNodeProperties(System.Collections.Generic.IEnumerable cacheNodePropertiesDetailsIssuesList = null, System.Collections.Generic.IEnumerable issuesList = null, int? issuesCount = default(int?), Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeTlsCertificate currentTlsCertificate = null, Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeAutoUpdateInfo lastAutoUpdateInfo = null, string aggregatedStatusDetails = null, string aggregatedStatusText = null, int? aggregatedStatusCode = default(int?), string productVersion = null, bool? isProvisioned = default(bool?), string cacheNodeStateDetailedText = null, string cacheNodeStateShortText = null, int? cacheNodeState = default(int?), System.Collections.Generic.IEnumerable driveConfiguration = null, string bgpAsnToIPAddressMapping = null, string proxyUri = null, Azure.ResourceManager.ConnectedCache.Models.ProxyRequired? isProxyRequired = default(Azure.ResourceManager.ConnectedCache.Models.ProxyRequired?), Azure.ResourceManager.ConnectedCache.Models.OSType? osType = default(Azure.ResourceManager.ConnectedCache.Models.OSType?), string autoUpdateVersion = null, string updateInfoDetails = null, System.DateTimeOffset? updateRequestedOn = default(System.DateTimeOffset?), string autoUpdateNextAvailableVersion = null, System.DateTimeOffset? autoUpdateNextAvailableOn = default(System.DateTimeOffset?), string autoUpdateAppliedVersion = null, string autoUpdateLastAppliedDetails = null, string autoUpdateLastAppliedState = null, System.DateTimeOffset? autoUpdateLastAppliedOn = default(System.DateTimeOffset?), System.DateTimeOffset? autoUpdateLastTriggeredOn = default(System.DateTimeOffset?), int? creationMethod = default(int?), string tlsStatus = null, string optionalProperty1 = null, string optionalProperty2 = null, string optionalProperty3 = null, string optionalProperty4 = null, string optionalProperty5 = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.AdditionalCustomerProperties AdditionalCustomerProperties(float? customerPropertiesOverviewCacheEfficiency = default(float?), float? customerPropertiesOverviewAverageEgressMbps = default(float?), float? customerPropertiesOverviewAverageMissMbps = default(float?), float? customerPropertiesOverviewEgressMbpsMax = default(float?), System.DateTimeOffset? customerPropertiesOverviewEgressMbpsMaxOn = default(System.DateTimeOffset?), float? customerPropertiesOverviewMissMbpsMax = default(float?), System.DateTimeOffset? customerPropertiesOverviewMissMbpsMaxOn = default(System.DateTimeOffset?), int? customerPropertiesOverviewCacheNodesHealthyCount = default(int?), int? customerPropertiesOverviewCacheNodesUnhealthyCount = default(int?), bool? signupStatus = default(bool?), int? signupStatusCode = default(int?), string signupStatusText = null, int? signupPhaseStatusCode = default(int?), string signupPhaseStatusText = null, System.DateTimeOffset? peeringDbLastUpdateDateValue = default(System.DateTimeOffset?), string customerOrgName = null, string customerEmail = null, string customerTransitAsn = null, Azure.ResourceManager.ConnectedCache.Models.CustomerTransitState? customerTransitState = default(Azure.ResourceManager.ConnectedCache.Models.CustomerTransitState?), string customerAsn = null, float? customerAsnEstimatedEgressPeekGbps = default(float?), string customerEntitlementSkuId = null, string customerEntitlementSkuGuid = null, string customerEntitlementSkuName = null, System.DateTimeOffset? customerEntitlementExpiration = default(System.DateTimeOffset?), string optionalProperty1 = null, string optionalProperty2 = null, string optionalProperty3 = null, string optionalProperty4 = null, string optionalProperty5 = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.CacheNodeEntity CacheNodeEntity(string fullyQualifiedResourceId = null, string customerId = null, string customerName = null, string ipAddress = null, string customerIndex = null, string cacheNodeId = null, string cacheNodeName = null, int? customerAsn = default(int?), bool? isEnabled = default(bool?), int? maxAllowableEgressInMbps = default(int?), float? maxAllowableProbability = default(float?), string xCid = null, bool? isEnterpriseManaged = default(bool?), string createAsyncOperationId = null, string deleteAsyncOperationId = null, string clientTenantId = null, string category = null, int? releaseVersion = default(int?), System.DateTimeOffset? lastSyncWithAzureTimestamp = default(System.DateTimeOffset?), System.DateTimeOffset? lastUpdatedTimestamp = default(System.DateTimeOffset?), int? synchWithAzureAttemptsCount = default(int?), string containerConfigurations = null, System.Collections.Generic.IEnumerable cidrCsv = null, System.DateTimeOffset? cidrCsvLastUpdateOn = default(System.DateTimeOffset?), System.DateTimeOffset? bgpCidrCsvLastUpdateOn = default(System.DateTimeOffset?), System.DateTimeOffset? bgpLastReportedOn = default(System.DateTimeOffset?), string bgpReviewStateText = null, Azure.ResourceManager.ConnectedCache.Models.BgpReviewStateEnum? bgpReviewState = default(Azure.ResourceManager.ConnectedCache.Models.BgpReviewStateEnum?), string bgpReviewFeedback = null, int? bgpNumberOfTimesUpdated = default(int?), int? bgpNumberOfRecords = default(int?), int? bgpCidrBlocksCount = default(int?), int? bgpAddressSpace = default(int?), bool? shouldMigrate = default(bool?), int? bgpFileBytesTruncated = default(int?), int? cidrSelectionType = default(int?), bool? isFrozen = default(bool?), int? reviewState = default(int?), string reviewStateText = null, string reviewFeedback = null, Azure.ResourceManager.ConnectedCache.Models.ConfigurationState? configurationState = default(Azure.ResourceManager.ConnectedCache.Models.ConfigurationState?), string configurationStateText = null, int? addressSpace = default(int?), int? workerConnections = default(int?), System.DateTimeOffset? workerConnectionsLastUpdatedOn = default(System.DateTimeOffset?), int? containerResyncTrigger = default(int?), string imageUri = null, string fullyQualifiedDomainName = null, Azure.ResourceManager.ConnectedCache.Models.AutoUpdateRingType? autoUpdateRingType = default(Azure.ResourceManager.ConnectedCache.Models.AutoUpdateRingType?), int? autoUpdateRequestedWeek = default(int?), int? autoUpdateRequestedDay = default(int?), string autoUpdateRequestedTime = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.CacheNodeInstallProperties CacheNodeInstallProperties(string customerId = null, string cacheNodeId = null, string primaryAccountKey = null, string secondaryAccountKey = null, string registrationKey = null, string tlsCertificateProvisioningKey = null, System.Collections.Generic.IEnumerable driveConfiguration = null, string proxyUri = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.CacheNodeProperty CacheNodeProperty(Azure.ResourceManager.ConnectedCache.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ConnectedCache.Models.ProvisioningState?), Azure.ResourceManager.ConnectedCache.Models.CacheNodeEntity cacheNode = null, Azure.ResourceManager.ConnectedCache.Models.AdditionalCacheNodeProperties additionalCacheNodeProperties = null, string statusCode = null, string statusText = null, string statusDetails = null, string status = null, Azure.ResponseError error = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.CustomerEntity CustomerEntity(string fullyQualifiedResourceId = null, string customerId = null, string customerName = null, string contactEmail = null, string contactPhone = null, string contactName = null, bool? isEntitled = default(bool?), int? releaseVersion = default(int?), string createAsyncOperationId = null, string deleteAsyncOperationId = null, string clientTenantId = null, int? synchWithAzureAttemptsCount = default(int?), System.DateTimeOffset? lastSyncWithAzureTimestamp = default(System.DateTimeOffset?), bool? isEnterpriseManaged = default(bool?), bool? shouldMigrate = default(bool?), bool? resendSignupCode = default(bool?), bool? verifySignupCode = default(bool?), string verifySignupPhrase = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.CustomerProperty CustomerProperty(Azure.ResourceManager.ConnectedCache.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ConnectedCache.Models.ProvisioningState?), Azure.ResourceManager.ConnectedCache.Models.CustomerEntity customer = null, Azure.ResourceManager.ConnectedCache.Models.AdditionalCustomerProperties additionalCustomerProperties = null, string statusCode = null, string statusText = null, string statusDetails = null, string status = null, Azure.ResponseError error = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.EnterpriseMccCacheNodeResourceData EnterpriseMccCacheNodeResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ConnectedCache.Models.CacheNodeProperty properties = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.EnterpriseMccCustomerResourceData EnterpriseMccCustomerResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ConnectedCache.Models.CustomerProperty properties = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.IspCacheNodeResourceData IspCacheNodeResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ConnectedCache.Models.CacheNodeProperty properties = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.IspCustomerResourceData IspCustomerResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ConnectedCache.Models.CustomerProperty properties = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeAutoUpdateHistory MccCacheNodeAutoUpdateHistory(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeAutoUpdateHistoryProperties properties = null, System.Collections.Generic.IReadOnlyDictionary tags = null, string location = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeAutoUpdateHistoryProperties MccCacheNodeAutoUpdateHistoryProperties(string customerId = null, string cacheNodeId = null, System.Collections.Generic.IEnumerable autoUpdateHistory = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeAutoUpdateInfo MccCacheNodeAutoUpdateInfo(string imageUriBeforeUpdate = null, string imageUriTargeted = null, string imageUriTerminal = null, int? autoUpdateRingType = default(int?), System.DateTimeOffset? movedToTerminalStateOn = default(System.DateTimeOffset?), int? ruleRequestedWeek = default(int?), int? ruleRequestedDay = default(int?), System.DateTimeOffset? createdDateTimeUtc = default(System.DateTimeOffset?), System.DateTimeOffset? updatedRegistryDateTimeUtc = default(System.DateTimeOffset?), string planChangeLogText = null, int? autoUpdateLastAppliedStatus = default(int?), string autoUpdateLastAppliedStatusText = null, string autoUpdateLastAppliedStatusDetailedText = null, long? planId = default(long?), string timeToGoLiveDateTime = null, string ruleRequestedMinute = null, string ruleRequestedHour = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeBgpCidrDetails MccCacheNodeBgpCidrDetails(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable bgpCidrs = null, System.Collections.Generic.IReadOnlyDictionary tags = null, string location = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeInstallDetails MccCacheNodeInstallDetails(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ConnectedCache.Models.CacheNodeInstallProperties properties = null, System.Collections.Generic.IReadOnlyDictionary tags = null, string location = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeIssueHistory MccCacheNodeIssueHistory(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeIssueHistoryProperties properties = null, System.Collections.Generic.IReadOnlyDictionary tags = null, string location = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeIssueHistoryProperties MccCacheNodeIssueHistoryProperties(string customerId = null, string cacheNodeId = null, System.Collections.Generic.IEnumerable mccIssueHistory = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeTlsCertificate MccCacheNodeTlsCertificate(string actionRequired = null, string certificateFileName = null, string thumbprint = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), System.DateTimeOffset? notBeforeOn = default(System.DateTimeOffset?), string subject = null, string subjectAltName = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeTlsCertificateHistory MccCacheNodeTlsCertificateHistory(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeTlsCertificateProperties properties = null, System.Collections.Generic.IReadOnlyDictionary tags = null, string location = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeTlsCertificateProperties MccCacheNodeTlsCertificateProperties(string customerId = null, string cacheNodeId = null, System.Collections.Generic.IEnumerable tlsCertificateHistory = null) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.MccIssue MccIssue(string mccIssueType = null, string toastString = null, string detailString = null, string helpLink = null, System.DateTimeOffset? issueStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? issueEndOn = default(System.DateTimeOffset?)) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AutoUpdateRingType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AutoUpdateRingType(string value) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.AutoUpdateRingType Fast { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.AutoUpdateRingType Preview { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.AutoUpdateRingType Slow { get { throw null; } } + public bool Equals(Azure.ResourceManager.ConnectedCache.Models.AutoUpdateRingType 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.ConnectedCache.Models.AutoUpdateRingType left, Azure.ResourceManager.ConnectedCache.Models.AutoUpdateRingType right) { throw null; } + public static implicit operator Azure.ResourceManager.ConnectedCache.Models.AutoUpdateRingType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ConnectedCache.Models.AutoUpdateRingType left, Azure.ResourceManager.ConnectedCache.Models.AutoUpdateRingType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BgpReviewStateEnum : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BgpReviewStateEnum(string value) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.BgpReviewStateEnum Approved { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.BgpReviewStateEnum AttentionRequired { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.BgpReviewStateEnum InReview { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.BgpReviewStateEnum NotConfigured { get { throw null; } } + public bool Equals(Azure.ResourceManager.ConnectedCache.Models.BgpReviewStateEnum 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.ConnectedCache.Models.BgpReviewStateEnum left, Azure.ResourceManager.ConnectedCache.Models.BgpReviewStateEnum right) { throw null; } + public static implicit operator Azure.ResourceManager.ConnectedCache.Models.BgpReviewStateEnum (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ConnectedCache.Models.BgpReviewStateEnum left, Azure.ResourceManager.ConnectedCache.Models.BgpReviewStateEnum right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CacheNodeDriveConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CacheNodeDriveConfiguration() { } + public int? CacheNumber { get { throw null; } set { } } + public string NginxMapping { get { throw null; } set { } } + public string PhysicalPath { get { throw null; } set { } } + public int? SizeInGb { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.CacheNodeDriveConfiguration 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.ConnectedCache.Models.CacheNodeDriveConfiguration 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 CacheNodeEntity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CacheNodeEntity() { } + public int? AddressSpace { get { throw null; } } + public int? AutoUpdateRequestedDay { get { throw null; } set { } } + public string AutoUpdateRequestedTime { get { throw null; } set { } } + public int? AutoUpdateRequestedWeek { get { throw null; } set { } } + public Azure.ResourceManager.ConnectedCache.Models.AutoUpdateRingType? AutoUpdateRingType { get { throw null; } set { } } + public int? BgpAddressSpace { get { throw null; } } + public int? BgpCidrBlocksCount { get { throw null; } } + public System.DateTimeOffset? BgpCidrCsvLastUpdateOn { get { throw null; } } + public int? BgpFileBytesTruncated { get { throw null; } } + public System.DateTimeOffset? BgpLastReportedOn { get { throw null; } } + public int? BgpNumberOfRecords { get { throw null; } } + public int? BgpNumberOfTimesUpdated { get { throw null; } } + public string BgpReviewFeedback { get { throw null; } } + public Azure.ResourceManager.ConnectedCache.Models.BgpReviewStateEnum? BgpReviewState { get { throw null; } } + public string BgpReviewStateText { get { throw null; } } + public string CacheNodeId { get { throw null; } set { } } + public string CacheNodeName { get { throw null; } set { } } + public string Category { get { throw null; } } + public System.Collections.Generic.IList CidrCsv { get { throw null; } } + public System.DateTimeOffset? CidrCsvLastUpdateOn { get { throw null; } } + public int? CidrSelectionType { get { throw null; } set { } } + public string ClientTenantId { get { throw null; } } + public Azure.ResourceManager.ConnectedCache.Models.ConfigurationState? ConfigurationState { get { throw null; } } + public string ConfigurationStateText { get { throw null; } } + public string ContainerConfigurations { get { throw null; } } + public int? ContainerResyncTrigger { get { throw null; } } + public string CreateAsyncOperationId { get { throw null; } } + public int? CustomerAsn { get { throw null; } set { } } + public string CustomerId { get { throw null; } } + public string CustomerIndex { get { throw null; } set { } } + public string CustomerName { get { throw null; } set { } } + public string DeleteAsyncOperationId { get { throw null; } } + public string FullyQualifiedDomainName { get { throw null; } set { } } + public string FullyQualifiedResourceId { get { throw null; } set { } } + public string ImageUri { get { throw null; } } + public string IPAddress { get { throw null; } set { } } + public bool? IsEnabled { get { throw null; } set { } } + public bool? IsEnterpriseManaged { get { throw null; } set { } } + public bool? IsFrozen { get { throw null; } } + public System.DateTimeOffset? LastSyncWithAzureTimestamp { get { throw null; } } + public System.DateTimeOffset? LastUpdatedTimestamp { get { throw null; } } + public int? MaxAllowableEgressInMbps { get { throw null; } set { } } + public float? MaxAllowableProbability { get { throw null; } } + public int? ReleaseVersion { get { throw null; } } + public string ReviewFeedback { get { throw null; } } + public int? ReviewState { get { throw null; } } + public string ReviewStateText { get { throw null; } } + public bool? ShouldMigrate { get { throw null; } set { } } + public int? SynchWithAzureAttemptsCount { get { throw null; } } + public int? WorkerConnections { get { throw null; } } + public System.DateTimeOffset? WorkerConnectionsLastUpdatedOn { get { throw null; } } + public string XCid { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.CacheNodeEntity 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.ConnectedCache.Models.CacheNodeEntity 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 CacheNodeInstallProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CacheNodeInstallProperties() { } + public string CacheNodeId { get { throw null; } } + public string CustomerId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList DriveConfiguration { get { throw null; } } + public string PrimaryAccountKey { get { throw null; } } + public string ProxyUri { get { throw null; } } + public string RegistrationKey { get { throw null; } } + public string SecondaryAccountKey { get { throw null; } } + public string TlsCertificateProvisioningKey { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.CacheNodeInstallProperties 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.ConnectedCache.Models.CacheNodeInstallProperties 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 CacheNodeProperty : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CacheNodeProperty() { } + public Azure.ResourceManager.ConnectedCache.Models.AdditionalCacheNodeProperties AdditionalCacheNodeProperties { get { throw null; } set { } } + public Azure.ResourceManager.ConnectedCache.Models.CacheNodeEntity CacheNode { get { throw null; } set { } } + public Azure.ResponseError Error { get { throw null; } set { } } + public Azure.ResourceManager.ConnectedCache.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string Status { get { throw null; } } + public string StatusCode { get { throw null; } set { } } + public string StatusDetails { get { throw null; } set { } } + public string StatusText { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.CacheNodeProperty 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.ConnectedCache.Models.CacheNodeProperty 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 ConfigurationState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConfigurationState(string value) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.ConfigurationState Configured { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.ConfigurationState NotConfiguredIP { get { throw null; } } + public bool Equals(Azure.ResourceManager.ConnectedCache.Models.ConfigurationState 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.ConnectedCache.Models.ConfigurationState left, Azure.ResourceManager.ConnectedCache.Models.ConfigurationState right) { throw null; } + public static implicit operator Azure.ResourceManager.ConnectedCache.Models.ConfigurationState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ConnectedCache.Models.ConfigurationState left, Azure.ResourceManager.ConnectedCache.Models.ConfigurationState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ConnectedCachePatchContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedCachePatchContent() { } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.ConnectedCachePatchContent 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.ConnectedCache.Models.ConnectedCachePatchContent 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 CustomerEntity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CustomerEntity() { } + public string ClientTenantId { get { throw null; } set { } } + public string ContactEmail { get { throw null; } set { } } + public string ContactName { get { throw null; } set { } } + public string ContactPhone { get { throw null; } set { } } + public string CreateAsyncOperationId { get { throw null; } } + public string CustomerId { get { throw null; } } + public string CustomerName { get { throw null; } set { } } + public string DeleteAsyncOperationId { get { throw null; } } + public string FullyQualifiedResourceId { get { throw null; } set { } } + public bool? IsEnterpriseManaged { get { throw null; } set { } } + public bool? IsEntitled { get { throw null; } set { } } + public System.DateTimeOffset? LastSyncWithAzureTimestamp { get { throw null; } } + public int? ReleaseVersion { get { throw null; } set { } } + public bool? ResendSignupCode { get { throw null; } set { } } + public bool? ShouldMigrate { get { throw null; } set { } } + public int? SynchWithAzureAttemptsCount { get { throw null; } } + public bool? VerifySignupCode { get { throw null; } set { } } + public string VerifySignupPhrase { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.CustomerEntity 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.ConnectedCache.Models.CustomerEntity 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 CustomerProperty : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CustomerProperty() { } + public Azure.ResourceManager.ConnectedCache.Models.AdditionalCustomerProperties AdditionalCustomerProperties { get { throw null; } set { } } + public Azure.ResourceManager.ConnectedCache.Models.CustomerEntity Customer { get { throw null; } set { } } + public Azure.ResponseError Error { get { throw null; } } + public Azure.ResourceManager.ConnectedCache.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string Status { get { throw null; } } + public string StatusCode { get { throw null; } } + public string StatusDetails { get { throw null; } } + public string StatusText { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.CustomerProperty 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.ConnectedCache.Models.CustomerProperty 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 CustomerTransitState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CustomerTransitState(string value) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.CustomerTransitState CombinedTransit { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.CustomerTransitState NoTransit { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.CustomerTransitState TransitOnly { get { throw null; } } + public bool Equals(Azure.ResourceManager.ConnectedCache.Models.CustomerTransitState 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.ConnectedCache.Models.CustomerTransitState left, Azure.ResourceManager.ConnectedCache.Models.CustomerTransitState right) { throw null; } + public static implicit operator Azure.ResourceManager.ConnectedCache.Models.CustomerTransitState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ConnectedCache.Models.CustomerTransitState left, Azure.ResourceManager.ConnectedCache.Models.CustomerTransitState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MccCacheNodeAutoUpdateHistory : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MccCacheNodeAutoUpdateHistory() { } + public string Location { get { throw null; } } + public Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeAutoUpdateHistoryProperties Properties { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeAutoUpdateHistory 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.ConnectedCache.Models.MccCacheNodeAutoUpdateHistory 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 MccCacheNodeAutoUpdateHistoryProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MccCacheNodeAutoUpdateHistoryProperties() { } + public System.Collections.Generic.IReadOnlyList AutoUpdateHistory { get { throw null; } } + public string CacheNodeId { get { throw null; } } + public string CustomerId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeAutoUpdateHistoryProperties 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.ConnectedCache.Models.MccCacheNodeAutoUpdateHistoryProperties 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 MccCacheNodeAutoUpdateInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MccCacheNodeAutoUpdateInfo() { } + public int? AutoUpdateLastAppliedStatus { get { throw null; } } + public string AutoUpdateLastAppliedStatusDetailedText { get { throw null; } } + public string AutoUpdateLastAppliedStatusText { get { throw null; } } + public int? AutoUpdateRingType { get { throw null; } } + public System.DateTimeOffset? CreatedDateTimeUtc { get { throw null; } } + public string ImageUriBeforeUpdate { get { throw null; } } + public string ImageUriTargeted { get { throw null; } } + public string ImageUriTerminal { get { throw null; } } + public System.DateTimeOffset? MovedToTerminalStateOn { get { throw null; } } + public string PlanChangeLogText { get { throw null; } } + public long? PlanId { get { throw null; } } + public int? RuleRequestedDay { get { throw null; } } + public string RuleRequestedHour { get { throw null; } } + public string RuleRequestedMinute { get { throw null; } } + public int? RuleRequestedWeek { get { throw null; } } + public string TimeToGoLiveDateTime { get { throw null; } } + public System.DateTimeOffset? UpdatedRegistryDateTimeUtc { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeAutoUpdateInfo 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.ConnectedCache.Models.MccCacheNodeAutoUpdateInfo 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 MccCacheNodeBgpCidrDetails : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MccCacheNodeBgpCidrDetails() { } + public System.Collections.Generic.IReadOnlyList BgpCidrs { get { throw null; } } + public string Location { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeBgpCidrDetails 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.ConnectedCache.Models.MccCacheNodeBgpCidrDetails 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 MccCacheNodeInstallDetails : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MccCacheNodeInstallDetails() { } + public string Location { get { throw null; } } + public Azure.ResourceManager.ConnectedCache.Models.CacheNodeInstallProperties Properties { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeInstallDetails 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.ConnectedCache.Models.MccCacheNodeInstallDetails 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 MccCacheNodeIssueHistory : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MccCacheNodeIssueHistory() { } + public string Location { get { throw null; } } + public Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeIssueHistoryProperties Properties { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeIssueHistory 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.ConnectedCache.Models.MccCacheNodeIssueHistory 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 MccCacheNodeIssueHistoryProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MccCacheNodeIssueHistoryProperties() { } + public string CacheNodeId { get { throw null; } } + public string CustomerId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList MccIssueHistory { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeIssueHistoryProperties 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.ConnectedCache.Models.MccCacheNodeIssueHistoryProperties 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 MccCacheNodeTlsCertificate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MccCacheNodeTlsCertificate() { } + public string ActionRequired { get { throw null; } } + public string CertificateFileName { get { throw null; } } + public System.DateTimeOffset? ExpiryOn { get { throw null; } } + public System.DateTimeOffset? NotBeforeOn { get { throw null; } } + public string Subject { get { throw null; } } + public string SubjectAltName { get { throw null; } } + public string Thumbprint { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeTlsCertificate 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.ConnectedCache.Models.MccCacheNodeTlsCertificate 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 MccCacheNodeTlsCertificateHistory : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MccCacheNodeTlsCertificateHistory() { } + public string Location { get { throw null; } } + public Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeTlsCertificateProperties Properties { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeTlsCertificateHistory 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.ConnectedCache.Models.MccCacheNodeTlsCertificateHistory 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 MccCacheNodeTlsCertificateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MccCacheNodeTlsCertificateProperties() { } + public string CacheNodeId { get { throw null; } } + public string CustomerId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList TlsCertificateHistory { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.MccCacheNodeTlsCertificateProperties 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.ConnectedCache.Models.MccCacheNodeTlsCertificateProperties 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 MccIssue : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MccIssue() { } + public string DetailString { get { throw null; } } + public string HelpLink { get { throw null; } } + public System.DateTimeOffset? IssueEndOn { get { throw null; } } + public System.DateTimeOffset? IssueStartOn { get { throw null; } } + public string MccIssueType { get { throw null; } } + public string ToastString { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ConnectedCache.Models.MccIssue 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.ConnectedCache.Models.MccIssue 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 OSType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public OSType(string value) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.OSType Eflow { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.OSType Linux { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.OSType Windows { get { throw null; } } + public bool Equals(Azure.ResourceManager.ConnectedCache.Models.OSType 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.ConnectedCache.Models.OSType left, Azure.ResourceManager.ConnectedCache.Models.OSType right) { throw null; } + public static implicit operator Azure.ResourceManager.ConnectedCache.Models.OSType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ConnectedCache.Models.OSType left, Azure.ResourceManager.ConnectedCache.Models.OSType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.ProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.ProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.ProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.ProvisioningState Unknown { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.ProvisioningState Upgrading { get { throw null; } } + public bool Equals(Azure.ResourceManager.ConnectedCache.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.ConnectedCache.Models.ProvisioningState left, Azure.ResourceManager.ConnectedCache.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.ConnectedCache.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ConnectedCache.Models.ProvisioningState left, Azure.ResourceManager.ConnectedCache.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProxyRequired : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProxyRequired(string value) { throw null; } + public static Azure.ResourceManager.ConnectedCache.Models.ProxyRequired None { get { throw null; } } + public static Azure.ResourceManager.ConnectedCache.Models.ProxyRequired Required { get { throw null; } } + public bool Equals(Azure.ResourceManager.ConnectedCache.Models.ProxyRequired 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.ConnectedCache.Models.ProxyRequired left, Azure.ResourceManager.ConnectedCache.Models.ProxyRequired right) { throw null; } + public static implicit operator Azure.ResourceManager.ConnectedCache.Models.ProxyRequired (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ConnectedCache.Models.ProxyRequired left, Azure.ResourceManager.ConnectedCache.Models.ProxyRequired right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/assets.json b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/assets.json new file mode 100644 index 000000000000..fbf1e22c49de --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/connectedcache/Azure.ResourceManager.ConnectedCache", + "Tag": "" +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Azure.ResourceManager.ConnectedCache.Samples.csproj b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Azure.ResourceManager.ConnectedCache.Samples.csproj new file mode 100644 index 000000000000..dc262bb35410 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Azure.ResourceManager.ConnectedCache.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_EnterpriseMccCacheNodeResource.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_EnterpriseMccCacheNodeResource.cs new file mode 100644 index 000000000000..f52a1f8716c1 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_EnterpriseMccCacheNodeResource.cs @@ -0,0 +1,223 @@ +// 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.ConnectedCache.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ConnectedCache.Samples +{ + public partial class Sample_EnterpriseMccCacheNodeResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsEnterpriseMccCacheNodeResourceInformationOfAnEnterpriseMccCustomerParentResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-11-30-preview/EnterpriseMccCacheNodesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EnterpriseMccCacheNodeResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EnterpriseMccCacheNodeResource created on azure + // for more information of creating EnterpriseMccCacheNodeResource, please refer to the document of EnterpriseMccCacheNodeResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "cygqjgtcetihsajgyqwwrbclssqsvhgltrboemcqqtpoxdbhykqxblaihmrumyhbsx"; + string cacheNodeResourceName = "fqxfadsultwjfzdwlqkvneakfsbyhratytmssmiukpbnus"; + ResourceIdentifier enterpriseMccCacheNodeResourceId = EnterpriseMccCacheNodeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + EnterpriseMccCacheNodeResource enterpriseMccCacheNodeResource = client.GetEnterpriseMccCacheNodeResource(enterpriseMccCacheNodeResourceId); + + // invoke the operation + EnterpriseMccCacheNodeResource result = await enterpriseMccCacheNodeResource.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 + EnterpriseMccCacheNodeResourceData 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_EnterpriseMccCacheNodesOperationsDeleteOperationGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-11-30-preview/EnterpriseMccCacheNodesOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "EnterpriseMccCacheNodeResource_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 EnterpriseMccCacheNodeResource created on azure + // for more information of creating EnterpriseMccCacheNodeResource, please refer to the document of EnterpriseMccCacheNodeResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "hsincngmssuzeyispnufqwinpopadvhsbsemisguxgovwdjwviqexocelijvuyr"; + string cacheNodeResourceName = "vwtrhdoxvkrunpliwcao"; + ResourceIdentifier enterpriseMccCacheNodeResourceId = EnterpriseMccCacheNodeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + EnterpriseMccCacheNodeResource enterpriseMccCacheNodeResource = client.GetEnterpriseMccCacheNodeResource(enterpriseMccCacheNodeResourceId); + + // invoke the operation + await enterpriseMccCacheNodeResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_EnterpriseMccCacheNodesOperationsUpdateGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-11-30-preview/EnterpriseMccCacheNodesOperations_Update_MaximumSet_Gen.json + // this example is just showing the usage of "EnterpriseMccCacheNodeResource_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 EnterpriseMccCacheNodeResource created on azure + // for more information of creating EnterpriseMccCacheNodeResource, please refer to the document of EnterpriseMccCacheNodeResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "qanjqtvrxzjkljdysdjvdiqcxkttskpdzykzuefhbhz"; + string cacheNodeResourceName = "kllmlvazrcxmfjfozulzqnsgvspgwmhogcafvauchunlgfr"; + ResourceIdentifier enterpriseMccCacheNodeResourceId = EnterpriseMccCacheNodeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + EnterpriseMccCacheNodeResource enterpriseMccCacheNodeResource = client.GetEnterpriseMccCacheNodeResource(enterpriseMccCacheNodeResourceId); + + // invoke the operation + ConnectedCachePatchContent content = new ConnectedCachePatchContent + { + Tags = +{ +["key1653"] = "nzjczrhclhkndesgy" +}, + }; + EnterpriseMccCacheNodeResource result = await enterpriseMccCacheNodeResource.UpdateAsync(content); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EnterpriseMccCacheNodeResourceData 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 GetCacheNodeInstallDetails_GetsRequiredPropertiesForEnterpriseMccCacheNodeResourceInstallKeyDetailsGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-11-30-preview/EnterpriseMccCacheNodesOperations_GetCacheNodeInstallDetails_MaximumSet_Gen.json + // this example is just showing the usage of "EnterpriseMccCacheNodesOperations_GetCacheNodeInstallDetails" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EnterpriseMccCacheNodeResource created on azure + // for more information of creating EnterpriseMccCacheNodeResource, please refer to the document of EnterpriseMccCacheNodeResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "fzwxcjmdpxxzayecabqqlh"; + string cacheNodeResourceName = "ccexmqqttritxvtctivraso"; + ResourceIdentifier enterpriseMccCacheNodeResourceId = EnterpriseMccCacheNodeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + EnterpriseMccCacheNodeResource enterpriseMccCacheNodeResource = client.GetEnterpriseMccCacheNodeResource(enterpriseMccCacheNodeResourceId); + + // invoke the operation + MccCacheNodeInstallDetails result = await enterpriseMccCacheNodeResource.GetCacheNodeInstallDetailsAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetCacheNodeAutoUpdateHistory_EnterpriseMccCacheNodesOperationsGetCacheNodeAutoUpdateHistoryMaximumSet() + { + // Generated from example definition: 2024-11-30-preview/EnterpriseMccCacheNodesOperations_GetCacheNodeAutoUpdateHistory_MaximumSet_Gen.json + // this example is just showing the usage of "EnterpriseMccCacheNodesOperations_GetCacheNodeAutoUpdateHistory" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EnterpriseMccCacheNodeResource created on azure + // for more information of creating EnterpriseMccCacheNodeResource, please refer to the document of EnterpriseMccCacheNodeResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "MccRPTest1"; + string cacheNodeResourceName = "MCCCachenode1"; + ResourceIdentifier enterpriseMccCacheNodeResourceId = EnterpriseMccCacheNodeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + EnterpriseMccCacheNodeResource enterpriseMccCacheNodeResource = client.GetEnterpriseMccCacheNodeResource(enterpriseMccCacheNodeResourceId); + + // invoke the operation + MccCacheNodeAutoUpdateHistory result = await enterpriseMccCacheNodeResource.GetCacheNodeAutoUpdateHistoryAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetCacheNodeMccIssueDetailsHistory_EnterpriseMccCacheNodesOperationsGetCacheNodeMccIssueDetailsHistoryMaximumSet() + { + // Generated from example definition: 2024-11-30-preview/EnterpriseMccCacheNodesOperations_GetCacheNodeMccIssueDetailsHistory_MaximumSet_Gen.json + // this example is just showing the usage of "EnterpriseMccCacheNodesOperations_GetCacheNodeMccIssueDetailsHistory" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EnterpriseMccCacheNodeResource created on azure + // for more information of creating EnterpriseMccCacheNodeResource, please refer to the document of EnterpriseMccCacheNodeResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "MccRPTest1"; + string cacheNodeResourceName = "MCCCachenode1"; + ResourceIdentifier enterpriseMccCacheNodeResourceId = EnterpriseMccCacheNodeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + EnterpriseMccCacheNodeResource enterpriseMccCacheNodeResource = client.GetEnterpriseMccCacheNodeResource(enterpriseMccCacheNodeResourceId); + + // invoke the operation + MccCacheNodeIssueHistory result = await enterpriseMccCacheNodeResource.GetCacheNodeMccIssueDetailsHistoryAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetCacheNodeTlsCertificateHistory_EnterpriseMccCacheNodesOperationsGetCacheNodeTlsCertificateHistoryMaximumSet() + { + // Generated from example definition: 2024-11-30-preview/EnterpriseMccCacheNodesOperations_GetCacheNodeTlsCertificateHistory_MaximumSet_Gen.json + // this example is just showing the usage of "EnterpriseMccCacheNodesOperations_GetCacheNodeTlsCertificateHistory" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EnterpriseMccCacheNodeResource created on azure + // for more information of creating EnterpriseMccCacheNodeResource, please refer to the document of EnterpriseMccCacheNodeResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "MccRPTest1"; + string cacheNodeResourceName = "MCCCachenode1"; + ResourceIdentifier enterpriseMccCacheNodeResourceId = EnterpriseMccCacheNodeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + EnterpriseMccCacheNodeResource enterpriseMccCacheNodeResource = client.GetEnterpriseMccCacheNodeResource(enterpriseMccCacheNodeResourceId); + + // invoke the operation + MccCacheNodeTlsCertificateHistory result = await enterpriseMccCacheNodeResource.GetCacheNodeTlsCertificateHistoryAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_EnterpriseMccCacheNodeResourceCollection.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_EnterpriseMccCacheNodeResourceCollection.cs new file mode 100644 index 000000000000..d1e1c00d50f1 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_EnterpriseMccCacheNodeResourceCollection.cs @@ -0,0 +1,244 @@ +// 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.ConnectedCache.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ConnectedCache.Samples +{ + public partial class Sample_EnterpriseMccCacheNodeResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreatesAnEnterpriseMccCacheNodeResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-11-30-preview/EnterpriseMccCacheNodesOperations_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "EnterpriseMccCacheNodeResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EnterpriseMccCustomerResource created on azure + // for more information of creating EnterpriseMccCustomerResource, please refer to the document of EnterpriseMccCustomerResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "nhdkvstdrrtsxxuz"; + ResourceIdentifier enterpriseMccCustomerResourceId = EnterpriseMccCustomerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName); + EnterpriseMccCustomerResource enterpriseMccCustomerResource = client.GetEnterpriseMccCustomerResource(enterpriseMccCustomerResourceId); + + // get the collection of this EnterpriseMccCacheNodeResource + EnterpriseMccCacheNodeResourceCollection collection = enterpriseMccCustomerResource.GetEnterpriseMccCacheNodeResources(); + + // invoke the operation + string cacheNodeResourceName = "fgduqdovidpemlnmhelomffuafdrbgaasqznvrdkbvspfzsnrhncdtqquhijhdpwyzwleukqldpceyxqhqlftqrr"; + EnterpriseMccCacheNodeResourceData data = new EnterpriseMccCacheNodeResourceData(new AzureLocation("westus")) + { + Properties = new CacheNodeProperty + { + CacheNode = new CacheNodeEntity + { + FullyQualifiedResourceId = "yeinlleavzbehelhsucb", + CustomerName = "zsklcocjfjhkcpmzyefzkwamdzc", + IPAddress = "gbfkdhloyphnpnhemwrcrxlk", + CustomerIndex = "vafvezmelfgmjsrccjukrhppljvipg", + CacheNodeId = "fmrjefyddfn", + CacheNodeName = "qppvqxliajjfoalzjbgmxggr", + CustomerAsn = 25, + IsEnabled = true, + MaxAllowableEgressInMbps = 27, + IsEnterpriseManaged = true, + CidrCsv = { "nlqlvrthafvvljuupcbcw" }, + ShouldMigrate = true, + CidrSelectionType = 11, + }, + AdditionalCacheNodeProperties = new AdditionalCacheNodeProperties + { + CacheNodePropertiesDetailsIssuesList = { "ennbzfpuszgalzpawmwicaofqcwcj" }, + DriveConfiguration = {new CacheNodeDriveConfiguration +{ +PhysicalPath = "pcbkezoofhamkycot", +SizeInGb = 14, +CacheNumber = 11, +NginxMapping = "cirlpkpuxg", +}}, + BgpAsnToIPAddressMapping = "fjbggfvumrn", + ProxyUri = "hplstyg", + OptionalProperty1 = "ph", + OptionalProperty2 = "soqqgpgcbhb", + OptionalProperty3 = "fpnycrbagptsujiotnjfuhlm", + OptionalProperty4 = "gesqugrxvhxlxxyvatgrautxwlmxsf", + OptionalProperty5 = "zknjgzpaqtvdqjydd", + }, + StatusCode = "1", + StatusText = "Success", + StatusDetails = "lgljxmyyoakw", + Error = new ResponseError(null, null), + }, + Tags = +{ +["key259"] = "qbkixjuyjkoj" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, cacheNodeResourceName, data); + EnterpriseMccCacheNodeResource 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 + EnterpriseMccCacheNodeResourceData 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_GetsEnterpriseMccCacheNodeResourceInformationOfAnEnterpriseMccCustomerParentResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-11-30-preview/EnterpriseMccCacheNodesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EnterpriseMccCacheNodeResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EnterpriseMccCustomerResource created on azure + // for more information of creating EnterpriseMccCustomerResource, please refer to the document of EnterpriseMccCustomerResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "cygqjgtcetihsajgyqwwrbclssqsvhgltrboemcqqtpoxdbhykqxblaihmrumyhbsx"; + ResourceIdentifier enterpriseMccCustomerResourceId = EnterpriseMccCustomerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName); + EnterpriseMccCustomerResource enterpriseMccCustomerResource = client.GetEnterpriseMccCustomerResource(enterpriseMccCustomerResourceId); + + // get the collection of this EnterpriseMccCacheNodeResource + EnterpriseMccCacheNodeResourceCollection collection = enterpriseMccCustomerResource.GetEnterpriseMccCacheNodeResources(); + + // invoke the operation + string cacheNodeResourceName = "fqxfadsultwjfzdwlqkvneakfsbyhratytmssmiukpbnus"; + EnterpriseMccCacheNodeResource result = await collection.GetAsync(cacheNodeResourceName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EnterpriseMccCacheNodeResourceData 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_EnterpriseMccCacheNodesOperationsListByEnterpriseMccCustomerResource() + { + // Generated from example definition: 2024-11-30-preview/EnterpriseMccCacheNodesOperations_ListByEnterpriseMccCustomerResource_MaximumSet_Gen.json + // this example is just showing the usage of "EnterpriseMccCacheNodeResource_ListByEnterpriseMccCustomerResource" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EnterpriseMccCustomerResource created on azure + // for more information of creating EnterpriseMccCustomerResource, please refer to the document of EnterpriseMccCustomerResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "syjjjzk"; + ResourceIdentifier enterpriseMccCustomerResourceId = EnterpriseMccCustomerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName); + EnterpriseMccCustomerResource enterpriseMccCustomerResource = client.GetEnterpriseMccCustomerResource(enterpriseMccCustomerResourceId); + + // get the collection of this EnterpriseMccCacheNodeResource + EnterpriseMccCacheNodeResourceCollection collection = enterpriseMccCustomerResource.GetEnterpriseMccCacheNodeResources(); + + // invoke the operation and iterate over the result + await foreach (EnterpriseMccCacheNodeResource 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 + EnterpriseMccCacheNodeResourceData 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_GetsEnterpriseMccCacheNodeResourceInformationOfAnEnterpriseMccCustomerParentResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-11-30-preview/EnterpriseMccCacheNodesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EnterpriseMccCacheNodeResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EnterpriseMccCustomerResource created on azure + // for more information of creating EnterpriseMccCustomerResource, please refer to the document of EnterpriseMccCustomerResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "cygqjgtcetihsajgyqwwrbclssqsvhgltrboemcqqtpoxdbhykqxblaihmrumyhbsx"; + ResourceIdentifier enterpriseMccCustomerResourceId = EnterpriseMccCustomerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName); + EnterpriseMccCustomerResource enterpriseMccCustomerResource = client.GetEnterpriseMccCustomerResource(enterpriseMccCustomerResourceId); + + // get the collection of this EnterpriseMccCacheNodeResource + EnterpriseMccCacheNodeResourceCollection collection = enterpriseMccCustomerResource.GetEnterpriseMccCacheNodeResources(); + + // invoke the operation + string cacheNodeResourceName = "fqxfadsultwjfzdwlqkvneakfsbyhratytmssmiukpbnus"; + bool result = await collection.ExistsAsync(cacheNodeResourceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsEnterpriseMccCacheNodeResourceInformationOfAnEnterpriseMccCustomerParentResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-11-30-preview/EnterpriseMccCacheNodesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EnterpriseMccCacheNodeResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EnterpriseMccCustomerResource created on azure + // for more information of creating EnterpriseMccCustomerResource, please refer to the document of EnterpriseMccCustomerResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "cygqjgtcetihsajgyqwwrbclssqsvhgltrboemcqqtpoxdbhykqxblaihmrumyhbsx"; + ResourceIdentifier enterpriseMccCustomerResourceId = EnterpriseMccCustomerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName); + EnterpriseMccCustomerResource enterpriseMccCustomerResource = client.GetEnterpriseMccCustomerResource(enterpriseMccCustomerResourceId); + + // get the collection of this EnterpriseMccCacheNodeResource + EnterpriseMccCacheNodeResourceCollection collection = enterpriseMccCustomerResource.GetEnterpriseMccCacheNodeResources(); + + // invoke the operation + string cacheNodeResourceName = "fqxfadsultwjfzdwlqkvneakfsbyhratytmssmiukpbnus"; + NullableResponse response = await collection.GetIfExistsAsync(cacheNodeResourceName); + EnterpriseMccCacheNodeResource 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 + EnterpriseMccCacheNodeResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_EnterpriseMccCustomerResource.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_EnterpriseMccCustomerResource.cs new file mode 100644 index 000000000000..cdfdbe59d729 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_EnterpriseMccCustomerResource.cs @@ -0,0 +1,112 @@ +// 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.ConnectedCache.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ConnectedCache.Samples +{ + public partial class Sample_EnterpriseMccCustomerResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_EnterpriseMccCustomersGet() + { + // Generated from example definition: 2024-11-30-preview/EnterpriseMccCustomers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EnterpriseMccCustomerResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EnterpriseMccCustomerResource created on azure + // for more information of creating EnterpriseMccCustomerResource, please refer to the document of EnterpriseMccCustomerResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "pvilvqkofbjbykupeewgvzlmjao"; + ResourceIdentifier enterpriseMccCustomerResourceId = EnterpriseMccCustomerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName); + EnterpriseMccCustomerResource enterpriseMccCustomerResource = client.GetEnterpriseMccCustomerResource(enterpriseMccCustomerResourceId); + + // invoke the operation + EnterpriseMccCustomerResource result = await enterpriseMccCustomerResource.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 + EnterpriseMccCustomerResourceData 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_EnterpriseMccCustomersDelete() + { + // Generated from example definition: 2024-11-30-preview/EnterpriseMccCustomers_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "EnterpriseMccCustomerResource_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 EnterpriseMccCustomerResource created on azure + // for more information of creating EnterpriseMccCustomerResource, please refer to the document of EnterpriseMccCustomerResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "zktb"; + ResourceIdentifier enterpriseMccCustomerResourceId = EnterpriseMccCustomerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName); + EnterpriseMccCustomerResource enterpriseMccCustomerResource = client.GetEnterpriseMccCustomerResource(enterpriseMccCustomerResourceId); + + // invoke the operation + await enterpriseMccCustomerResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_EnterpriseMccCustomersUpdate() + { + // Generated from example definition: 2024-11-30-preview/EnterpriseMccCustomers_Update_MaximumSet_Gen.json + // this example is just showing the usage of "EnterpriseMccCustomerResource_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 EnterpriseMccCustomerResource created on azure + // for more information of creating EnterpriseMccCustomerResource, please refer to the document of EnterpriseMccCustomerResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "MccRPTest1"; + ResourceIdentifier enterpriseMccCustomerResourceId = EnterpriseMccCustomerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName); + EnterpriseMccCustomerResource enterpriseMccCustomerResource = client.GetEnterpriseMccCustomerResource(enterpriseMccCustomerResourceId); + + // invoke the operation + ConnectedCachePatchContent content = new ConnectedCachePatchContent + { + Tags = +{ +["key1878"] = "warz" +}, + }; + EnterpriseMccCustomerResource result = await enterpriseMccCustomerResource.UpdateAsync(content); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EnterpriseMccCustomerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_EnterpriseMccCustomerResourceCollection.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_EnterpriseMccCustomerResourceCollection.cs new file mode 100644 index 000000000000..b06ea26b8121 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_EnterpriseMccCustomerResourceCollection.cs @@ -0,0 +1,234 @@ +// 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.ConnectedCache.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.ConnectedCache.Samples +{ + public partial class Sample_EnterpriseMccCustomerResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_EnterpriseMccCustomersCreateOrUpdate() + { + // Generated from example definition: 2024-11-30-preview/EnterpriseMccCustomers_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "EnterpriseMccCustomerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this EnterpriseMccCustomerResource + EnterpriseMccCustomerResourceCollection collection = resourceGroupResource.GetEnterpriseMccCustomerResources(); + + // invoke the operation + string customerResourceName = "MccRPTest1"; + EnterpriseMccCustomerResourceData data = new EnterpriseMccCustomerResourceData(new AzureLocation("westus")) + { + Properties = new CustomerProperty + { + Customer = new CustomerEntity + { + FullyQualifiedResourceId = "uqsbtgae", + CustomerName = "mkpzynfqihnjfdbaqbqwyhd", + ContactEmail = "xquos", + ContactPhone = "vue", + ContactName = "wxyqjoyoscmvimgwhpitxky", + IsEntitled = true, + ReleaseVersion = 20, + ClientTenantId = "fproidkpgvpdnac", + IsEnterpriseManaged = true, + ShouldMigrate = true, + ResendSignupCode = true, + VerifySignupCode = true, + VerifySignupPhrase = "tprjvttkgmrqlsyicnidhm", + }, + AdditionalCustomerProperties = new AdditionalCustomerProperties + { + CustomerEmail = "zdjgibsidydyzm", + CustomerTransitAsn = "habgklnxqzmozqpazoyejwiphezpi", + CustomerTransitState = new CustomerTransitState("voblixkxfejbmhxilb"), + CustomerAsn = "hgrelgnrtdkleisnepfolu", + CustomerEntitlementSkuId = "b", + CustomerEntitlementSkuGuid = "rvzmdpxyflgqetvpwupnfaxsweiiz", + CustomerEntitlementSkuName = "waaqfijr", + CustomerEntitlementExpiration = DateTimeOffset.Parse("2024-01-30T00:54:04.773Z"), + OptionalProperty1 = "qhmwxza", + OptionalProperty2 = "l", + OptionalProperty3 = "mblwwvbie", + OptionalProperty4 = "vzuek", + OptionalProperty5 = "fzjodscdfcdr", + }, + }, + Tags = +{ +["key3379"] = "dpyqeaqhcnutzezom" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, customerResourceName, data); + EnterpriseMccCustomerResource 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 + EnterpriseMccCustomerResourceData 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_EnterpriseMccCustomersGet() + { + // Generated from example definition: 2024-11-30-preview/EnterpriseMccCustomers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EnterpriseMccCustomerResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this EnterpriseMccCustomerResource + EnterpriseMccCustomerResourceCollection collection = resourceGroupResource.GetEnterpriseMccCustomerResources(); + + // invoke the operation + string customerResourceName = "pvilvqkofbjbykupeewgvzlmjao"; + EnterpriseMccCustomerResource result = await collection.GetAsync(customerResourceName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EnterpriseMccCustomerResourceData 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_EnterpriseMccCustomersListByResourceGroup() + { + // Generated from example definition: 2024-11-30-preview/EnterpriseMccCustomers_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "EnterpriseMccCustomerResource_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this EnterpriseMccCustomerResource + EnterpriseMccCustomerResourceCollection collection = resourceGroupResource.GetEnterpriseMccCustomerResources(); + + // invoke the operation and iterate over the result + await foreach (EnterpriseMccCustomerResource 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 + EnterpriseMccCustomerResourceData 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_EnterpriseMccCustomersGet() + { + // Generated from example definition: 2024-11-30-preview/EnterpriseMccCustomers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EnterpriseMccCustomerResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this EnterpriseMccCustomerResource + EnterpriseMccCustomerResourceCollection collection = resourceGroupResource.GetEnterpriseMccCustomerResources(); + + // invoke the operation + string customerResourceName = "pvilvqkofbjbykupeewgvzlmjao"; + bool result = await collection.ExistsAsync(customerResourceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_EnterpriseMccCustomersGet() + { + // Generated from example definition: 2024-11-30-preview/EnterpriseMccCustomers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EnterpriseMccCustomerResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this EnterpriseMccCustomerResource + EnterpriseMccCustomerResourceCollection collection = resourceGroupResource.GetEnterpriseMccCustomerResources(); + + // invoke the operation + string customerResourceName = "pvilvqkofbjbykupeewgvzlmjao"; + NullableResponse response = await collection.GetIfExistsAsync(customerResourceName); + EnterpriseMccCustomerResource 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 + EnterpriseMccCustomerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_IspCacheNodeResource.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_IspCacheNodeResource.cs new file mode 100644 index 000000000000..608358d71196 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_IspCacheNodeResource.cs @@ -0,0 +1,223 @@ +// 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.ConnectedCache.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ConnectedCache.Samples +{ + public partial class Sample_IspCacheNodeResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_IspCacheNodesGetResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-11-30-preview/IspCacheNodesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "IspCacheNodeResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IspCacheNodeResource created on azure + // for more information of creating IspCacheNodeResource, please refer to the document of IspCacheNodeResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "sgtqjsitdrskmgyrrkntszwrrjjkretscpjgaezraucvcwececlelcsorfunrnvxyxcsrg"; + string cacheNodeResourceName = "lbsziwmudcjnwnwy"; + ResourceIdentifier ispCacheNodeResourceId = IspCacheNodeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + IspCacheNodeResource ispCacheNodeResource = client.GetIspCacheNodeResource(ispCacheNodeResourceId); + + // invoke the operation + IspCacheNodeResource result = await ispCacheNodeResource.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 + IspCacheNodeResourceData 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_IspCacheNodesDeleteOperationGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-11-30-preview/IspCacheNodesOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "IspCacheNodeResource_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 IspCacheNodeResource created on azure + // for more information of creating IspCacheNodeResource, please refer to the document of IspCacheNodeResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "lvpcosvbfxtpzscakewx"; + string cacheNodeResourceName = "wsiruvexelltpbouqxvsogqpxdizcwqwfowybncvjunlakjwcpgmqbdbgzjrsmxlkczxnsxfonhnqqa"; + ResourceIdentifier ispCacheNodeResourceId = IspCacheNodeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + IspCacheNodeResource ispCacheNodeResource = client.GetIspCacheNodeResource(ispCacheNodeResourceId); + + // invoke the operation + await ispCacheNodeResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_IspCacheNodesOperationsUpdate() + { + // Generated from example definition: 2024-11-30-preview/IspCacheNodesOperations_Update_MaximumSet_Gen.json + // this example is just showing the usage of "IspCacheNodeResource_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 IspCacheNodeResource created on azure + // for more information of creating IspCacheNodeResource, please refer to the document of IspCacheNodeResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "MccRPTest1"; + string cacheNodeResourceName = "MCCCachenode1"; + ResourceIdentifier ispCacheNodeResourceId = IspCacheNodeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + IspCacheNodeResource ispCacheNodeResource = client.GetIspCacheNodeResource(ispCacheNodeResourceId); + + // invoke the operation + ConnectedCachePatchContent content = new ConnectedCachePatchContent + { + Tags = +{ +["key1653"] = "nzjczrhclhkndesgy" +}, + }; + IspCacheNodeResource result = await ispCacheNodeResource.UpdateAsync(content); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IspCacheNodeResourceData 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 GetBgpCidrs_IspCacheNodesResourceBgpCidrsDetailsGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-11-30-preview/IspCacheNodesOperations_GetBgpCidrs_MaximumSet_Gen.json + // this example is just showing the usage of "IspCacheNodesOperations_GetBgpCidrs" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IspCacheNodeResource created on azure + // for more information of creating IspCacheNodeResource, please refer to the document of IspCacheNodeResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "MccRPTest1"; + string cacheNodeResourceName = "MCCCachenode1"; + ResourceIdentifier ispCacheNodeResourceId = IspCacheNodeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + IspCacheNodeResource ispCacheNodeResource = client.GetIspCacheNodeResource(ispCacheNodeResourceId); + + // invoke the operation + MccCacheNodeBgpCidrDetails result = await ispCacheNodeResource.GetBgpCidrsAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetCacheNodeInstallDetails_IspCacheNodeResourceGetInstallDetailsGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-11-30-preview/IspCacheNodesOperations_GetCacheNodeInstallDetails_MaximumSet_Gen.json + // this example is just showing the usage of "IspCacheNodesOperations_GetCacheNodeInstallDetails" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IspCacheNodeResource created on azure + // for more information of creating IspCacheNodeResource, please refer to the document of IspCacheNodeResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "MccRPTest1"; + string cacheNodeResourceName = "MCCCachenode1"; + ResourceIdentifier ispCacheNodeResourceId = IspCacheNodeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + IspCacheNodeResource ispCacheNodeResource = client.GetIspCacheNodeResource(ispCacheNodeResourceId); + + // invoke the operation + MccCacheNodeInstallDetails result = await ispCacheNodeResource.GetCacheNodeInstallDetailsAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetCacheNodeAutoUpdateHistory_IspCacheNodesOperationsGetCacheNodeAutoUpdateHistoryMaximumSet() + { + // Generated from example definition: 2024-11-30-preview/IspCacheNodesOperations_GetCacheNodeAutoUpdateHistory_MaximumSet_Gen.json + // this example is just showing the usage of "IspCacheNodesOperations_GetCacheNodeAutoUpdateHistory" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IspCacheNodeResource created on azure + // for more information of creating IspCacheNodeResource, please refer to the document of IspCacheNodeResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "MccRPTest1"; + string cacheNodeResourceName = "MCCCachenode1"; + ResourceIdentifier ispCacheNodeResourceId = IspCacheNodeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + IspCacheNodeResource ispCacheNodeResource = client.GetIspCacheNodeResource(ispCacheNodeResourceId); + + // invoke the operation + MccCacheNodeAutoUpdateHistory result = await ispCacheNodeResource.GetCacheNodeAutoUpdateHistoryAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetCacheNodeMccIssueDetailsHistory_IspCacheNodesOperationsGetCacheNodeMccIssueDetailsHistoryMaximumSet() + { + // Generated from example definition: 2024-11-30-preview/IspCacheNodesOperations_GetCacheNodeMccIssueDetailsHistory_MaximumSet_Gen.json + // this example is just showing the usage of "IspCacheNodesOperations_GetCacheNodeMccIssueDetailsHistory" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IspCacheNodeResource created on azure + // for more information of creating IspCacheNodeResource, please refer to the document of IspCacheNodeResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "MccRPTest1"; + string cacheNodeResourceName = "MCCCachenode1"; + ResourceIdentifier ispCacheNodeResourceId = IspCacheNodeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + IspCacheNodeResource ispCacheNodeResource = client.GetIspCacheNodeResource(ispCacheNodeResourceId); + + // invoke the operation + MccCacheNodeIssueHistory result = await ispCacheNodeResource.GetCacheNodeMccIssueDetailsHistoryAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_IspCacheNodeResourceCollection.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_IspCacheNodeResourceCollection.cs new file mode 100644 index 000000000000..a5fc3d4508d2 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_IspCacheNodeResourceCollection.cs @@ -0,0 +1,244 @@ +// 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.ConnectedCache.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ConnectedCache.Samples +{ + public partial class Sample_IspCacheNodeResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_IspCacheNodesOperationsCreateOrUpdate() + { + // Generated from example definition: 2024-11-30-preview/IspCacheNodesOperations_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "IspCacheNodeResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IspCustomerResource created on azure + // for more information of creating IspCustomerResource, please refer to the document of IspCustomerResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "zpqzbmanlljgmkrthtydrtneavhlnlqkdmviq"; + ResourceIdentifier ispCustomerResourceId = IspCustomerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName); + IspCustomerResource ispCustomerResource = client.GetIspCustomerResource(ispCustomerResourceId); + + // get the collection of this IspCacheNodeResource + IspCacheNodeResourceCollection collection = ispCustomerResource.GetIspCacheNodeResources(); + + // invoke the operation + string cacheNodeResourceName = "cabakm"; + IspCacheNodeResourceData data = new IspCacheNodeResourceData(new AzureLocation("westus")) + { + Properties = new CacheNodeProperty + { + CacheNode = new CacheNodeEntity + { + FullyQualifiedResourceId = "hskxkpbiqbrbjiwdzrxndru", + CustomerName = "xwyqk", + IPAddress = "voctagljcwqgcpnionqdcbjk", + CustomerIndex = "qtoiglqaswivmkjhzogburcxtszmek", + CacheNodeId = "xjzffjftwcgsehanoxsl", + CacheNodeName = "mfjxb", + CustomerAsn = 4, + IsEnabled = true, + MaxAllowableEgressInMbps = 29, + IsEnterpriseManaged = true, + CidrCsv = { "nlqlvrthafvvljuupcbcw" }, + ShouldMigrate = true, + CidrSelectionType = 4, + }, + AdditionalCacheNodeProperties = new AdditionalCacheNodeProperties + { + CacheNodePropertiesDetailsIssuesList = { "ex" }, + DriveConfiguration = {new CacheNodeDriveConfiguration +{ +PhysicalPath = "/mcc", +SizeInGb = 500, +CacheNumber = 1, +NginxMapping = "lijygenjq", +}}, + BgpAsnToIPAddressMapping = "pafcimhoog", + ProxyUri = "hplstyg", + OptionalProperty1 = "hvpmt", + OptionalProperty2 = "talanelmsgxvksrzoeeontqkjzbpv", + OptionalProperty3 = "bxkoxq", + OptionalProperty4 = "pqlkcekupusoc", + OptionalProperty5 = "nyvvmrjigqdufzjdvazdca", + }, + StatusCode = "1", + StatusText = "Success", + StatusDetails = "djruqvptzxak", + Error = new ResponseError(null, null), + }, + Tags = +{ +["key4171"] = "qtjlszkawsdujzpgohsbw" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, cacheNodeResourceName, data); + IspCacheNodeResource 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 + IspCacheNodeResourceData 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_IspCacheNodesGetResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-11-30-preview/IspCacheNodesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "IspCacheNodeResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IspCustomerResource created on azure + // for more information of creating IspCustomerResource, please refer to the document of IspCustomerResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "sgtqjsitdrskmgyrrkntszwrrjjkretscpjgaezraucvcwececlelcsorfunrnvxyxcsrg"; + ResourceIdentifier ispCustomerResourceId = IspCustomerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName); + IspCustomerResource ispCustomerResource = client.GetIspCustomerResource(ispCustomerResourceId); + + // get the collection of this IspCacheNodeResource + IspCacheNodeResourceCollection collection = ispCustomerResource.GetIspCacheNodeResources(); + + // invoke the operation + string cacheNodeResourceName = "lbsziwmudcjnwnwy"; + IspCacheNodeResource result = await collection.GetAsync(cacheNodeResourceName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IspCacheNodeResourceData 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_IspCacheNodesOperationsListByIspCustomerResource() + { + // Generated from example definition: 2024-11-30-preview/IspCacheNodesOperations_ListByIspCustomerResource_MaximumSet_Gen.json + // this example is just showing the usage of "IspCacheNodeResource_ListByIspCustomerResource" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IspCustomerResource created on azure + // for more information of creating IspCustomerResource, please refer to the document of IspCustomerResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "MccRPTest1"; + ResourceIdentifier ispCustomerResourceId = IspCustomerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName); + IspCustomerResource ispCustomerResource = client.GetIspCustomerResource(ispCustomerResourceId); + + // get the collection of this IspCacheNodeResource + IspCacheNodeResourceCollection collection = ispCustomerResource.GetIspCacheNodeResources(); + + // invoke the operation and iterate over the result + await foreach (IspCacheNodeResource 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 + IspCacheNodeResourceData 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_IspCacheNodesGetResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-11-30-preview/IspCacheNodesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "IspCacheNodeResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IspCustomerResource created on azure + // for more information of creating IspCustomerResource, please refer to the document of IspCustomerResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "sgtqjsitdrskmgyrrkntszwrrjjkretscpjgaezraucvcwececlelcsorfunrnvxyxcsrg"; + ResourceIdentifier ispCustomerResourceId = IspCustomerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName); + IspCustomerResource ispCustomerResource = client.GetIspCustomerResource(ispCustomerResourceId); + + // get the collection of this IspCacheNodeResource + IspCacheNodeResourceCollection collection = ispCustomerResource.GetIspCacheNodeResources(); + + // invoke the operation + string cacheNodeResourceName = "lbsziwmudcjnwnwy"; + bool result = await collection.ExistsAsync(cacheNodeResourceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_IspCacheNodesGetResourceGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-11-30-preview/IspCacheNodesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "IspCacheNodeResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IspCustomerResource created on azure + // for more information of creating IspCustomerResource, please refer to the document of IspCustomerResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "sgtqjsitdrskmgyrrkntszwrrjjkretscpjgaezraucvcwececlelcsorfunrnvxyxcsrg"; + ResourceIdentifier ispCustomerResourceId = IspCustomerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName); + IspCustomerResource ispCustomerResource = client.GetIspCustomerResource(ispCustomerResourceId); + + // get the collection of this IspCacheNodeResource + IspCacheNodeResourceCollection collection = ispCustomerResource.GetIspCacheNodeResources(); + + // invoke the operation + string cacheNodeResourceName = "lbsziwmudcjnwnwy"; + NullableResponse response = await collection.GetIfExistsAsync(cacheNodeResourceName); + IspCacheNodeResource 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 + IspCacheNodeResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_IspCustomerResource.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_IspCustomerResource.cs new file mode 100644 index 000000000000..57d4fd2985a9 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_IspCustomerResource.cs @@ -0,0 +1,112 @@ +// 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.ConnectedCache.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ConnectedCache.Samples +{ + public partial class Sample_IspCustomerResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_IspCustomersGetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-11-30-preview/IspCustomers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "IspCustomerResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IspCustomerResource created on azure + // for more information of creating IspCustomerResource, please refer to the document of IspCustomerResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "cmcjfueweicolcjkwmsuvcj"; + ResourceIdentifier ispCustomerResourceId = IspCustomerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName); + IspCustomerResource ispCustomerResource = client.GetIspCustomerResource(ispCustomerResourceId); + + // invoke the operation + IspCustomerResource result = await ispCustomerResource.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 + IspCustomerResourceData 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_IspCustomersDeleteGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-11-30-preview/IspCustomers_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "IspCustomerResource_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 IspCustomerResource created on azure + // for more information of creating IspCustomerResource, please refer to the document of IspCustomerResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "hdontfoythjsaeyjhrakckgimgchxwzttbcnvntpvdsgeumxpgnjurptd"; + ResourceIdentifier ispCustomerResourceId = IspCustomerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName); + IspCustomerResource ispCustomerResource = client.GetIspCustomerResource(ispCustomerResourceId); + + // invoke the operation + await ispCustomerResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_IspCustomerUpdateDetailsGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-11-30-preview/IspCustomers_Update_MaximumSet_Gen.json + // this example is just showing the usage of "IspCustomerResource_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 IspCustomerResource created on azure + // for more information of creating IspCustomerResource, please refer to the document of IspCustomerResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + string customerResourceName = "MccRPTest2"; + ResourceIdentifier ispCustomerResourceId = IspCustomerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, customerResourceName); + IspCustomerResource ispCustomerResource = client.GetIspCustomerResource(ispCustomerResourceId); + + // invoke the operation + ConnectedCachePatchContent content = new ConnectedCachePatchContent + { + Tags = +{ +["key1653"] = "nzjczrhclhkndesgy" +}, + }; + IspCustomerResource result = await ispCustomerResource.UpdateAsync(content); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IspCustomerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_IspCustomerResourceCollection.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_IspCustomerResourceCollection.cs new file mode 100644 index 000000000000..841b73fe0e37 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_IspCustomerResourceCollection.cs @@ -0,0 +1,234 @@ +// 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.ConnectedCache.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.ConnectedCache.Samples +{ + public partial class Sample_IspCustomerResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_IspCustomerCreateOrUpdateGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-11-30-preview/IspCustomers_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "IspCustomerResource_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this IspCustomerResource + IspCustomerResourceCollection collection = resourceGroupResource.GetIspCustomerResources(); + + // invoke the operation + string customerResourceName = "MccRPTest2"; + IspCustomerResourceData data = new IspCustomerResourceData(new AzureLocation("westus")) + { + Properties = new CustomerProperty + { + Customer = new CustomerEntity + { + FullyQualifiedResourceId = "uqsbtgae", + CustomerName = "mkpzynfqihnjfdbaqbqwyhd", + ContactEmail = "xquos", + ContactPhone = "vue", + ContactName = "wxyqjoyoscmvimgwhpitxky", + IsEntitled = true, + ReleaseVersion = 20, + ClientTenantId = "fproidkpgvpdnac", + IsEnterpriseManaged = true, + ShouldMigrate = true, + ResendSignupCode = true, + VerifySignupCode = true, + VerifySignupPhrase = "tprjvttkgmrqlsyicnidhm", + }, + AdditionalCustomerProperties = new AdditionalCustomerProperties + { + CustomerEmail = "zdjgibsidydyzm", + CustomerTransitAsn = "habgklnxqzmozqpazoyejwiphezpi", + CustomerTransitState = new CustomerTransitState("voblixkxfejbmhxilb"), + CustomerAsn = "hgrelgnrtdkleisnepfolu", + CustomerEntitlementSkuId = "b", + CustomerEntitlementSkuGuid = "rvzmdpxyflgqetvpwupnfaxsweiiz", + CustomerEntitlementSkuName = "waaqfijr", + CustomerEntitlementExpiration = DateTimeOffset.Parse("2024-01-30T00:54:04.773Z"), + OptionalProperty1 = "qhmwxza", + OptionalProperty2 = "l", + OptionalProperty3 = "mblwwvbie", + OptionalProperty4 = "vzuek", + OptionalProperty5 = "fzjodscdfcdr", + }, + }, + Tags = +{ +["key1878"] = "warz" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, customerResourceName, data); + IspCustomerResource 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 + IspCustomerResourceData 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_IspCustomersGetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-11-30-preview/IspCustomers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "IspCustomerResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this IspCustomerResource + IspCustomerResourceCollection collection = resourceGroupResource.GetIspCustomerResources(); + + // invoke the operation + string customerResourceName = "cmcjfueweicolcjkwmsuvcj"; + IspCustomerResource result = await collection.GetAsync(customerResourceName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + IspCustomerResourceData 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_IspCustomersResourceListByResourceGroupGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-11-30-preview/IspCustomers_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "IspCustomerResource_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this IspCustomerResource + IspCustomerResourceCollection collection = resourceGroupResource.GetIspCustomerResources(); + + // invoke the operation and iterate over the result + await foreach (IspCustomerResource 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 + IspCustomerResourceData 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_IspCustomersGetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-11-30-preview/IspCustomers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "IspCustomerResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this IspCustomerResource + IspCustomerResourceCollection collection = resourceGroupResource.GetIspCustomerResources(); + + // invoke the operation + string customerResourceName = "cmcjfueweicolcjkwmsuvcj"; + bool result = await collection.ExistsAsync(customerResourceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_IspCustomersGetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-11-30-preview/IspCustomers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "IspCustomerResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "12345678-1234-1234-1234-123456789098"; + string resourceGroupName = "rgConnectedCache"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this IspCustomerResource + IspCustomerResourceCollection collection = resourceGroupResource.GetIspCustomerResources(); + + // invoke the operation + string customerResourceName = "cmcjfueweicolcjkwmsuvcj"; + NullableResponse response = await collection.GetIfExistsAsync(customerResourceName); + IspCustomerResource 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 + IspCustomerResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..a3162f072492 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -0,0 +1,81 @@ +// 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.ConnectedCache.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIspCustomerResources_IspCustomerListBySubscriptionGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-11-30-preview/IspCustomers_ListBySubscription_MaximumSet_Gen.json + // this example is just showing the usage of "IspCustomerResource_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 = "12345678-1234-1234-1234-123456789098"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (IspCustomerResource item in subscriptionResource.GetIspCustomerResourcesAsync()) + { + // 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 + IspCustomerResourceData 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 GetEnterpriseMccCustomerResources_EnterpriseMccCustomersListBySubscription() + { + // Generated from example definition: 2024-11-30-preview/EnterpriseMccCustomers_ListBySubscription_MaximumSet_Gen.json + // this example is just showing the usage of "EnterpriseMccCustomerResource_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 = "12345678-1234-1234-1234-123456789098"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (EnterpriseMccCustomerResource item in subscriptionResource.GetEnterpriseMccCustomerResourcesAsync()) + { + // 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 + EnterpriseMccCustomerResourceData 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/connectedcache/Azure.ResourceManager.ConnectedCache/src/Azure.ResourceManager.ConnectedCache.csproj b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Azure.ResourceManager.ConnectedCache.csproj new file mode 100644 index 000000000000..e2254da8da75 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Azure.ResourceManager.ConnectedCache.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider ConnectedCache. + 1.0.0-beta.1 + azure;management;arm;resource manager;connectedcache + Azure.ResourceManager.ConnectedCache + + diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/ArmConnectedCacheModelFactory.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/ArmConnectedCacheModelFactory.cs new file mode 100644 index 000000000000..97b93d8f269c --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/ArmConnectedCacheModelFactory.cs @@ -0,0 +1,738 @@ +// 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.ConnectedCache.Models +{ + /// Model factory for models. + public static partial class ArmConnectedCacheModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static IspCustomerResourceData IspCustomerResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CustomerProperty properties = null) + { + tags ??= new Dictionary(); + + return new IspCustomerResourceData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The provisioned state of the resource. + /// Mcc customer resource (customer entity). + /// Mcc customer resource additional properties. + /// Mcc response status code. + /// Mcc response status text as string for retrieving status details. + /// Mcc response status details for retrieving response inner details. + /// HTTP error status code. + /// Mcc response error details. + /// A new instance for mocking. + public static CustomerProperty CustomerProperty(ProvisioningState? provisioningState = null, CustomerEntity customer = null, AdditionalCustomerProperties additionalCustomerProperties = null, string statusCode = null, string statusText = null, string statusDetails = null, string status = null, ResponseError error = null) + { + return new CustomerProperty( + provisioningState, + customer, + additionalCustomerProperties, + statusCode, + statusText, + statusDetails, + status, + error, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Customer resource Azure fully qualified resource Id. + /// Customer resource Guid Id. + /// Customer resource name. + /// Customer resource contact email. + /// Customer resource contact phone. + /// Customer resource contact full name. + /// Customer resource entitlement flag as boolean. + /// Customer resource Mcc release version. + /// Customer resource create async operation Id. + /// Customer resource deletion async operation Id. + /// Customer resource client tenant Id of subscription. + /// Customer resource sync attempts. + /// Customer resource last Azure sync timestamp. + /// Customer resource flag for enterprise management as boolean. + /// Customer resource flag for migration. + /// Customer resource flag for resending signup code as boolean. + /// Customer resource flag for requiring verification of signup code as boolean. + /// Customer resource phrase for verifying signup. + /// A new instance for mocking. + public static CustomerEntity CustomerEntity(string fullyQualifiedResourceId = null, string customerId = null, string customerName = null, string contactEmail = null, string contactPhone = null, string contactName = null, bool? isEntitled = null, int? releaseVersion = null, string createAsyncOperationId = null, string deleteAsyncOperationId = null, string clientTenantId = null, int? synchWithAzureAttemptsCount = null, DateTimeOffset? lastSyncWithAzureTimestamp = null, bool? isEnterpriseManaged = null, bool? shouldMigrate = null, bool? resendSignupCode = null, bool? verifySignupCode = null, string verifySignupPhrase = null) + { + return new CustomerEntity( + fullyQualifiedResourceId, + customerId, + customerName, + contactEmail, + contactPhone, + contactName, + isEntitled, + releaseVersion, + createAsyncOperationId, + deleteAsyncOperationId, + clientTenantId, + synchWithAzureAttemptsCount, + lastSyncWithAzureTimestamp, + isEnterpriseManaged, + shouldMigrate, + resendSignupCode, + verifySignupCode, + verifySignupPhrase, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Customer resource cache efficiency. + /// Customer resource average egress in Mbps. + /// Customer resource average cache miss throughput in Mbps. + /// Customer resource maximum egress in Mbps. + /// Customer resource peak egress timestamp. + /// Customer resource maximum cache miss throughput in Mbps. + /// Customer resource peak cache miss throughput timestamp. + /// Customer resource total healthy cache nodes. + /// Customer resource total unhealthy cache nodes. + /// Customer resource signup status as boolean. + /// Customer resource signup status as integer code. + /// Customer resource signup status as string text. + /// Customer resource signup phase status code as integer. + /// Customer resource signup phase status as string text. + /// Customer resource last PeeringDB update timestamp. + /// Customer resource owner organization name. + /// Customer resource contact email. + /// Customer resource transit Asn (autonomous system number). + /// Customer resource transit state. + /// Customer resource Asn (autonomous system number). + /// Customer resource estimated Asn peering peak in Gbps. + /// Customer resource entitlement Sku Id. + /// Customer resource entitlement Sku Guid. + /// Customer resource entitlement Sku name. + /// Customer resource entitlement expiration date string. + /// Optional property #1 of Mcc response object. + /// Optional property #2 of Mcc response object. + /// Optional property #3 of Mcc response object. + /// Optional property #4 of Mcc response object. + /// Optional property #5 of Mcc response object. + /// A new instance for mocking. + public static AdditionalCustomerProperties AdditionalCustomerProperties(float? customerPropertiesOverviewCacheEfficiency = null, float? customerPropertiesOverviewAverageEgressMbps = null, float? customerPropertiesOverviewAverageMissMbps = null, float? customerPropertiesOverviewEgressMbpsMax = null, DateTimeOffset? customerPropertiesOverviewEgressMbpsMaxOn = null, float? customerPropertiesOverviewMissMbpsMax = null, DateTimeOffset? customerPropertiesOverviewMissMbpsMaxOn = null, int? customerPropertiesOverviewCacheNodesHealthyCount = null, int? customerPropertiesOverviewCacheNodesUnhealthyCount = null, bool? signupStatus = null, int? signupStatusCode = null, string signupStatusText = null, int? signupPhaseStatusCode = null, string signupPhaseStatusText = null, DateTimeOffset? peeringDbLastUpdateDateValue = null, string customerOrgName = null, string customerEmail = null, string customerTransitAsn = null, CustomerTransitState? customerTransitState = null, string customerAsn = null, float? customerAsnEstimatedEgressPeekGbps = null, string customerEntitlementSkuId = null, string customerEntitlementSkuGuid = null, string customerEntitlementSkuName = null, DateTimeOffset? customerEntitlementExpiration = null, string optionalProperty1 = null, string optionalProperty2 = null, string optionalProperty3 = null, string optionalProperty4 = null, string optionalProperty5 = null) + { + return new AdditionalCustomerProperties( + customerPropertiesOverviewCacheEfficiency, + customerPropertiesOverviewAverageEgressMbps, + customerPropertiesOverviewAverageMissMbps, + customerPropertiesOverviewEgressMbpsMax, + customerPropertiesOverviewEgressMbpsMaxOn, + customerPropertiesOverviewMissMbpsMax, + customerPropertiesOverviewMissMbpsMaxOn, + customerPropertiesOverviewCacheNodesHealthyCount, + customerPropertiesOverviewCacheNodesUnhealthyCount, + signupStatus, + signupStatusCode, + signupStatusText, + signupPhaseStatusCode, + signupPhaseStatusText, + peeringDbLastUpdateDateValue, + customerOrgName, + customerEmail, + customerTransitAsn, + customerTransitState, + customerAsn, + customerAsnEstimatedEgressPeekGbps, + customerEntitlementSkuId, + customerEntitlementSkuGuid, + customerEntitlementSkuName, + customerEntitlementExpiration, + optionalProperty1, + optionalProperty2, + optionalProperty3, + optionalProperty4, + optionalProperty5, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static IspCacheNodeResourceData IspCacheNodeResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CacheNodeProperty properties = null) + { + tags ??= new Dictionary(); + + return new IspCacheNodeResourceData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The provisioned state of the resource. + /// Mcc cache node resource (cache node entity). + /// Mcc cache node resource additional properties. + /// Mcc response status code. + /// Mcc response status text as string for retrieving status details. + /// Mcc response status details for retrieving response inner details. + /// HTTP error status code. + /// Mcc response error details. + /// A new instance for mocking. + public static CacheNodeProperty CacheNodeProperty(ProvisioningState? provisioningState = null, CacheNodeEntity cacheNode = null, AdditionalCacheNodeProperties additionalCacheNodeProperties = null, string statusCode = null, string statusText = null, string statusDetails = null, string status = null, ResponseError error = null) + { + return new CacheNodeProperty( + provisioningState, + cacheNode, + additionalCacheNodeProperties, + statusCode, + statusText, + statusDetails, + status, + error, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Cache node resource Azure fully qualified resource Id. + /// Cache node resource customer resource GUID Id. + /// Cache node resource customer resource name. + /// Cache node resource Ip address. + /// Cache node resource customer index as string. + /// Cache node resource identifier of the cache node. + /// Cache node resource name. + /// Cache node resource customer resource Asn (autonomous system number). + /// Cache node resource flag for indicating if cache node is enabled. + /// Cache node resource maximum allowed egress in Mbps. + /// Cache node resource maximum allowed probability of egress. + /// Cache node resource Azure XCid. + /// Cache node resource flag for determining if managed by enterprise as boolean. + /// Cache node resource create async operation Id. + /// Cache node resource deletion async operation Id. + /// Cache node resource customer resource client tenant Id of subscription. + /// Cache node resource category. + /// Cache node resource release version. + /// Cache node resource last sync timestamp. + /// Cache node resource last backend updated timestamp. + /// Cache node resource attempts to sync with Azure. + /// Cache node resource container configuration details. + /// Cache node resource comma separated values of Cidrs. + /// Cache node resource last Cidr Csv update timestamp. + /// Cache node resource last Bgp Cidr Csv update timestamp. + /// Cache node resource last Bgp report timestamp. + /// Cache node resource Bgp review state string text in detail. + /// Cache node resource Bgp review state string text. + /// Cache node resource Bgp review feedback text. + /// Cache node resource Bgp update count. + /// Cache node resource Bgp record count. + /// Cache node resource Bgp block count. + /// Cache node resource total addressable space defined by Bgp and Cidr Csv blocks. + /// Cache node resource flag for determining if customer will be migrated. + /// Cache node resource bytes truncated from Bgp output file. + /// Cache node resource current Cidr range precedence selection type. + /// Cache node resource flag for indicating the cache node resource is frozen (not selectable, not editable in UI). + /// Cache node resource review process state as integer. + /// Cache node resource review state text. + /// Cache node resource review feedback text. + /// Cache node resource configuration state. + /// Cache node resource configuration state text. + /// Cache node resource total addressable space defined by the Cidr Csv block. + /// Cache node resource Mcc container deployment worker connection count. + /// Cache node resource last updated Mcc container deployment worker connection count timestamp. + /// Cache node resource Mcc container configuration details re-sync trigger. + /// Cache node resource Mcc Container Id Uri. + /// FQDN(fully qualified domain name) value of the mcc cache node. + /// Auto Update Ring Type which is slow or fast etc. + /// Customer requested week of month for mcc install of auto update cycle. + /// Customer requested day of week for mcc install of auto update cycle. + /// Customer requested time of the day for mcc install of auto update cycle, should be hh:mm. + /// A new instance for mocking. + public static CacheNodeEntity CacheNodeEntity(string fullyQualifiedResourceId = null, string customerId = null, string customerName = null, string ipAddress = null, string customerIndex = null, string cacheNodeId = null, string cacheNodeName = null, int? customerAsn = null, bool? isEnabled = null, int? maxAllowableEgressInMbps = null, float? maxAllowableProbability = null, string xCid = null, bool? isEnterpriseManaged = null, string createAsyncOperationId = null, string deleteAsyncOperationId = null, string clientTenantId = null, string category = null, int? releaseVersion = null, DateTimeOffset? lastSyncWithAzureTimestamp = null, DateTimeOffset? lastUpdatedTimestamp = null, int? synchWithAzureAttemptsCount = null, string containerConfigurations = null, IEnumerable cidrCsv = null, DateTimeOffset? cidrCsvLastUpdateOn = null, DateTimeOffset? bgpCidrCsvLastUpdateOn = null, DateTimeOffset? bgpLastReportedOn = null, string bgpReviewStateText = null, BgpReviewStateEnum? bgpReviewState = null, string bgpReviewFeedback = null, int? bgpNumberOfTimesUpdated = null, int? bgpNumberOfRecords = null, int? bgpCidrBlocksCount = null, int? bgpAddressSpace = null, bool? shouldMigrate = null, int? bgpFileBytesTruncated = null, int? cidrSelectionType = null, bool? isFrozen = null, int? reviewState = null, string reviewStateText = null, string reviewFeedback = null, ConfigurationState? configurationState = null, string configurationStateText = null, int? addressSpace = null, int? workerConnections = null, DateTimeOffset? workerConnectionsLastUpdatedOn = null, int? containerResyncTrigger = null, string imageUri = null, string fullyQualifiedDomainName = null, AutoUpdateRingType? autoUpdateRingType = null, int? autoUpdateRequestedWeek = null, int? autoUpdateRequestedDay = null, string autoUpdateRequestedTime = null) + { + cidrCsv ??= new List(); + + return new CacheNodeEntity( + fullyQualifiedResourceId, + customerId, + customerName, + ipAddress, + customerIndex, + cacheNodeId, + cacheNodeName, + customerAsn, + isEnabled, + maxAllowableEgressInMbps, + maxAllowableProbability, + xCid, + isEnterpriseManaged, + createAsyncOperationId, + deleteAsyncOperationId, + clientTenantId, + category, + releaseVersion, + lastSyncWithAzureTimestamp, + lastUpdatedTimestamp, + synchWithAzureAttemptsCount, + containerConfigurations, + cidrCsv?.ToList(), + cidrCsvLastUpdateOn, + bgpCidrCsvLastUpdateOn, + bgpLastReportedOn, + bgpReviewStateText, + bgpReviewState, + bgpReviewFeedback, + bgpNumberOfTimesUpdated, + bgpNumberOfRecords, + bgpCidrBlocksCount, + bgpAddressSpace, + shouldMigrate, + bgpFileBytesTruncated, + cidrSelectionType, + isFrozen, + reviewState, + reviewStateText, + reviewFeedback, + configurationState, + configurationStateText, + addressSpace, + workerConnections, + workerConnectionsLastUpdatedOn, + containerResyncTrigger, + imageUri, + fullyQualifiedDomainName, + autoUpdateRingType, + autoUpdateRequestedWeek, + autoUpdateRequestedDay, + autoUpdateRequestedTime, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// issues list to return the issues as part of the additional cache node properties. + /// current cache node issue list. + /// Number of cache node issues. + /// cache node current tls certificate. + /// cache node last auto update information. + /// Cache node resource aggregated status details. + /// Cache node resource aggregated status text. + /// Cache node resource aggregated status code. + /// Cache node resource Mcc product version. + /// Cache node resource flag indicating if cache node has been physically installed or provisioned on their physical lab. + /// Cache node resource detailed state text. + /// Cache node resource short state text. + /// Cache node resource state as integer. + /// Cache node resource drive configurations. + /// Cache node resource Bgp configuration. + /// proxyUrl configuration of the cache node. + /// Cache node resource requires a proxy. + /// Operating system of the cache node. + /// Auto update or fast update version. + /// Update related information details. + /// customer requested date time for mcc install of update cycle. + /// Auto update version that is the Next available version to update on mcc cache node. + /// Auto update last applied date time of mcc install. + /// Auto update version that is the applied to update on mcc cache node. + /// Auto Update status details from the backend after applying the new version details. + /// Last applied auto update state for mcc install of auto update cycle. + /// Auto update last applied date time of mcc install. + /// Auto update last triggered date time of mcc install. + /// Resource creation method of mcc cache node resource, cli or portal. + /// Cache node tls certificate status. + /// Optional property #1 of Mcc response object. + /// Optional property #2 of Mcc response object. + /// Optional property #3 of Mcc response object. + /// Optional property #4 of Mcc response object. + /// Optional property #5 of Mcc response object. + /// A new instance for mocking. + public static AdditionalCacheNodeProperties AdditionalCacheNodeProperties(IEnumerable cacheNodePropertiesDetailsIssuesList = null, IEnumerable issuesList = null, int? issuesCount = null, MccCacheNodeTlsCertificate currentTlsCertificate = null, MccCacheNodeAutoUpdateInfo lastAutoUpdateInfo = null, string aggregatedStatusDetails = null, string aggregatedStatusText = null, int? aggregatedStatusCode = null, string productVersion = null, bool? isProvisioned = null, string cacheNodeStateDetailedText = null, string cacheNodeStateShortText = null, int? cacheNodeState = null, IEnumerable driveConfiguration = null, string bgpAsnToIPAddressMapping = null, string proxyUri = null, ProxyRequired? isProxyRequired = null, OSType? osType = null, string autoUpdateVersion = null, string updateInfoDetails = null, DateTimeOffset? updateRequestedOn = null, string autoUpdateNextAvailableVersion = null, DateTimeOffset? autoUpdateNextAvailableOn = null, string autoUpdateAppliedVersion = null, string autoUpdateLastAppliedDetails = null, string autoUpdateLastAppliedState = null, DateTimeOffset? autoUpdateLastAppliedOn = null, DateTimeOffset? autoUpdateLastTriggeredOn = null, int? creationMethod = null, string tlsStatus = null, string optionalProperty1 = null, string optionalProperty2 = null, string optionalProperty3 = null, string optionalProperty4 = null, string optionalProperty5 = null) + { + cacheNodePropertiesDetailsIssuesList ??= new List(); + issuesList ??= new List(); + driveConfiguration ??= new List(); + + return new AdditionalCacheNodeProperties( + cacheNodePropertiesDetailsIssuesList?.ToList(), + issuesList?.ToList(), + issuesCount, + currentTlsCertificate, + lastAutoUpdateInfo, + aggregatedStatusDetails, + aggregatedStatusText, + aggregatedStatusCode, + productVersion, + isProvisioned, + cacheNodeStateDetailedText, + cacheNodeStateShortText, + cacheNodeState, + driveConfiguration?.ToList(), + bgpAsnToIPAddressMapping != null ? new BgpConfiguration(bgpAsnToIPAddressMapping, serializedAdditionalRawData: null) : null, + proxyUri != null ? new ProxyUrlConfiguration(proxyUri, serializedAdditionalRawData: null) : null, + isProxyRequired, + osType, + autoUpdateVersion, + updateInfoDetails, + updateRequestedOn, + autoUpdateNextAvailableVersion, + autoUpdateNextAvailableOn, + autoUpdateAppliedVersion, + autoUpdateLastAppliedDetails, + autoUpdateLastAppliedState, + autoUpdateLastAppliedOn, + autoUpdateLastTriggeredOn, + creationMethod, + tlsStatus, + optionalProperty1, + optionalProperty2, + optionalProperty3, + optionalProperty4, + optionalProperty5, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Mcc cache node Tls certificate status. + /// Mcc cache node Tls certificate file name. + /// Mcc cache node Tls certificate thumbprint. + /// Mcc cache node Tls certificate expiry date. + /// Mcc cache node Tls certificate not before date. + /// Mcc cache node Tls certificate subject name. + /// Mcc cache node Tls certificate subject alternate name. + /// A new instance for mocking. + public static MccCacheNodeTlsCertificate MccCacheNodeTlsCertificate(string actionRequired = null, string certificateFileName = null, string thumbprint = null, DateTimeOffset? expiryOn = null, DateTimeOffset? notBeforeOn = null, string subject = null, string subjectAltName = null) + { + return new MccCacheNodeTlsCertificate( + actionRequired, + certificateFileName, + thumbprint, + expiryOn, + notBeforeOn, + subject, + subjectAltName, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Auto update image uri before update. + /// Auto update image uri targetted to update. + /// Auto update image uri at Terminal. + /// Auto update Ring Type. + /// Auto update image uri after update. + /// Auto update image uri before update. + /// Auto update image uri after update. + /// Auto update entity created datetime. + /// Auto update entity last updated datetime. + /// This text describing the purpose of the plan of auto update. + /// Auto update last applied status. + /// Auto update last applied status text. + /// Auto update last applied detailed status text. + /// Auto update planId. + /// Auto update time to go live date time. + /// Auto update rule requested minute. + /// Auto update rule requested hour. + /// A new instance for mocking. + public static MccCacheNodeAutoUpdateInfo MccCacheNodeAutoUpdateInfo(string imageUriBeforeUpdate = null, string imageUriTargeted = null, string imageUriTerminal = null, int? autoUpdateRingType = null, DateTimeOffset? movedToTerminalStateOn = null, int? ruleRequestedWeek = null, int? ruleRequestedDay = null, DateTimeOffset? createdDateTimeUtc = null, DateTimeOffset? updatedRegistryDateTimeUtc = null, string planChangeLogText = null, int? autoUpdateLastAppliedStatus = null, string autoUpdateLastAppliedStatusText = null, string autoUpdateLastAppliedStatusDetailedText = null, long? planId = null, string timeToGoLiveDateTime = null, string ruleRequestedMinute = null, string ruleRequestedHour = null) + { + return new MccCacheNodeAutoUpdateInfo( + imageUriBeforeUpdate, + imageUriTargeted, + imageUriTerminal, + autoUpdateRingType, + movedToTerminalStateOn, + ruleRequestedWeek, + ruleRequestedDay, + createdDateTimeUtc, + updatedRegistryDateTimeUtc, + planChangeLogText, + autoUpdateLastAppliedStatus, + autoUpdateLastAppliedStatusText, + autoUpdateLastAppliedStatusDetailedText, + planId, + timeToGoLiveDateTime, + ruleRequestedMinute, + ruleRequestedHour, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Mcc cache node resource Bgp Cidr properties. + /// Resource tags. + /// The geo-location where the resource lives. + /// A new instance for mocking. + public static MccCacheNodeBgpCidrDetails MccCacheNodeBgpCidrDetails(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable bgpCidrs = null, IReadOnlyDictionary tags = null, string location = null) + { + bgpCidrs ??= new List(); + tags ??= new Dictionary(); + + return new MccCacheNodeBgpCidrDetails( + id, + name, + resourceType, + systemData, + bgpCidrs != null ? new BgpCidrsConfiguration(bgpCidrs?.ToList(), serializedAdditionalRawData: null) : null, + tags, + location, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Mcc cache node resource install script details. + /// Resource tags. + /// The geo-location where the resource lives. + /// A new instance for mocking. + public static MccCacheNodeInstallDetails MccCacheNodeInstallDetails(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, CacheNodeInstallProperties properties = null, IReadOnlyDictionary tags = null, string location = null) + { + tags ??= new Dictionary(); + + return new MccCacheNodeInstallDetails( + id, + name, + resourceType, + systemData, + properties, + tags, + location, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Mcc customer resource Id. + /// Mcc cache node resource Id. + /// Mcc primary account key. Internal to Mcc. + /// Mcc secondary account key. Internal to Mcc. + /// Mcc Iot Central temporary device registration key, used once. + /// Mcc Tls certificate provisioning key. + /// Cache node resource drive configurations. + /// proxyUrl configuration of the cache node. + /// A new instance for mocking. + public static CacheNodeInstallProperties CacheNodeInstallProperties(string customerId = null, string cacheNodeId = null, string primaryAccountKey = null, string secondaryAccountKey = null, string registrationKey = null, string tlsCertificateProvisioningKey = null, IEnumerable driveConfiguration = null, string proxyUri = null) + { + driveConfiguration ??= new List(); + + return new CacheNodeInstallProperties( + customerId, + cacheNodeId, + primaryAccountKey, + secondaryAccountKey, + registrationKey, + tlsCertificateProvisioningKey, + driveConfiguration?.ToList(), + proxyUri != null ? new ProxyUrlConfiguration(proxyUri, serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Mcc cache node resource auto update history properties. + /// Resource tags. + /// The geo-location where the resource lives. + /// A new instance for mocking. + public static MccCacheNodeAutoUpdateHistory MccCacheNodeAutoUpdateHistory(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MccCacheNodeAutoUpdateHistoryProperties properties = null, IReadOnlyDictionary tags = null, string location = null) + { + tags ??= new Dictionary(); + + return new MccCacheNodeAutoUpdateHistory( + id, + name, + resourceType, + systemData, + properties, + tags, + location, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Mcc customer resource Id. + /// Mcc cache node resource Id. + /// Cache node resource auto update history information. + /// A new instance for mocking. + public static MccCacheNodeAutoUpdateHistoryProperties MccCacheNodeAutoUpdateHistoryProperties(string customerId = null, string cacheNodeId = null, IEnumerable autoUpdateHistory = null) + { + autoUpdateHistory ??= new List(); + + return new MccCacheNodeAutoUpdateHistoryProperties(customerId, cacheNodeId, autoUpdateHistory?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Mcc cache node resource issue history properties. + /// Resource tags. + /// The geo-location where the resource lives. + /// A new instance for mocking. + public static MccCacheNodeIssueHistory MccCacheNodeIssueHistory(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MccCacheNodeIssueHistoryProperties properties = null, IReadOnlyDictionary tags = null, string location = null) + { + tags ??= new Dictionary(); + + return new MccCacheNodeIssueHistory( + id, + name, + resourceType, + systemData, + properties, + tags, + location, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Mcc customer resource Id. + /// Mcc cache node resource Id. + /// Cache node resource issue details history. + /// A new instance for mocking. + public static MccCacheNodeIssueHistoryProperties MccCacheNodeIssueHistoryProperties(string customerId = null, string cacheNodeId = null, IEnumerable mccIssueHistory = null) + { + mccIssueHistory ??= new List(); + + return new MccCacheNodeIssueHistoryProperties(customerId, cacheNodeId, mccIssueHistory?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Mcc cache node issue type. + /// Mcc cache node issues toastString. + /// Mcc cache node issue detail string. + /// Mcc cache node issue related help link. + /// Mcc cache node issue start date. + /// Mcc cache node issue end date. + /// A new instance for mocking. + public static MccIssue MccIssue(string mccIssueType = null, string toastString = null, string detailString = null, string helpLink = null, DateTimeOffset? issueStartOn = null, DateTimeOffset? issueEndOn = null) + { + return new MccIssue( + mccIssueType, + toastString, + detailString, + helpLink, + issueStartOn, + issueEndOn, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static EnterpriseMccCustomerResourceData EnterpriseMccCustomerResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CustomerProperty properties = null) + { + tags ??= new Dictionary(); + + return new EnterpriseMccCustomerResourceData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static EnterpriseMccCacheNodeResourceData EnterpriseMccCacheNodeResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CacheNodeProperty properties = null) + { + tags ??= new Dictionary(); + + return new EnterpriseMccCacheNodeResourceData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Mcc cache node resource Tls certificate details. + /// Resource tags. + /// The geo-location where the resource lives. + /// A new instance for mocking. + public static MccCacheNodeTlsCertificateHistory MccCacheNodeTlsCertificateHistory(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MccCacheNodeTlsCertificateProperties properties = null, IReadOnlyDictionary tags = null, string location = null) + { + tags ??= new Dictionary(); + + return new MccCacheNodeTlsCertificateHistory( + id, + name, + resourceType, + systemData, + properties, + tags, + location, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Mcc customer resource Id. + /// Mcc cache node resource Id. + /// Cache node resource tls certificate history details. + /// A new instance for mocking. + public static MccCacheNodeTlsCertificateProperties MccCacheNodeTlsCertificateProperties(string customerId = null, string cacheNodeId = null, IEnumerable tlsCertificateHistory = null) + { + tlsCertificateHistory ??= new List(); + + return new MccCacheNodeTlsCertificateProperties(customerId, cacheNodeId, tlsCertificateHistory?.ToList(), serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCacheNodeResource.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCacheNodeResource.Serialization.cs new file mode 100644 index 000000000000..cc4359381e3a --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCacheNodeResource.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.ConnectedCache +{ + public partial class EnterpriseMccCacheNodeResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + EnterpriseMccCacheNodeResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + EnterpriseMccCacheNodeResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCacheNodeResource.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCacheNodeResource.cs new file mode 100644 index 000000000000..13d430abc682 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCacheNodeResource.cs @@ -0,0 +1,1003 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ConnectedCache.Models; + +namespace Azure.ResourceManager.ConnectedCache +{ + /// + /// A Class representing an EnterpriseMccCacheNodeResource along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetEnterpriseMccCacheNodeResource method. + /// Otherwise you can get one from its parent resource using the GetEnterpriseMccCacheNodeResource method. + /// + public partial class EnterpriseMccCacheNodeResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The customerResourceName. + /// The cacheNodeResourceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics; + private readonly EnterpriseMccCacheNodesRestOperations _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient; + private readonly EnterpriseMccCacheNodeResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ConnectedCache/enterpriseMccCustomers/enterpriseMccCacheNodes"; + + /// Initializes a new instance of the class for mocking. + protected EnterpriseMccCacheNodeResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal EnterpriseMccCacheNodeResource(ArmClient client, EnterpriseMccCacheNodeResourceData 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 EnterpriseMccCacheNodeResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ConnectedCache", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsApiVersion); + _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient = new EnterpriseMccCacheNodesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsApiVersion); +#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 EnterpriseMccCacheNodeResourceData 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)); + } + + /// + /// This api gets ispCacheNode resource information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResource.Get"); + scope.Start(); + try + { + var response = await _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.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 EnterpriseMccCacheNodeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api gets ispCacheNode resource information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResource.Get"); + scope.Start(); + try + { + var response = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EnterpriseMccCacheNodeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api deletes an existing ispCacheNode resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodeResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-30-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 = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResource.Delete"); + scope.Start(); + try + { + var response = await _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ConnectedCacheArmOperation(_enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics, Pipeline, _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api deletes an existing ispCacheNode resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodeResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-30-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 = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResource.Delete"); + scope.Start(); + try + { + var response = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ConnectedCacheArmOperation(_enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics, Pipeline, _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api updates an existing ispCacheNode resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodeResource_Update + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(ConnectedCachePatchContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResource.Update"); + scope.Start(); + try + { + var response = await _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new EnterpriseMccCacheNodeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api updates an existing ispCacheNode resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodeResource_Update + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual Response Update(ConnectedCachePatchContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResource.Update"); + scope.Start(); + try + { + var response = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + return Response.FromValue(new EnterpriseMccCacheNodeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api gets secrets of the ispCacheNode resource install details + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}/getCacheNodeInstallDetails + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodesOperations_GetCacheNodeInstallDetails + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetCacheNodeInstallDetailsAsync(CancellationToken cancellationToken = default) + { + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResource.GetCacheNodeInstallDetails"); + scope.Start(); + try + { + var response = await _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.GetCacheNodeInstallDetailsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api gets secrets of the ispCacheNode resource install details + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}/getCacheNodeInstallDetails + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodesOperations_GetCacheNodeInstallDetails + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetCacheNodeInstallDetails(CancellationToken cancellationToken = default) + { + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResource.GetCacheNodeInstallDetails"); + scope.Start(); + try + { + var response = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.GetCacheNodeInstallDetails(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api gets ispCacheNode resource auto update histrory information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}/getCacheNodeAutoUpdateHistory + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodesOperations_GetCacheNodeAutoUpdateHistory + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetCacheNodeAutoUpdateHistoryAsync(CancellationToken cancellationToken = default) + { + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResource.GetCacheNodeAutoUpdateHistory"); + scope.Start(); + try + { + var response = await _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.GetCacheNodeAutoUpdateHistoryAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api gets ispCacheNode resource auto update histrory information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}/getCacheNodeAutoUpdateHistory + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodesOperations_GetCacheNodeAutoUpdateHistory + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetCacheNodeAutoUpdateHistory(CancellationToken cancellationToken = default) + { + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResource.GetCacheNodeAutoUpdateHistory"); + scope.Start(); + try + { + var response = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.GetCacheNodeAutoUpdateHistory(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api gets ispCacheNode resource issues details histrory information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}/getCacheNodeMccIssueDetailsHistory + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodesOperations_GetCacheNodeMccIssueDetailsHistory + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetCacheNodeMccIssueDetailsHistoryAsync(CancellationToken cancellationToken = default) + { + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResource.GetCacheNodeMccIssueDetailsHistory"); + scope.Start(); + try + { + var response = await _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.GetCacheNodeMccIssueDetailsHistoryAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api gets ispCacheNode resource issues details histrory information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}/getCacheNodeMccIssueDetailsHistory + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodesOperations_GetCacheNodeMccIssueDetailsHistory + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetCacheNodeMccIssueDetailsHistory(CancellationToken cancellationToken = default) + { + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResource.GetCacheNodeMccIssueDetailsHistory"); + scope.Start(); + try + { + var response = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.GetCacheNodeMccIssueDetailsHistory(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api gets ispCacheNode resource tls certificate histrory information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}/getCacheNodeTlsCertificateHistory + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodesOperations_GetCacheNodeTlsCertificateHistory + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetCacheNodeTlsCertificateHistoryAsync(CancellationToken cancellationToken = default) + { + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResource.GetCacheNodeTlsCertificateHistory"); + scope.Start(); + try + { + var response = await _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.GetCacheNodeTlsCertificateHistoryAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api gets ispCacheNode resource tls certificate histrory information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName}/getCacheNodeTlsCertificateHistory + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodesOperations_GetCacheNodeTlsCertificateHistory + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetCacheNodeTlsCertificateHistory(CancellationToken cancellationToken = default) + { + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResource.GetCacheNodeTlsCertificateHistory"); + scope.Start(); + try + { + var response = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.GetCacheNodeTlsCertificateHistory(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new EnterpriseMccCacheNodeResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ConnectedCachePatchContent(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new EnterpriseMccCacheNodeResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ConnectedCachePatchContent(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new EnterpriseMccCacheNodeResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ConnectedCachePatchContent(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new EnterpriseMccCacheNodeResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ConnectedCachePatchContent(); + patch.Tags.ReplaceWith(tags); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new EnterpriseMccCacheNodeResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ConnectedCachePatchContent(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new EnterpriseMccCacheNodeResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ConnectedCachePatchContent(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCacheNodeResourceCollection.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCacheNodeResourceCollection.cs new file mode 100644 index 000000000000..657f972f225c --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCacheNodeResourceCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ConnectedCache +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetEnterpriseMccCacheNodeResources method from an instance of . + /// + public partial class EnterpriseMccCacheNodeResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics; + private readonly EnterpriseMccCacheNodesRestOperations _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected EnterpriseMccCacheNodeResourceCollection() + { + } + + /// 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 EnterpriseMccCacheNodeResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ConnectedCache", EnterpriseMccCacheNodeResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(EnterpriseMccCacheNodeResource.ResourceType, out string enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsApiVersion); + _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient = new EnterpriseMccCacheNodesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != EnterpriseMccCustomerResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, EnterpriseMccCustomerResource.ResourceType), nameof(id)); + } + + /// + /// This api creates an ispCacheNode with the specified create parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodeResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-30-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. + /// Name of the ConnectedCache resource. + /// 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 cacheNodeResourceName, EnterpriseMccCacheNodeResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheNodeResourceName, data, cancellationToken).ConfigureAwait(false); + var operation = new ConnectedCacheArmOperation(new EnterpriseMccCacheNodeResourceOperationSource(Client), _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics, Pipeline, _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheNodeResourceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api creates an ispCacheNode with the specified create parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodeResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-30-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. + /// Name of the ConnectedCache resource. + /// 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 cacheNodeResourceName, EnterpriseMccCacheNodeResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheNodeResourceName, data, cancellationToken); + var operation = new ConnectedCacheArmOperation(new EnterpriseMccCacheNodeResourceOperationSource(Client), _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics, Pipeline, _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheNodeResourceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api gets ispCacheNode resource information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResourceCollection.Get"); + scope.Start(); + try + { + var response = await _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheNodeResourceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EnterpriseMccCacheNodeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api gets ispCacheNode resource information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResourceCollection.Get"); + scope.Start(); + try + { + var response = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheNodeResourceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EnterpriseMccCacheNodeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api retrieves information about all ispCacheNode resources under the given subscription and resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodeResource_ListByEnterpriseMccCustomerResource + /// + /// + /// Default Api Version + /// 2024-11-30-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) => _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.CreateListByEnterpriseMccCustomerResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.CreateListByEnterpriseMccCustomerResourceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EnterpriseMccCacheNodeResource(Client, EnterpriseMccCacheNodeResourceData.DeserializeEnterpriseMccCacheNodeResourceData(e)), _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics, Pipeline, "EnterpriseMccCacheNodeResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// This api retrieves information about all ispCacheNode resources under the given subscription and resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodeResource_ListByEnterpriseMccCustomerResource + /// + /// + /// Default Api Version + /// 2024-11-30-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) => _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.CreateListByEnterpriseMccCustomerResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.CreateListByEnterpriseMccCustomerResourceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EnterpriseMccCacheNodeResource(Client, EnterpriseMccCacheNodeResourceData.DeserializeEnterpriseMccCacheNodeResourceData(e)), _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics, Pipeline, "EnterpriseMccCacheNodeResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheNodeResourceName, 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.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResourceCollection.Exists"); + scope.Start(); + try + { + var response = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheNodeResourceName, 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.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheNodeResourceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new EnterpriseMccCacheNodeResource(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.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var scope = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsClientDiagnostics.CreateScope("EnterpriseMccCacheNodeResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _enterpriseMccCacheNodeResourceEnterpriseMccCacheNodesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheNodeResourceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new EnterpriseMccCacheNodeResource(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/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCacheNodeResourceData.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCacheNodeResourceData.Serialization.cs new file mode 100644 index 000000000000..2845f8df7c9e --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCacheNodeResourceData.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; +using Azure.ResourceManager.ConnectedCache.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ConnectedCache +{ + public partial class EnterpriseMccCacheNodeResourceData : 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(EnterpriseMccCacheNodeResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + EnterpriseMccCacheNodeResourceData 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(EnterpriseMccCacheNodeResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEnterpriseMccCacheNodeResourceData(document.RootElement, options); + } + + internal static EnterpriseMccCacheNodeResourceData DeserializeEnterpriseMccCacheNodeResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CacheNodeProperty properties = default; + IDictionary tags = default; + AzureLocation location = 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 = CacheNodeProperty.DeserializeCacheNodeProperty(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EnterpriseMccCacheNodeResourceData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + 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(EnterpriseMccCacheNodeResourceData)} does not support writing '{options.Format}' format."); + } + } + + EnterpriseMccCacheNodeResourceData 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 DeserializeEnterpriseMccCacheNodeResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EnterpriseMccCacheNodeResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCacheNodeResourceData.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCacheNodeResourceData.cs new file mode 100644 index 000000000000..a6023d71f9ca --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCacheNodeResourceData.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ConnectedCache.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ConnectedCache +{ + /// + /// A class representing the EnterpriseMccCacheNodeResource data model. + /// Represents the high level Nodes needed to provision cache node resources + /// + public partial class EnterpriseMccCacheNodeResourceData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public EnterpriseMccCacheNodeResourceData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal EnterpriseMccCacheNodeResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CacheNodeProperty properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EnterpriseMccCacheNodeResourceData() + { + } + + /// The resource-specific properties for this resource. + public CacheNodeProperty Properties { get; set; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCustomerResource.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCustomerResource.Serialization.cs new file mode 100644 index 000000000000..f6cb09bfefe8 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCustomerResource.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.ConnectedCache +{ + public partial class EnterpriseMccCustomerResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + EnterpriseMccCustomerResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + EnterpriseMccCustomerResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCustomerResource.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCustomerResource.cs new file mode 100644 index 000000000000..7d4c8b176d31 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCustomerResource.cs @@ -0,0 +1,768 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ConnectedCache.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ConnectedCache +{ + /// + /// A Class representing an EnterpriseMccCustomerResource along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetEnterpriseMccCustomerResource method. + /// Otherwise you can get one from its parent resource using the GetEnterpriseMccCustomerResource method. + /// + public partial class EnterpriseMccCustomerResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The customerResourceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string customerResourceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics; + private readonly EnterpriseMccCustomersRestOperations _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient; + private readonly EnterpriseMccCustomerResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ConnectedCache/enterpriseMccCustomers"; + + /// Initializes a new instance of the class for mocking. + protected EnterpriseMccCustomerResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal EnterpriseMccCustomerResource(ArmClient client, EnterpriseMccCustomerResourceData 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 EnterpriseMccCustomerResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ConnectedCache", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string enterpriseMccCustomerResourceEnterpriseMccCustomersApiVersion); + _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient = new EnterpriseMccCustomersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, enterpriseMccCustomerResourceEnterpriseMccCustomersApiVersion); +#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 EnterpriseMccCustomerResourceData 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 EnterpriseMccCacheNodeResources in the EnterpriseMccCustomerResource. + /// An object representing collection of EnterpriseMccCacheNodeResources and their operations over a EnterpriseMccCacheNodeResource. + public virtual EnterpriseMccCacheNodeResourceCollection GetEnterpriseMccCacheNodeResources() + { + return GetCachedClient(client => new EnterpriseMccCacheNodeResourceCollection(client, Id)); + } + + /// + /// This api gets ispCacheNode resource information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetEnterpriseMccCacheNodeResourceAsync(string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + return await GetEnterpriseMccCacheNodeResources().GetAsync(cacheNodeResourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// This api gets ispCacheNode resource information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName}/enterpriseMccCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetEnterpriseMccCacheNodeResource(string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + return GetEnterpriseMccCacheNodeResources().Get(cacheNodeResourceName, cancellationToken); + } + + /// + /// Gets the enterprise mcc customer resource information using this get call + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics.CreateScope("EnterpriseMccCustomerResource.Get"); + scope.Start(); + try + { + var response = await _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EnterpriseMccCustomerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the enterprise mcc customer resource information using this get call + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics.CreateScope("EnterpriseMccCustomerResource.Get"); + scope.Start(); + try + { + var response = _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EnterpriseMccCustomerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api deletes an existing enterprise mcc customer resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-30-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 = _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics.CreateScope("EnterpriseMccCustomerResource.Delete"); + scope.Start(); + try + { + var response = await _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ConnectedCacheArmOperation(_enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics, Pipeline, _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api deletes an existing enterprise mcc customer resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-30-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 = _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics.CreateScope("EnterpriseMccCustomerResource.Delete"); + scope.Start(); + try + { + var response = _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new ConnectedCacheArmOperation(_enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics, Pipeline, _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api updates an existing enterprise mcc customer resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_Update + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(ConnectedCachePatchContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics.CreateScope("EnterpriseMccCustomerResource.Update"); + scope.Start(); + try + { + var response = await _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new EnterpriseMccCustomerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api updates an existing enterprise mcc customer resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_Update + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual Response Update(ConnectedCachePatchContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics.CreateScope("EnterpriseMccCustomerResource.Update"); + scope.Start(); + try + { + var response = _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + return Response.FromValue(new EnterpriseMccCustomerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics.CreateScope("EnterpriseMccCustomerResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new EnterpriseMccCustomerResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ConnectedCachePatchContent(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics.CreateScope("EnterpriseMccCustomerResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new EnterpriseMccCustomerResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ConnectedCachePatchContent(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics.CreateScope("EnterpriseMccCustomerResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new EnterpriseMccCustomerResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ConnectedCachePatchContent(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics.CreateScope("EnterpriseMccCustomerResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new EnterpriseMccCustomerResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ConnectedCachePatchContent(); + patch.Tags.ReplaceWith(tags); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics.CreateScope("EnterpriseMccCustomerResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new EnterpriseMccCustomerResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ConnectedCachePatchContent(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics.CreateScope("EnterpriseMccCustomerResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new EnterpriseMccCustomerResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ConnectedCachePatchContent(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCustomerResourceCollection.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCustomerResourceCollection.cs new file mode 100644 index 000000000000..89d449b99122 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCustomerResourceCollection.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ConnectedCache +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetEnterpriseMccCustomerResources method from an instance of . + /// + public partial class EnterpriseMccCustomerResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics; + private readonly EnterpriseMccCustomersRestOperations _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient; + + /// Initializes a new instance of the class for mocking. + protected EnterpriseMccCustomerResourceCollection() + { + } + + /// 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 EnterpriseMccCustomerResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ConnectedCache", EnterpriseMccCustomerResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(EnterpriseMccCustomerResource.ResourceType, out string enterpriseMccCustomerResourceEnterpriseMccCustomersApiVersion); + _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient = new EnterpriseMccCustomersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, enterpriseMccCustomerResourceEnterpriseMccCustomersApiVersion); +#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)); + } + + /// + /// This api creates an enterprise mcc customer with the specified create parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-30-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. + /// Name of the Customer resource. + /// 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 customerResourceName, EnterpriseMccCustomerResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics.CreateScope("EnterpriseMccCustomerResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, customerResourceName, data, cancellationToken).ConfigureAwait(false); + var operation = new ConnectedCacheArmOperation(new EnterpriseMccCustomerResourceOperationSource(Client), _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics, Pipeline, _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, customerResourceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api creates an enterprise mcc customer with the specified create parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-30-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. + /// Name of the Customer resource. + /// 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 customerResourceName, EnterpriseMccCustomerResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics.CreateScope("EnterpriseMccCustomerResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, customerResourceName, data, cancellationToken); + var operation = new ConnectedCacheArmOperation(new EnterpriseMccCustomerResourceOperationSource(Client), _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics, Pipeline, _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, customerResourceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the enterprise mcc customer resource information using this get call + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Customer resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var scope = _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics.CreateScope("EnterpriseMccCustomerResourceCollection.Get"); + scope.Start(); + try + { + var response = await _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, customerResourceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EnterpriseMccCustomerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the enterprise mcc customer resource information using this get call + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Customer resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var scope = _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics.CreateScope("EnterpriseMccCustomerResourceCollection.Get"); + scope.Start(); + try + { + var response = _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, customerResourceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EnterpriseMccCustomerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api gets the information about all enterprise mcc customer resources under the given subscription and resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-30-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) => _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EnterpriseMccCustomerResource(Client, EnterpriseMccCustomerResourceData.DeserializeEnterpriseMccCustomerResourceData(e)), _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics, Pipeline, "EnterpriseMccCustomerResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// This api gets the information about all enterprise mcc customer resources under the given subscription and resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-30-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) => _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EnterpriseMccCustomerResource(Client, EnterpriseMccCustomerResourceData.DeserializeEnterpriseMccCustomerResourceData(e)), _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics, Pipeline, "EnterpriseMccCustomerResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Customer resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var scope = _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics.CreateScope("EnterpriseMccCustomerResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, customerResourceName, 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.ConnectedCache/enterpriseMccCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Customer resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var scope = _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics.CreateScope("EnterpriseMccCustomerResourceCollection.Exists"); + scope.Start(); + try + { + var response = _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, customerResourceName, 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.ConnectedCache/enterpriseMccCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Customer resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var scope = _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics.CreateScope("EnterpriseMccCustomerResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, customerResourceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new EnterpriseMccCustomerResource(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.ConnectedCache/enterpriseMccCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Customer resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var scope = _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics.CreateScope("EnterpriseMccCustomerResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, customerResourceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new EnterpriseMccCustomerResource(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/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCustomerResourceData.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCustomerResourceData.Serialization.cs new file mode 100644 index 000000000000..de7fcee94d06 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCustomerResourceData.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; +using Azure.ResourceManager.ConnectedCache.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ConnectedCache +{ + public partial class EnterpriseMccCustomerResourceData : 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(EnterpriseMccCustomerResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + EnterpriseMccCustomerResourceData 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(EnterpriseMccCustomerResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEnterpriseMccCustomerResourceData(document.RootElement, options); + } + + internal static EnterpriseMccCustomerResourceData DeserializeEnterpriseMccCustomerResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CustomerProperty properties = default; + IDictionary tags = default; + AzureLocation location = 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 = CustomerProperty.DeserializeCustomerProperty(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EnterpriseMccCustomerResourceData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + 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(EnterpriseMccCustomerResourceData)} does not support writing '{options.Format}' format."); + } + } + + EnterpriseMccCustomerResourceData 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 DeserializeEnterpriseMccCustomerResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EnterpriseMccCustomerResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCustomerResourceData.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCustomerResourceData.cs new file mode 100644 index 000000000000..d62d9b9132cd --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/EnterpriseMccCustomerResourceData.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ConnectedCache.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ConnectedCache +{ + /// + /// A class representing the EnterpriseMccCustomerResource data model. + /// Represents the high level Nodes needed to provision customer resources + /// + public partial class EnterpriseMccCustomerResourceData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public EnterpriseMccCustomerResourceData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal EnterpriseMccCustomerResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CustomerProperty properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EnterpriseMccCustomerResourceData() + { + } + + /// The resource-specific properties for this resource. + public CustomerProperty Properties { get; set; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Extensions/ConnectedCacheExtensions.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Extensions/ConnectedCacheExtensions.cs new file mode 100644 index 000000000000..edf70e9d6fea --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Extensions/ConnectedCacheExtensions.cs @@ -0,0 +1,441 @@ +// 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.ConnectedCache.Mocking; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ConnectedCache +{ + /// A class to add extension methods to Azure.ResourceManager.ConnectedCache. + public static partial class ConnectedCacheExtensions + { + private static MockableConnectedCacheArmClient GetMockableConnectedCacheArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableConnectedCacheArmClient(client0)); + } + + private static MockableConnectedCacheResourceGroupResource GetMockableConnectedCacheResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableConnectedCacheResourceGroupResource(client, resource.Id)); + } + + private static MockableConnectedCacheSubscriptionResource GetMockableConnectedCacheSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableConnectedCacheSubscriptionResource(client, resource.Id)); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static IspCustomerResource GetIspCustomerResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableConnectedCacheArmClient(client).GetIspCustomerResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static IspCacheNodeResource GetIspCacheNodeResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableConnectedCacheArmClient(client).GetIspCacheNodeResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static EnterpriseMccCustomerResource GetEnterpriseMccCustomerResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableConnectedCacheArmClient(client).GetEnterpriseMccCustomerResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static EnterpriseMccCacheNodeResource GetEnterpriseMccCacheNodeResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableConnectedCacheArmClient(client).GetEnterpriseMccCacheNodeResource(id); + } + + /// + /// Gets a collection of IspCustomerResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of IspCustomerResources and their operations over a IspCustomerResource. + public static IspCustomerResourceCollection GetIspCustomerResources(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableConnectedCacheResourceGroupResource(resourceGroupResource).GetIspCustomerResources(); + } + + /// + /// Gets the ispCustomer resource information using this get call + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// IspCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the Customer resource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetIspCustomerResourceAsync(this ResourceGroupResource resourceGroupResource, string customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableConnectedCacheResourceGroupResource(resourceGroupResource).GetIspCustomerResourceAsync(customerResourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the ispCustomer resource information using this get call + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// IspCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the Customer resource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetIspCustomerResource(this ResourceGroupResource resourceGroupResource, string customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableConnectedCacheResourceGroupResource(resourceGroupResource).GetIspCustomerResource(customerResourceName, cancellationToken); + } + + /// + /// Gets a collection of EnterpriseMccCustomerResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of EnterpriseMccCustomerResources and their operations over a EnterpriseMccCustomerResource. + public static EnterpriseMccCustomerResourceCollection GetEnterpriseMccCustomerResources(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableConnectedCacheResourceGroupResource(resourceGroupResource).GetEnterpriseMccCustomerResources(); + } + + /// + /// Gets the enterprise mcc customer resource information using this get call + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the Customer resource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetEnterpriseMccCustomerResourceAsync(this ResourceGroupResource resourceGroupResource, string customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableConnectedCacheResourceGroupResource(resourceGroupResource).GetEnterpriseMccCustomerResourceAsync(customerResourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the enterprise mcc customer resource information using this get call + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the Customer resource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetEnterpriseMccCustomerResource(this ResourceGroupResource resourceGroupResource, string customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableConnectedCacheResourceGroupResource(resourceGroupResource).GetEnterpriseMccCustomerResource(customerResourceName, cancellationToken); + } + + /// + /// This api gets information about all ispCustomer resources under the given subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ConnectedCache/ispCustomers + /// + /// + /// Operation Id + /// IspCustomerResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetIspCustomerResourcesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableConnectedCacheSubscriptionResource(subscriptionResource).GetIspCustomerResourcesAsync(cancellationToken); + } + + /// + /// This api gets information about all ispCustomer resources under the given subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ConnectedCache/ispCustomers + /// + /// + /// Operation Id + /// IspCustomerResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetIspCustomerResources(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableConnectedCacheSubscriptionResource(subscriptionResource).GetIspCustomerResources(cancellationToken); + } + + /// + /// This api gets information about all enterpriseMccCustomer resources under the given subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetEnterpriseMccCustomerResourcesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableConnectedCacheSubscriptionResource(subscriptionResource).GetEnterpriseMccCustomerResourcesAsync(cancellationToken); + } + + /// + /// This api gets information about all enterpriseMccCustomer resources under the given subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetEnterpriseMccCustomerResources(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableConnectedCacheSubscriptionResource(subscriptionResource).GetEnterpriseMccCustomerResources(cancellationToken); + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Extensions/MockableConnectedCacheArmClient.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Extensions/MockableConnectedCacheArmClient.cs new file mode 100644 index 000000000000..a61485a46b30 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Extensions/MockableConnectedCacheArmClient.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.ConnectedCache.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableConnectedCacheArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableConnectedCacheArmClient() + { + } + + /// 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 MockableConnectedCacheArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableConnectedCacheArmClient(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IspCustomerResource GetIspCustomerResource(ResourceIdentifier id) + { + IspCustomerResource.ValidateResourceId(id); + return new IspCustomerResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IspCacheNodeResource GetIspCacheNodeResource(ResourceIdentifier id) + { + IspCacheNodeResource.ValidateResourceId(id); + return new IspCacheNodeResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EnterpriseMccCustomerResource GetEnterpriseMccCustomerResource(ResourceIdentifier id) + { + EnterpriseMccCustomerResource.ValidateResourceId(id); + return new EnterpriseMccCustomerResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EnterpriseMccCacheNodeResource GetEnterpriseMccCacheNodeResource(ResourceIdentifier id) + { + EnterpriseMccCacheNodeResource.ValidateResourceId(id); + return new EnterpriseMccCacheNodeResource(Client, id); + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Extensions/MockableConnectedCacheResourceGroupResource.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Extensions/MockableConnectedCacheResourceGroupResource.cs new file mode 100644 index 000000000000..b931a0c52c55 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Extensions/MockableConnectedCacheResourceGroupResource.cs @@ -0,0 +1,174 @@ +// 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.ConnectedCache.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableConnectedCacheResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableConnectedCacheResourceGroupResource() + { + } + + /// 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 MockableConnectedCacheResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of IspCustomerResources in the ResourceGroupResource. + /// An object representing collection of IspCustomerResources and their operations over a IspCustomerResource. + public virtual IspCustomerResourceCollection GetIspCustomerResources() + { + return GetCachedClient(client => new IspCustomerResourceCollection(client, Id)); + } + + /// + /// Gets the ispCustomer resource information using this get call + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// IspCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Customer resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetIspCustomerResourceAsync(string customerResourceName, CancellationToken cancellationToken = default) + { + return await GetIspCustomerResources().GetAsync(customerResourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the ispCustomer resource information using this get call + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// IspCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Customer resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetIspCustomerResource(string customerResourceName, CancellationToken cancellationToken = default) + { + return GetIspCustomerResources().Get(customerResourceName, cancellationToken); + } + + /// Gets a collection of EnterpriseMccCustomerResources in the ResourceGroupResource. + /// An object representing collection of EnterpriseMccCustomerResources and their operations over a EnterpriseMccCustomerResource. + public virtual EnterpriseMccCustomerResourceCollection GetEnterpriseMccCustomerResources() + { + return GetCachedClient(client => new EnterpriseMccCustomerResourceCollection(client, Id)); + } + + /// + /// Gets the enterprise mcc customer resource information using this get call + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Customer resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetEnterpriseMccCustomerResourceAsync(string customerResourceName, CancellationToken cancellationToken = default) + { + return await GetEnterpriseMccCustomerResources().GetAsync(customerResourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the enterprise mcc customer resource information using this get call + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Customer resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetEnterpriseMccCustomerResource(string customerResourceName, CancellationToken cancellationToken = default) + { + return GetEnterpriseMccCustomerResources().Get(customerResourceName, cancellationToken); + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Extensions/MockableConnectedCacheSubscriptionResource.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Extensions/MockableConnectedCacheSubscriptionResource.cs new file mode 100644 index 000000000000..985ce3c39772 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Extensions/MockableConnectedCacheSubscriptionResource.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ConnectedCache.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableConnectedCacheSubscriptionResource : ArmResource + { + private ClientDiagnostics _ispCustomerResourceIspCustomersClientDiagnostics; + private IspCustomersRestOperations _ispCustomerResourceIspCustomersRestClient; + private ClientDiagnostics _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics; + private EnterpriseMccCustomersRestOperations _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableConnectedCacheSubscriptionResource() + { + } + + /// 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 MockableConnectedCacheSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics IspCustomerResourceIspCustomersClientDiagnostics => _ispCustomerResourceIspCustomersClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ConnectedCache", IspCustomerResource.ResourceType.Namespace, Diagnostics); + private IspCustomersRestOperations IspCustomerResourceIspCustomersRestClient => _ispCustomerResourceIspCustomersRestClient ??= new IspCustomersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(IspCustomerResource.ResourceType)); + private ClientDiagnostics EnterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics => _enterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ConnectedCache", EnterpriseMccCustomerResource.ResourceType.Namespace, Diagnostics); + private EnterpriseMccCustomersRestOperations EnterpriseMccCustomerResourceEnterpriseMccCustomersRestClient => _enterpriseMccCustomerResourceEnterpriseMccCustomersRestClient ??= new EnterpriseMccCustomersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(EnterpriseMccCustomerResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// This api gets information about all ispCustomer resources under the given subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ConnectedCache/ispCustomers + /// + /// + /// Operation Id + /// IspCustomerResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetIspCustomerResourcesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => IspCustomerResourceIspCustomersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => IspCustomerResourceIspCustomersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IspCustomerResource(Client, IspCustomerResourceData.DeserializeIspCustomerResourceData(e)), IspCustomerResourceIspCustomersClientDiagnostics, Pipeline, "MockableConnectedCacheSubscriptionResource.GetIspCustomerResources", "value", "nextLink", cancellationToken); + } + + /// + /// This api gets information about all ispCustomer resources under the given subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ConnectedCache/ispCustomers + /// + /// + /// Operation Id + /// IspCustomerResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetIspCustomerResources(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => IspCustomerResourceIspCustomersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => IspCustomerResourceIspCustomersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IspCustomerResource(Client, IspCustomerResourceData.DeserializeIspCustomerResourceData(e)), IspCustomerResourceIspCustomersClientDiagnostics, Pipeline, "MockableConnectedCacheSubscriptionResource.GetIspCustomerResources", "value", "nextLink", cancellationToken); + } + + /// + /// This api gets information about all enterpriseMccCustomer resources under the given subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetEnterpriseMccCustomerResourcesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => EnterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EnterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EnterpriseMccCustomerResource(Client, EnterpriseMccCustomerResourceData.DeserializeEnterpriseMccCustomerResourceData(e)), EnterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics, Pipeline, "MockableConnectedCacheSubscriptionResource.GetEnterpriseMccCustomerResources", "value", "nextLink", cancellationToken); + } + + /// + /// This api gets information about all enterpriseMccCustomer resources under the given subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ConnectedCache/enterpriseMccCustomers + /// + /// + /// Operation Id + /// EnterpriseMccCustomerResource_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetEnterpriseMccCustomerResources(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => EnterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EnterpriseMccCustomerResourceEnterpriseMccCustomersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EnterpriseMccCustomerResource(Client, EnterpriseMccCustomerResourceData.DeserializeEnterpriseMccCustomerResourceData(e)), EnterpriseMccCustomerResourceEnterpriseMccCustomersClientDiagnostics, Pipeline, "MockableConnectedCacheSubscriptionResource.GetEnterpriseMccCustomerResources", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Internal/Argument.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..bac14bede43f --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/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.ConnectedCache +{ + 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/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..46fe4ba44e48 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/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.ConnectedCache +{ + 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/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Internal/ChangeTrackingList.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..0f2192370a1a --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/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.ConnectedCache +{ + 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/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..006dbea9a46e --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/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.ConnectedCache +{ + 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/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Internal/Optional.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..15315a7ca1b5 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/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.ConnectedCache +{ + 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/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..9efbc96b8aed --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/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.ConnectedCache +{ + 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/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCacheNodeResource.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCacheNodeResource.Serialization.cs new file mode 100644 index 000000000000..13b96c8fc03d --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCacheNodeResource.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.ConnectedCache +{ + public partial class IspCacheNodeResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + IspCacheNodeResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + IspCacheNodeResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCacheNodeResource.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCacheNodeResource.cs new file mode 100644 index 000000000000..c11a9816d174 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCacheNodeResource.cs @@ -0,0 +1,1003 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ConnectedCache.Models; + +namespace Azure.ResourceManager.ConnectedCache +{ + /// + /// A Class representing an IspCacheNodeResource along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetIspCacheNodeResource method. + /// Otherwise you can get one from its parent resource using the GetIspCacheNodeResource method. + /// + public partial class IspCacheNodeResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The customerResourceName. + /// The cacheNodeResourceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics; + private readonly IspCacheNodesRestOperations _ispCacheNodeResourceIspCacheNodesOperationsRestClient; + private readonly IspCacheNodeResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ConnectedCache/ispCustomers/ispCacheNodes"; + + /// Initializes a new instance of the class for mocking. + protected IspCacheNodeResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal IspCacheNodeResource(ArmClient client, IspCacheNodeResourceData 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 IspCacheNodeResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ConnectedCache", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string ispCacheNodeResourceIspCacheNodesOperationsApiVersion); + _ispCacheNodeResourceIspCacheNodesOperationsRestClient = new IspCacheNodesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, ispCacheNodeResourceIspCacheNodesOperationsApiVersion); +#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 IspCacheNodeResourceData 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)); + } + + /// + /// This api gets ispCacheNode resource information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// IspCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResource.Get"); + scope.Start(); + try + { + var response = await _ispCacheNodeResourceIspCacheNodesOperationsRestClient.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 IspCacheNodeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api gets ispCacheNode resource information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// IspCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResource.Get"); + scope.Start(); + try + { + var response = _ispCacheNodeResourceIspCacheNodesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IspCacheNodeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api deletes an existing ispCacheNode resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// IspCacheNodeResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-30-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 = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResource.Delete"); + scope.Start(); + try + { + var response = await _ispCacheNodeResourceIspCacheNodesOperationsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ConnectedCacheArmOperation(_ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics, Pipeline, _ispCacheNodeResourceIspCacheNodesOperationsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api deletes an existing ispCacheNode resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// IspCacheNodeResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-30-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 = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResource.Delete"); + scope.Start(); + try + { + var response = _ispCacheNodeResourceIspCacheNodesOperationsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ConnectedCacheArmOperation(_ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics, Pipeline, _ispCacheNodeResourceIspCacheNodesOperationsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api updates an existing ispCacheNode resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// IspCacheNodeResource_Update + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(ConnectedCachePatchContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResource.Update"); + scope.Start(); + try + { + var response = await _ispCacheNodeResourceIspCacheNodesOperationsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new IspCacheNodeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api updates an existing ispCacheNode resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// IspCacheNodeResource_Update + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual Response Update(ConnectedCachePatchContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResource.Update"); + scope.Start(); + try + { + var response = _ispCacheNodeResourceIspCacheNodesOperationsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + return Response.FromValue(new IspCacheNodeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api gets ispCacheNode resource information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}/getBgpCidrs + /// + /// + /// Operation Id + /// IspCacheNodesOperations_GetBgpCidrs + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetBgpCidrsAsync(CancellationToken cancellationToken = default) + { + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResource.GetBgpCidrs"); + scope.Start(); + try + { + var response = await _ispCacheNodeResourceIspCacheNodesOperationsRestClient.GetBgpCidrsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api gets ispCacheNode resource information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}/getBgpCidrs + /// + /// + /// Operation Id + /// IspCacheNodesOperations_GetBgpCidrs + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetBgpCidrs(CancellationToken cancellationToken = default) + { + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResource.GetBgpCidrs"); + scope.Start(); + try + { + var response = _ispCacheNodeResourceIspCacheNodesOperationsRestClient.GetBgpCidrs(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api gets secrets of the ispCacheNode resource install details + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}/getCacheNodeInstallDetails + /// + /// + /// Operation Id + /// IspCacheNodesOperations_GetCacheNodeInstallDetails + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetCacheNodeInstallDetailsAsync(CancellationToken cancellationToken = default) + { + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResource.GetCacheNodeInstallDetails"); + scope.Start(); + try + { + var response = await _ispCacheNodeResourceIspCacheNodesOperationsRestClient.GetCacheNodeInstallDetailsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api gets secrets of the ispCacheNode resource install details + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}/getCacheNodeInstallDetails + /// + /// + /// Operation Id + /// IspCacheNodesOperations_GetCacheNodeInstallDetails + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetCacheNodeInstallDetails(CancellationToken cancellationToken = default) + { + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResource.GetCacheNodeInstallDetails"); + scope.Start(); + try + { + var response = _ispCacheNodeResourceIspCacheNodesOperationsRestClient.GetCacheNodeInstallDetails(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api gets ispCacheNode resource auto update histrory information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}/getCacheNodeAutoUpdateHistory + /// + /// + /// Operation Id + /// IspCacheNodesOperations_GetCacheNodeAutoUpdateHistory + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetCacheNodeAutoUpdateHistoryAsync(CancellationToken cancellationToken = default) + { + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResource.GetCacheNodeAutoUpdateHistory"); + scope.Start(); + try + { + var response = await _ispCacheNodeResourceIspCacheNodesOperationsRestClient.GetCacheNodeAutoUpdateHistoryAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api gets ispCacheNode resource auto update histrory information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}/getCacheNodeAutoUpdateHistory + /// + /// + /// Operation Id + /// IspCacheNodesOperations_GetCacheNodeAutoUpdateHistory + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetCacheNodeAutoUpdateHistory(CancellationToken cancellationToken = default) + { + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResource.GetCacheNodeAutoUpdateHistory"); + scope.Start(); + try + { + var response = _ispCacheNodeResourceIspCacheNodesOperationsRestClient.GetCacheNodeAutoUpdateHistory(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api gets ispCacheNode resource issues details histrory information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}/getCacheNodeMccIssueDetailsHistory + /// + /// + /// Operation Id + /// IspCacheNodesOperations_GetCacheNodeMccIssueDetailsHistory + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetCacheNodeMccIssueDetailsHistoryAsync(CancellationToken cancellationToken = default) + { + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResource.GetCacheNodeMccIssueDetailsHistory"); + scope.Start(); + try + { + var response = await _ispCacheNodeResourceIspCacheNodesOperationsRestClient.GetCacheNodeMccIssueDetailsHistoryAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api gets ispCacheNode resource issues details histrory information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName}/getCacheNodeMccIssueDetailsHistory + /// + /// + /// Operation Id + /// IspCacheNodesOperations_GetCacheNodeMccIssueDetailsHistory + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetCacheNodeMccIssueDetailsHistory(CancellationToken cancellationToken = default) + { + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResource.GetCacheNodeMccIssueDetailsHistory"); + scope.Start(); + try + { + var response = _ispCacheNodeResourceIspCacheNodesOperationsRestClient.GetCacheNodeMccIssueDetailsHistory(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// IspCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _ispCacheNodeResourceIspCacheNodesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new IspCacheNodeResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ConnectedCachePatchContent(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// IspCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _ispCacheNodeResourceIspCacheNodesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new IspCacheNodeResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ConnectedCachePatchContent(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// IspCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _ispCacheNodeResourceIspCacheNodesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new IspCacheNodeResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ConnectedCachePatchContent(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// IspCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _ispCacheNodeResourceIspCacheNodesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new IspCacheNodeResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ConnectedCachePatchContent(); + patch.Tags.ReplaceWith(tags); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// IspCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _ispCacheNodeResourceIspCacheNodesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new IspCacheNodeResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ConnectedCachePatchContent(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// IspCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _ispCacheNodeResourceIspCacheNodesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new IspCacheNodeResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ConnectedCachePatchContent(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCacheNodeResourceCollection.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCacheNodeResourceCollection.cs new file mode 100644 index 000000000000..d4b9d162d8a5 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCacheNodeResourceCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ConnectedCache +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetIspCacheNodeResources method from an instance of . + /// + public partial class IspCacheNodeResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics; + private readonly IspCacheNodesRestOperations _ispCacheNodeResourceIspCacheNodesOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected IspCacheNodeResourceCollection() + { + } + + /// 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 IspCacheNodeResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ConnectedCache", IspCacheNodeResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(IspCacheNodeResource.ResourceType, out string ispCacheNodeResourceIspCacheNodesOperationsApiVersion); + _ispCacheNodeResourceIspCacheNodesOperationsRestClient = new IspCacheNodesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, ispCacheNodeResourceIspCacheNodesOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != IspCustomerResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, IspCustomerResource.ResourceType), nameof(id)); + } + + /// + /// This api creates an ispCacheNode with the specified create parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// IspCacheNodeResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-30-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. + /// Name of the ConnectedCache resource. + /// 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 cacheNodeResourceName, IspCacheNodeResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _ispCacheNodeResourceIspCacheNodesOperationsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheNodeResourceName, data, cancellationToken).ConfigureAwait(false); + var operation = new ConnectedCacheArmOperation(new IspCacheNodeResourceOperationSource(Client), _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics, Pipeline, _ispCacheNodeResourceIspCacheNodesOperationsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheNodeResourceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api creates an ispCacheNode with the specified create parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// IspCacheNodeResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-30-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. + /// Name of the ConnectedCache resource. + /// 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 cacheNodeResourceName, IspCacheNodeResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _ispCacheNodeResourceIspCacheNodesOperationsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheNodeResourceName, data, cancellationToken); + var operation = new ConnectedCacheArmOperation(new IspCacheNodeResourceOperationSource(Client), _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics, Pipeline, _ispCacheNodeResourceIspCacheNodesOperationsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheNodeResourceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api gets ispCacheNode resource information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// IspCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResourceCollection.Get"); + scope.Start(); + try + { + var response = await _ispCacheNodeResourceIspCacheNodesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheNodeResourceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IspCacheNodeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api gets ispCacheNode resource information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// IspCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResourceCollection.Get"); + scope.Start(); + try + { + var response = _ispCacheNodeResourceIspCacheNodesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheNodeResourceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IspCacheNodeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api retrieves information about all ispCacheNode resources under the given subscription and resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes + /// + /// + /// Operation Id + /// IspCacheNodeResource_ListByIspCustomerResource + /// + /// + /// Default Api Version + /// 2024-11-30-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) => _ispCacheNodeResourceIspCacheNodesOperationsRestClient.CreateListByIspCustomerResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _ispCacheNodeResourceIspCacheNodesOperationsRestClient.CreateListByIspCustomerResourceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IspCacheNodeResource(Client, IspCacheNodeResourceData.DeserializeIspCacheNodeResourceData(e)), _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics, Pipeline, "IspCacheNodeResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// This api retrieves information about all ispCacheNode resources under the given subscription and resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes + /// + /// + /// Operation Id + /// IspCacheNodeResource_ListByIspCustomerResource + /// + /// + /// Default Api Version + /// 2024-11-30-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) => _ispCacheNodeResourceIspCacheNodesOperationsRestClient.CreateListByIspCustomerResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _ispCacheNodeResourceIspCacheNodesOperationsRestClient.CreateListByIspCustomerResourceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IspCacheNodeResource(Client, IspCacheNodeResourceData.DeserializeIspCacheNodeResourceData(e)), _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics, Pipeline, "IspCacheNodeResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// IspCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _ispCacheNodeResourceIspCacheNodesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheNodeResourceName, 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.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// IspCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResourceCollection.Exists"); + scope.Start(); + try + { + var response = _ispCacheNodeResourceIspCacheNodesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheNodeResourceName, 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.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// IspCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _ispCacheNodeResourceIspCacheNodesOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheNodeResourceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new IspCacheNodeResource(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.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// IspCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var scope = _ispCacheNodeResourceIspCacheNodesOperationsClientDiagnostics.CreateScope("IspCacheNodeResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _ispCacheNodeResourceIspCacheNodesOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cacheNodeResourceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new IspCacheNodeResource(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/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCacheNodeResourceData.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCacheNodeResourceData.Serialization.cs new file mode 100644 index 000000000000..841150bcd0c1 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCacheNodeResourceData.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; +using Azure.ResourceManager.ConnectedCache.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ConnectedCache +{ + public partial class IspCacheNodeResourceData : 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(IspCacheNodeResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + IspCacheNodeResourceData 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(IspCacheNodeResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIspCacheNodeResourceData(document.RootElement, options); + } + + internal static IspCacheNodeResourceData DeserializeIspCacheNodeResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CacheNodeProperty properties = default; + IDictionary tags = default; + AzureLocation location = 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 = CacheNodeProperty.DeserializeCacheNodeProperty(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IspCacheNodeResourceData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + 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(IspCacheNodeResourceData)} does not support writing '{options.Format}' format."); + } + } + + IspCacheNodeResourceData 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 DeserializeIspCacheNodeResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IspCacheNodeResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCacheNodeResourceData.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCacheNodeResourceData.cs new file mode 100644 index 000000000000..5a4c34b39dac --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCacheNodeResourceData.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ConnectedCache.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ConnectedCache +{ + /// + /// A class representing the IspCacheNodeResource data model. + /// Represents the high level Nodes needed to provision cache node resources + /// + public partial class IspCacheNodeResourceData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public IspCacheNodeResourceData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal IspCacheNodeResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CacheNodeProperty properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IspCacheNodeResourceData() + { + } + + /// The resource-specific properties for this resource. + public CacheNodeProperty Properties { get; set; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCustomerResource.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCustomerResource.Serialization.cs new file mode 100644 index 000000000000..87e380c74c5e --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCustomerResource.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.ConnectedCache +{ + public partial class IspCustomerResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + IspCustomerResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + IspCustomerResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCustomerResource.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCustomerResource.cs new file mode 100644 index 000000000000..346260bae5cf --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCustomerResource.cs @@ -0,0 +1,768 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ConnectedCache.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ConnectedCache +{ + /// + /// A Class representing an IspCustomerResource along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetIspCustomerResource method. + /// Otherwise you can get one from its parent resource using the GetIspCustomerResource method. + /// + public partial class IspCustomerResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The customerResourceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string customerResourceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _ispCustomerResourceIspCustomersClientDiagnostics; + private readonly IspCustomersRestOperations _ispCustomerResourceIspCustomersRestClient; + private readonly IspCustomerResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ConnectedCache/ispCustomers"; + + /// Initializes a new instance of the class for mocking. + protected IspCustomerResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal IspCustomerResource(ArmClient client, IspCustomerResourceData 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 IspCustomerResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _ispCustomerResourceIspCustomersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ConnectedCache", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string ispCustomerResourceIspCustomersApiVersion); + _ispCustomerResourceIspCustomersRestClient = new IspCustomersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, ispCustomerResourceIspCustomersApiVersion); +#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 IspCustomerResourceData 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 IspCacheNodeResources in the IspCustomerResource. + /// An object representing collection of IspCacheNodeResources and their operations over a IspCacheNodeResource. + public virtual IspCacheNodeResourceCollection GetIspCacheNodeResources() + { + return GetCachedClient(client => new IspCacheNodeResourceCollection(client, Id)); + } + + /// + /// This api gets ispCacheNode resource information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// IspCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetIspCacheNodeResourceAsync(string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + return await GetIspCacheNodeResources().GetAsync(cacheNodeResourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// This api gets ispCacheNode resource information + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName}/ispCacheNodes/{cacheNodeResourceName} + /// + /// + /// Operation Id + /// IspCacheNodeResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetIspCacheNodeResource(string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + return GetIspCacheNodeResources().Get(cacheNodeResourceName, cancellationToken); + } + + /// + /// Gets the ispCustomer resource information using this get call + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// IspCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _ispCustomerResourceIspCustomersClientDiagnostics.CreateScope("IspCustomerResource.Get"); + scope.Start(); + try + { + var response = await _ispCustomerResourceIspCustomersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IspCustomerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the ispCustomer resource information using this get call + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// IspCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _ispCustomerResourceIspCustomersClientDiagnostics.CreateScope("IspCustomerResource.Get"); + scope.Start(); + try + { + var response = _ispCustomerResourceIspCustomersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IspCustomerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api deletes an existing ispCustomer resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// IspCustomerResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-30-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 = _ispCustomerResourceIspCustomersClientDiagnostics.CreateScope("IspCustomerResource.Delete"); + scope.Start(); + try + { + var response = await _ispCustomerResourceIspCustomersRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ConnectedCacheArmOperation(_ispCustomerResourceIspCustomersClientDiagnostics, Pipeline, _ispCustomerResourceIspCustomersRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api deletes an existing ispCustomer resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// IspCustomerResource_Delete + /// + /// + /// Default Api Version + /// 2024-11-30-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 = _ispCustomerResourceIspCustomersClientDiagnostics.CreateScope("IspCustomerResource.Delete"); + scope.Start(); + try + { + var response = _ispCustomerResourceIspCustomersRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new ConnectedCacheArmOperation(_ispCustomerResourceIspCustomersClientDiagnostics, Pipeline, _ispCustomerResourceIspCustomersRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api updates an existing ispCustomer resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// IspCustomerResource_Update + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(ConnectedCachePatchContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _ispCustomerResourceIspCustomersClientDiagnostics.CreateScope("IspCustomerResource.Update"); + scope.Start(); + try + { + var response = await _ispCustomerResourceIspCustomersRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new IspCustomerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api updates an existing ispCustomer resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// IspCustomerResource_Update + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual Response Update(ConnectedCachePatchContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _ispCustomerResourceIspCustomersClientDiagnostics.CreateScope("IspCustomerResource.Update"); + scope.Start(); + try + { + var response = _ispCustomerResourceIspCustomersRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + return Response.FromValue(new IspCustomerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// IspCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _ispCustomerResourceIspCustomersClientDiagnostics.CreateScope("IspCustomerResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _ispCustomerResourceIspCustomersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new IspCustomerResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ConnectedCachePatchContent(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// IspCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _ispCustomerResourceIspCustomersClientDiagnostics.CreateScope("IspCustomerResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _ispCustomerResourceIspCustomersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new IspCustomerResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ConnectedCachePatchContent(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// IspCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _ispCustomerResourceIspCustomersClientDiagnostics.CreateScope("IspCustomerResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _ispCustomerResourceIspCustomersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new IspCustomerResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ConnectedCachePatchContent(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// IspCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _ispCustomerResourceIspCustomersClientDiagnostics.CreateScope("IspCustomerResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _ispCustomerResourceIspCustomersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new IspCustomerResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ConnectedCachePatchContent(); + patch.Tags.ReplaceWith(tags); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// IspCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _ispCustomerResourceIspCustomersClientDiagnostics.CreateScope("IspCustomerResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _ispCustomerResourceIspCustomersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new IspCustomerResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ConnectedCachePatchContent(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// IspCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _ispCustomerResourceIspCustomersClientDiagnostics.CreateScope("IspCustomerResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _ispCustomerResourceIspCustomersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new IspCustomerResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ConnectedCachePatchContent(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCustomerResourceCollection.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCustomerResourceCollection.cs new file mode 100644 index 000000000000..7690a63c44e4 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCustomerResourceCollection.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ConnectedCache +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetIspCustomerResources method from an instance of . + /// + public partial class IspCustomerResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _ispCustomerResourceIspCustomersClientDiagnostics; + private readonly IspCustomersRestOperations _ispCustomerResourceIspCustomersRestClient; + + /// Initializes a new instance of the class for mocking. + protected IspCustomerResourceCollection() + { + } + + /// 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 IspCustomerResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _ispCustomerResourceIspCustomersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ConnectedCache", IspCustomerResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(IspCustomerResource.ResourceType, out string ispCustomerResourceIspCustomersApiVersion); + _ispCustomerResourceIspCustomersRestClient = new IspCustomersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, ispCustomerResourceIspCustomersApiVersion); +#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)); + } + + /// + /// This api creates an ispCustomer with the specified create parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// IspCustomerResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-30-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. + /// Name of the Customer resource. + /// 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 customerResourceName, IspCustomerResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _ispCustomerResourceIspCustomersClientDiagnostics.CreateScope("IspCustomerResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _ispCustomerResourceIspCustomersRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, customerResourceName, data, cancellationToken).ConfigureAwait(false); + var operation = new ConnectedCacheArmOperation(new IspCustomerResourceOperationSource(Client), _ispCustomerResourceIspCustomersClientDiagnostics, Pipeline, _ispCustomerResourceIspCustomersRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, customerResourceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api creates an ispCustomer with the specified create parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// IspCustomerResource_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-11-30-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. + /// Name of the Customer resource. + /// 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 customerResourceName, IspCustomerResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _ispCustomerResourceIspCustomersClientDiagnostics.CreateScope("IspCustomerResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _ispCustomerResourceIspCustomersRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, customerResourceName, data, cancellationToken); + var operation = new ConnectedCacheArmOperation(new IspCustomerResourceOperationSource(Client), _ispCustomerResourceIspCustomersClientDiagnostics, Pipeline, _ispCustomerResourceIspCustomersRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, customerResourceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the ispCustomer resource information using this get call + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// IspCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Customer resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var scope = _ispCustomerResourceIspCustomersClientDiagnostics.CreateScope("IspCustomerResourceCollection.Get"); + scope.Start(); + try + { + var response = await _ispCustomerResourceIspCustomersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, customerResourceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IspCustomerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the ispCustomer resource information using this get call + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// IspCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Customer resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var scope = _ispCustomerResourceIspCustomersClientDiagnostics.CreateScope("IspCustomerResourceCollection.Get"); + scope.Start(); + try + { + var response = _ispCustomerResourceIspCustomersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, customerResourceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new IspCustomerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This api gets the information about all ispCustomer resources under the given subscription and resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers + /// + /// + /// Operation Id + /// IspCustomerResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-30-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) => _ispCustomerResourceIspCustomersRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _ispCustomerResourceIspCustomersRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IspCustomerResource(Client, IspCustomerResourceData.DeserializeIspCustomerResourceData(e)), _ispCustomerResourceIspCustomersClientDiagnostics, Pipeline, "IspCustomerResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// This api gets the information about all ispCustomer resources under the given subscription and resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers + /// + /// + /// Operation Id + /// IspCustomerResource_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-11-30-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) => _ispCustomerResourceIspCustomersRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _ispCustomerResourceIspCustomersRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IspCustomerResource(Client, IspCustomerResourceData.DeserializeIspCustomerResourceData(e)), _ispCustomerResourceIspCustomersClientDiagnostics, Pipeline, "IspCustomerResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedCache/ispCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// IspCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Customer resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var scope = _ispCustomerResourceIspCustomersClientDiagnostics.CreateScope("IspCustomerResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _ispCustomerResourceIspCustomersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, customerResourceName, 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.ConnectedCache/ispCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// IspCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Customer resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var scope = _ispCustomerResourceIspCustomersClientDiagnostics.CreateScope("IspCustomerResourceCollection.Exists"); + scope.Start(); + try + { + var response = _ispCustomerResourceIspCustomersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, customerResourceName, 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.ConnectedCache/ispCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// IspCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Customer resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var scope = _ispCustomerResourceIspCustomersClientDiagnostics.CreateScope("IspCustomerResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _ispCustomerResourceIspCustomersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, customerResourceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new IspCustomerResource(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.ConnectedCache/ispCustomers/{customerResourceName} + /// + /// + /// Operation Id + /// IspCustomerResource_Get + /// + /// + /// Default Api Version + /// 2024-11-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Customer resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var scope = _ispCustomerResourceIspCustomersClientDiagnostics.CreateScope("IspCustomerResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _ispCustomerResourceIspCustomersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, customerResourceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new IspCustomerResource(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/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCustomerResourceData.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCustomerResourceData.Serialization.cs new file mode 100644 index 000000000000..462fc29e71a9 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCustomerResourceData.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; +using Azure.ResourceManager.ConnectedCache.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ConnectedCache +{ + public partial class IspCustomerResourceData : 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(IspCustomerResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + IspCustomerResourceData 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(IspCustomerResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIspCustomerResourceData(document.RootElement, options); + } + + internal static IspCustomerResourceData DeserializeIspCustomerResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CustomerProperty properties = default; + IDictionary tags = default; + AzureLocation location = 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 = CustomerProperty.DeserializeCustomerProperty(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IspCustomerResourceData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + 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(IspCustomerResourceData)} does not support writing '{options.Format}' format."); + } + } + + IspCustomerResourceData 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 DeserializeIspCustomerResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IspCustomerResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCustomerResourceData.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCustomerResourceData.cs new file mode 100644 index 000000000000..b33e999abe4f --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/IspCustomerResourceData.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ConnectedCache.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ConnectedCache +{ + /// + /// A class representing the IspCustomerResource data model. + /// Represents the high level Nodes needed to provision isp customer resources + /// + public partial class IspCustomerResourceData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public IspCustomerResourceData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal IspCustomerResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CustomerProperty properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IspCustomerResourceData() + { + } + + /// The resource-specific properties for this resource. + public CustomerProperty Properties { get; set; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/LongRunningOperation/ConnectedCacheArmOperation.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/LongRunningOperation/ConnectedCacheArmOperation.cs new file mode 100644 index 000000000000..5a9063ce1c45 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/LongRunningOperation/ConnectedCacheArmOperation.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.ConnectedCache +{ +#pragma warning disable SA1649 // File name should match first type name + internal class ConnectedCacheArmOperation : 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 ConnectedCacheArmOperation for mocking. + protected ConnectedCacheArmOperation() + { + } + + internal ConnectedCacheArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal ConnectedCacheArmOperation(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, "ConnectedCacheArmOperation", 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/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/LongRunningOperation/ConnectedCacheArmOperationOfT.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/LongRunningOperation/ConnectedCacheArmOperationOfT.cs new file mode 100644 index 000000000000..9cffd98c99fb --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/LongRunningOperation/ConnectedCacheArmOperationOfT.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.ConnectedCache +{ +#pragma warning disable SA1649 // File name should match first type name + internal class ConnectedCacheArmOperation : 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 ConnectedCacheArmOperation for mocking. + protected ConnectedCacheArmOperation() + { + } + + internal ConnectedCacheArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal ConnectedCacheArmOperation(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, "ConnectedCacheArmOperation", 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/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/LongRunningOperation/EnterpriseMccCacheNodeResourceOperationSource.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/LongRunningOperation/EnterpriseMccCacheNodeResourceOperationSource.cs new file mode 100644 index 000000000000..e4d1c58c364c --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/LongRunningOperation/EnterpriseMccCacheNodeResourceOperationSource.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.ConnectedCache +{ + internal class EnterpriseMccCacheNodeResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal EnterpriseMccCacheNodeResourceOperationSource(ArmClient client) + { + _client = client; + } + + EnterpriseMccCacheNodeResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new EnterpriseMccCacheNodeResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new EnterpriseMccCacheNodeResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/LongRunningOperation/EnterpriseMccCustomerResourceOperationSource.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/LongRunningOperation/EnterpriseMccCustomerResourceOperationSource.cs new file mode 100644 index 000000000000..ed7cb2db2fbe --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/LongRunningOperation/EnterpriseMccCustomerResourceOperationSource.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.ConnectedCache +{ + internal class EnterpriseMccCustomerResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal EnterpriseMccCustomerResourceOperationSource(ArmClient client) + { + _client = client; + } + + EnterpriseMccCustomerResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new EnterpriseMccCustomerResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new EnterpriseMccCustomerResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/LongRunningOperation/IspCacheNodeResourceOperationSource.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/LongRunningOperation/IspCacheNodeResourceOperationSource.cs new file mode 100644 index 000000000000..2fde1a571b07 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/LongRunningOperation/IspCacheNodeResourceOperationSource.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.ConnectedCache +{ + internal class IspCacheNodeResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal IspCacheNodeResourceOperationSource(ArmClient client) + { + _client = client; + } + + IspCacheNodeResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new IspCacheNodeResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new IspCacheNodeResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/LongRunningOperation/IspCustomerResourceOperationSource.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/LongRunningOperation/IspCustomerResourceOperationSource.cs new file mode 100644 index 000000000000..91201615b361 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/LongRunningOperation/IspCustomerResourceOperationSource.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.ConnectedCache +{ + internal class IspCustomerResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal IspCustomerResourceOperationSource(ArmClient client) + { + _client = client; + } + + IspCustomerResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new IspCustomerResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new IspCustomerResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/AdditionalCacheNodeProperties.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/AdditionalCacheNodeProperties.Serialization.cs new file mode 100644 index 000000000000..fdc30a70971f --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/AdditionalCacheNodeProperties.Serialization.cs @@ -0,0 +1,641 @@ +// 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.ConnectedCache.Models +{ + public partial class AdditionalCacheNodeProperties : 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(AdditionalCacheNodeProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(CacheNodePropertiesDetailsIssuesList)) + { + writer.WritePropertyName("cacheNodePropertiesDetailsIssuesList"u8); + writer.WriteStartArray(); + foreach (var item in CacheNodePropertiesDetailsIssuesList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(IssuesList)) + { + writer.WritePropertyName("issuesList"u8); + writer.WriteStartArray(); + foreach (var item in IssuesList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(IssuesCount)) + { + writer.WritePropertyName("issuesCount"u8); + writer.WriteNumberValue(IssuesCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(CurrentTlsCertificate)) + { + writer.WritePropertyName("currentTlsCertificate"u8); + writer.WriteObjectValue(CurrentTlsCertificate, options); + } + if (options.Format != "W" && Optional.IsDefined(LastAutoUpdateInfo)) + { + writer.WritePropertyName("lastAutoUpdateInfo"u8); + writer.WriteObjectValue(LastAutoUpdateInfo, options); + } + if (options.Format != "W" && Optional.IsDefined(AggregatedStatusDetails)) + { + writer.WritePropertyName("aggregatedStatusDetails"u8); + writer.WriteStringValue(AggregatedStatusDetails); + } + if (options.Format != "W" && Optional.IsDefined(AggregatedStatusText)) + { + writer.WritePropertyName("aggregatedStatusText"u8); + writer.WriteStringValue(AggregatedStatusText); + } + if (options.Format != "W" && Optional.IsDefined(AggregatedStatusCode)) + { + writer.WritePropertyName("aggregatedStatusCode"u8); + writer.WriteNumberValue(AggregatedStatusCode.Value); + } + if (options.Format != "W" && Optional.IsDefined(ProductVersion)) + { + writer.WritePropertyName("productVersion"u8); + writer.WriteStringValue(ProductVersion); + } + if (options.Format != "W" && Optional.IsDefined(IsProvisioned)) + { + writer.WritePropertyName("isProvisioned"u8); + writer.WriteBooleanValue(IsProvisioned.Value); + } + if (options.Format != "W" && Optional.IsDefined(CacheNodeStateDetailedText)) + { + writer.WritePropertyName("cacheNodeStateDetailedText"u8); + writer.WriteStringValue(CacheNodeStateDetailedText); + } + if (options.Format != "W" && Optional.IsDefined(CacheNodeStateShortText)) + { + writer.WritePropertyName("cacheNodeStateShortText"u8); + writer.WriteStringValue(CacheNodeStateShortText); + } + if (options.Format != "W" && Optional.IsDefined(CacheNodeState)) + { + writer.WritePropertyName("cacheNodeState"u8); + writer.WriteNumberValue(CacheNodeState.Value); + } + if (Optional.IsCollectionDefined(DriveConfiguration)) + { + writer.WritePropertyName("driveConfiguration"u8); + writer.WriteStartArray(); + foreach (var item in DriveConfiguration) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(BgpConfiguration)) + { + writer.WritePropertyName("bgpConfiguration"u8); + writer.WriteObjectValue(BgpConfiguration, options); + } + if (Optional.IsDefined(ProxyUrlConfiguration)) + { + writer.WritePropertyName("proxyUrlConfiguration"u8); + writer.WriteObjectValue(ProxyUrlConfiguration, options); + } + if (Optional.IsDefined(IsProxyRequired)) + { + writer.WritePropertyName("isProxyRequired"u8); + writer.WriteStringValue(IsProxyRequired.Value.ToString()); + } + if (Optional.IsDefined(OSType)) + { + writer.WritePropertyName("osType"u8); + writer.WriteStringValue(OSType.Value.ToString()); + } + if (Optional.IsDefined(AutoUpdateVersion)) + { + writer.WritePropertyName("autoUpdateVersion"u8); + writer.WriteStringValue(AutoUpdateVersion); + } + if (Optional.IsDefined(UpdateInfoDetails)) + { + writer.WritePropertyName("updateInfoDetails"u8); + writer.WriteStringValue(UpdateInfoDetails); + } + if (Optional.IsDefined(UpdateRequestedOn)) + { + writer.WritePropertyName("updateRequestedDateTime"u8); + writer.WriteStringValue(UpdateRequestedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(AutoUpdateNextAvailableVersion)) + { + writer.WritePropertyName("autoUpdateNextAvailableVersion"u8); + writer.WriteStringValue(AutoUpdateNextAvailableVersion); + } + if (options.Format != "W" && Optional.IsDefined(AutoUpdateNextAvailableOn)) + { + writer.WritePropertyName("autoUpdateNextAvailableDateTime"u8); + writer.WriteStringValue(AutoUpdateNextAvailableOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(AutoUpdateAppliedVersion)) + { + writer.WritePropertyName("autoUpdateAppliedVersion"u8); + writer.WriteStringValue(AutoUpdateAppliedVersion); + } + if (options.Format != "W" && Optional.IsDefined(AutoUpdateLastAppliedDetails)) + { + writer.WritePropertyName("autoUpdateLastAppliedDetails"u8); + writer.WriteStringValue(AutoUpdateLastAppliedDetails); + } + if (options.Format != "W" && Optional.IsDefined(AutoUpdateLastAppliedState)) + { + writer.WritePropertyName("autoUpdateLastAppliedState"u8); + writer.WriteStringValue(AutoUpdateLastAppliedState); + } + if (options.Format != "W" && Optional.IsDefined(AutoUpdateLastAppliedOn)) + { + writer.WritePropertyName("autoUpdateLastAppliedDateTime"u8); + writer.WriteStringValue(AutoUpdateLastAppliedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(AutoUpdateLastTriggeredOn)) + { + writer.WritePropertyName("autoUpdateLastTriggeredDateTime"u8); + writer.WriteStringValue(AutoUpdateLastTriggeredOn.Value, "O"); + } + if (Optional.IsDefined(CreationMethod)) + { + writer.WritePropertyName("creationMethod"u8); + writer.WriteNumberValue(CreationMethod.Value); + } + if (options.Format != "W" && Optional.IsDefined(TlsStatus)) + { + writer.WritePropertyName("tlsStatus"u8); + writer.WriteStringValue(TlsStatus); + } + if (Optional.IsDefined(OptionalProperty1)) + { + writer.WritePropertyName("optionalProperty1"u8); + writer.WriteStringValue(OptionalProperty1); + } + if (Optional.IsDefined(OptionalProperty2)) + { + writer.WritePropertyName("optionalProperty2"u8); + writer.WriteStringValue(OptionalProperty2); + } + if (Optional.IsDefined(OptionalProperty3)) + { + writer.WritePropertyName("optionalProperty3"u8); + writer.WriteStringValue(OptionalProperty3); + } + if (Optional.IsDefined(OptionalProperty4)) + { + writer.WritePropertyName("optionalProperty4"u8); + writer.WriteStringValue(OptionalProperty4); + } + if (Optional.IsDefined(OptionalProperty5)) + { + writer.WritePropertyName("optionalProperty5"u8); + writer.WriteStringValue(OptionalProperty5); + } + 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 + } + } + } + + AdditionalCacheNodeProperties 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(AdditionalCacheNodeProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAdditionalCacheNodeProperties(document.RootElement, options); + } + + internal static AdditionalCacheNodeProperties DeserializeAdditionalCacheNodeProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList cacheNodePropertiesDetailsIssuesList = default; + IReadOnlyList issuesList = default; + int? issuesCount = default; + MccCacheNodeTlsCertificate currentTlsCertificate = default; + MccCacheNodeAutoUpdateInfo lastAutoUpdateInfo = default; + string aggregatedStatusDetails = default; + string aggregatedStatusText = default; + int? aggregatedStatusCode = default; + string productVersion = default; + bool? isProvisioned = default; + string cacheNodeStateDetailedText = default; + string cacheNodeStateShortText = default; + int? cacheNodeState = default; + IList driveConfiguration = default; + BgpConfiguration bgpConfiguration = default; + ProxyUrlConfiguration proxyUrlConfiguration = default; + ProxyRequired? isProxyRequired = default; + OSType? osType = default; + string autoUpdateVersion = default; + string updateInfoDetails = default; + DateTimeOffset? updateRequestedDateTime = default; + string autoUpdateNextAvailableVersion = default; + DateTimeOffset? autoUpdateNextAvailableDateTime = default; + string autoUpdateAppliedVersion = default; + string autoUpdateLastAppliedDetails = default; + string autoUpdateLastAppliedState = default; + DateTimeOffset? autoUpdateLastAppliedDateTime = default; + DateTimeOffset? autoUpdateLastTriggeredDateTime = default; + int? creationMethod = default; + string tlsStatus = default; + string optionalProperty1 = default; + string optionalProperty2 = default; + string optionalProperty3 = default; + string optionalProperty4 = default; + string optionalProperty5 = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("cacheNodePropertiesDetailsIssuesList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + cacheNodePropertiesDetailsIssuesList = array; + continue; + } + if (property.NameEquals("issuesList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + issuesList = array; + continue; + } + if (property.NameEquals("issuesCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + issuesCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("currentTlsCertificate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + currentTlsCertificate = MccCacheNodeTlsCertificate.DeserializeMccCacheNodeTlsCertificate(property.Value, options); + continue; + } + if (property.NameEquals("lastAutoUpdateInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastAutoUpdateInfo = MccCacheNodeAutoUpdateInfo.DeserializeMccCacheNodeAutoUpdateInfo(property.Value, options); + continue; + } + if (property.NameEquals("aggregatedStatusDetails"u8)) + { + aggregatedStatusDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("aggregatedStatusText"u8)) + { + aggregatedStatusText = property.Value.GetString(); + continue; + } + if (property.NameEquals("aggregatedStatusCode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + aggregatedStatusCode = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("productVersion"u8)) + { + productVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("isProvisioned"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isProvisioned = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("cacheNodeStateDetailedText"u8)) + { + cacheNodeStateDetailedText = property.Value.GetString(); + continue; + } + if (property.NameEquals("cacheNodeStateShortText"u8)) + { + cacheNodeStateShortText = property.Value.GetString(); + continue; + } + if (property.NameEquals("cacheNodeState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cacheNodeState = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("driveConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CacheNodeDriveConfiguration.DeserializeCacheNodeDriveConfiguration(item, options)); + } + driveConfiguration = array; + continue; + } + if (property.NameEquals("bgpConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bgpConfiguration = BgpConfiguration.DeserializeBgpConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("proxyUrlConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + proxyUrlConfiguration = ProxyUrlConfiguration.DeserializeProxyUrlConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("isProxyRequired"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isProxyRequired = new ProxyRequired(property.Value.GetString()); + continue; + } + if (property.NameEquals("osType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + osType = new OSType(property.Value.GetString()); + continue; + } + if (property.NameEquals("autoUpdateVersion"u8)) + { + autoUpdateVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("updateInfoDetails"u8)) + { + updateInfoDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("updateRequestedDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updateRequestedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("autoUpdateNextAvailableVersion"u8)) + { + autoUpdateNextAvailableVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("autoUpdateNextAvailableDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoUpdateNextAvailableDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("autoUpdateAppliedVersion"u8)) + { + autoUpdateAppliedVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("autoUpdateLastAppliedDetails"u8)) + { + autoUpdateLastAppliedDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("autoUpdateLastAppliedState"u8)) + { + autoUpdateLastAppliedState = property.Value.GetString(); + continue; + } + if (property.NameEquals("autoUpdateLastAppliedDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoUpdateLastAppliedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("autoUpdateLastTriggeredDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoUpdateLastTriggeredDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("creationMethod"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + creationMethod = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("tlsStatus"u8)) + { + tlsStatus = property.Value.GetString(); + continue; + } + if (property.NameEquals("optionalProperty1"u8)) + { + optionalProperty1 = property.Value.GetString(); + continue; + } + if (property.NameEquals("optionalProperty2"u8)) + { + optionalProperty2 = property.Value.GetString(); + continue; + } + if (property.NameEquals("optionalProperty3"u8)) + { + optionalProperty3 = property.Value.GetString(); + continue; + } + if (property.NameEquals("optionalProperty4"u8)) + { + optionalProperty4 = property.Value.GetString(); + continue; + } + if (property.NameEquals("optionalProperty5"u8)) + { + optionalProperty5 = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AdditionalCacheNodeProperties( + cacheNodePropertiesDetailsIssuesList ?? new ChangeTrackingList(), + issuesList ?? new ChangeTrackingList(), + issuesCount, + currentTlsCertificate, + lastAutoUpdateInfo, + aggregatedStatusDetails, + aggregatedStatusText, + aggregatedStatusCode, + productVersion, + isProvisioned, + cacheNodeStateDetailedText, + cacheNodeStateShortText, + cacheNodeState, + driveConfiguration ?? new ChangeTrackingList(), + bgpConfiguration, + proxyUrlConfiguration, + isProxyRequired, + osType, + autoUpdateVersion, + updateInfoDetails, + updateRequestedDateTime, + autoUpdateNextAvailableVersion, + autoUpdateNextAvailableDateTime, + autoUpdateAppliedVersion, + autoUpdateLastAppliedDetails, + autoUpdateLastAppliedState, + autoUpdateLastAppliedDateTime, + autoUpdateLastTriggeredDateTime, + creationMethod, + tlsStatus, + optionalProperty1, + optionalProperty2, + optionalProperty3, + optionalProperty4, + optionalProperty5, + 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(AdditionalCacheNodeProperties)} does not support writing '{options.Format}' format."); + } + } + + AdditionalCacheNodeProperties 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 DeserializeAdditionalCacheNodeProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AdditionalCacheNodeProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/AdditionalCacheNodeProperties.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/AdditionalCacheNodeProperties.cs new file mode 100644 index 000000000000..ef62fb4b0027 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/AdditionalCacheNodeProperties.cs @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + /// Model representing cache node for connected cache resource. + public partial class AdditionalCacheNodeProperties + { + /// + /// 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 AdditionalCacheNodeProperties() + { + CacheNodePropertiesDetailsIssuesList = new ChangeTrackingList(); + IssuesList = new ChangeTrackingList(); + DriveConfiguration = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// issues list to return the issues as part of the additional cache node properties. + /// current cache node issue list. + /// Number of cache node issues. + /// cache node current tls certificate. + /// cache node last auto update information. + /// Cache node resource aggregated status details. + /// Cache node resource aggregated status text. + /// Cache node resource aggregated status code. + /// Cache node resource Mcc product version. + /// Cache node resource flag indicating if cache node has been physically installed or provisioned on their physical lab. + /// Cache node resource detailed state text. + /// Cache node resource short state text. + /// Cache node resource state as integer. + /// Cache node resource drive configurations. + /// Cache node resource Bgp configuration. + /// proxyUrl configuration of the cache node. + /// Cache node resource requires a proxy. + /// Operating system of the cache node. + /// Auto update or fast update version. + /// Update related information details. + /// customer requested date time for mcc install of update cycle. + /// Auto update version that is the Next available version to update on mcc cache node. + /// Auto update last applied date time of mcc install. + /// Auto update version that is the applied to update on mcc cache node. + /// Auto Update status details from the backend after applying the new version details. + /// Last applied auto update state for mcc install of auto update cycle. + /// Auto update last applied date time of mcc install. + /// Auto update last triggered date time of mcc install. + /// Resource creation method of mcc cache node resource, cli or portal. + /// Cache node tls certificate status. + /// Optional property #1 of Mcc response object. + /// Optional property #2 of Mcc response object. + /// Optional property #3 of Mcc response object. + /// Optional property #4 of Mcc response object. + /// Optional property #5 of Mcc response object. + /// Keeps track of any properties unknown to the library. + internal AdditionalCacheNodeProperties(IList cacheNodePropertiesDetailsIssuesList, IReadOnlyList issuesList, int? issuesCount, MccCacheNodeTlsCertificate currentTlsCertificate, MccCacheNodeAutoUpdateInfo lastAutoUpdateInfo, string aggregatedStatusDetails, string aggregatedStatusText, int? aggregatedStatusCode, string productVersion, bool? isProvisioned, string cacheNodeStateDetailedText, string cacheNodeStateShortText, int? cacheNodeState, IList driveConfiguration, BgpConfiguration bgpConfiguration, ProxyUrlConfiguration proxyUrlConfiguration, ProxyRequired? isProxyRequired, OSType? osType, string autoUpdateVersion, string updateInfoDetails, DateTimeOffset? updateRequestedOn, string autoUpdateNextAvailableVersion, DateTimeOffset? autoUpdateNextAvailableOn, string autoUpdateAppliedVersion, string autoUpdateLastAppliedDetails, string autoUpdateLastAppliedState, DateTimeOffset? autoUpdateLastAppliedOn, DateTimeOffset? autoUpdateLastTriggeredOn, int? creationMethod, string tlsStatus, string optionalProperty1, string optionalProperty2, string optionalProperty3, string optionalProperty4, string optionalProperty5, IDictionary serializedAdditionalRawData) + { + CacheNodePropertiesDetailsIssuesList = cacheNodePropertiesDetailsIssuesList; + IssuesList = issuesList; + IssuesCount = issuesCount; + CurrentTlsCertificate = currentTlsCertificate; + LastAutoUpdateInfo = lastAutoUpdateInfo; + AggregatedStatusDetails = aggregatedStatusDetails; + AggregatedStatusText = aggregatedStatusText; + AggregatedStatusCode = aggregatedStatusCode; + ProductVersion = productVersion; + IsProvisioned = isProvisioned; + CacheNodeStateDetailedText = cacheNodeStateDetailedText; + CacheNodeStateShortText = cacheNodeStateShortText; + CacheNodeState = cacheNodeState; + DriveConfiguration = driveConfiguration; + BgpConfiguration = bgpConfiguration; + ProxyUrlConfiguration = proxyUrlConfiguration; + IsProxyRequired = isProxyRequired; + OSType = osType; + AutoUpdateVersion = autoUpdateVersion; + UpdateInfoDetails = updateInfoDetails; + UpdateRequestedOn = updateRequestedOn; + AutoUpdateNextAvailableVersion = autoUpdateNextAvailableVersion; + AutoUpdateNextAvailableOn = autoUpdateNextAvailableOn; + AutoUpdateAppliedVersion = autoUpdateAppliedVersion; + AutoUpdateLastAppliedDetails = autoUpdateLastAppliedDetails; + AutoUpdateLastAppliedState = autoUpdateLastAppliedState; + AutoUpdateLastAppliedOn = autoUpdateLastAppliedOn; + AutoUpdateLastTriggeredOn = autoUpdateLastTriggeredOn; + CreationMethod = creationMethod; + TlsStatus = tlsStatus; + OptionalProperty1 = optionalProperty1; + OptionalProperty2 = optionalProperty2; + OptionalProperty3 = optionalProperty3; + OptionalProperty4 = optionalProperty4; + OptionalProperty5 = optionalProperty5; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// issues list to return the issues as part of the additional cache node properties. + public IList CacheNodePropertiesDetailsIssuesList { get; } + /// current cache node issue list. + public IReadOnlyList IssuesList { get; } + /// Number of cache node issues. + public int? IssuesCount { get; } + /// cache node current tls certificate. + public MccCacheNodeTlsCertificate CurrentTlsCertificate { get; } + /// cache node last auto update information. + public MccCacheNodeAutoUpdateInfo LastAutoUpdateInfo { get; } + /// Cache node resource aggregated status details. + public string AggregatedStatusDetails { get; } + /// Cache node resource aggregated status text. + public string AggregatedStatusText { get; } + /// Cache node resource aggregated status code. + public int? AggregatedStatusCode { get; } + /// Cache node resource Mcc product version. + public string ProductVersion { get; } + /// Cache node resource flag indicating if cache node has been physically installed or provisioned on their physical lab. + public bool? IsProvisioned { get; } + /// Cache node resource detailed state text. + public string CacheNodeStateDetailedText { get; } + /// Cache node resource short state text. + public string CacheNodeStateShortText { get; } + /// Cache node resource state as integer. + public int? CacheNodeState { get; } + /// Cache node resource drive configurations. + public IList DriveConfiguration { get; } + /// Cache node resource Bgp configuration. + internal BgpConfiguration BgpConfiguration { get; set; } + /// Asn to ip address mapping. + public string BgpAsnToIPAddressMapping + { + get => BgpConfiguration is null ? default : BgpConfiguration.AsnToIPAddressMapping; + set + { + if (BgpConfiguration is null) + BgpConfiguration = new BgpConfiguration(); + BgpConfiguration.AsnToIPAddressMapping = value; + } + } + + /// proxyUrl configuration of the cache node. + internal ProxyUrlConfiguration ProxyUrlConfiguration { get; set; } + /// Host Proxy Address configuration along with port number. This can be a proxy or ip address. ex: xx.xx.xx.xxxx:80 or host name http://exampleproxy.com:80. + public string ProxyUri + { + get => ProxyUrlConfiguration is null ? default : ProxyUrlConfiguration.ProxyUri; + set + { + if (ProxyUrlConfiguration is null) + ProxyUrlConfiguration = new ProxyUrlConfiguration(); + ProxyUrlConfiguration.ProxyUri = value; + } + } + + /// Cache node resource requires a proxy. + public ProxyRequired? IsProxyRequired { get; set; } + /// Operating system of the cache node. + public OSType? OSType { get; set; } + /// Auto update or fast update version. + public string AutoUpdateVersion { get; set; } + /// Update related information details. + public string UpdateInfoDetails { get; set; } + /// customer requested date time for mcc install of update cycle. + public DateTimeOffset? UpdateRequestedOn { get; set; } + /// Auto update version that is the Next available version to update on mcc cache node. + public string AutoUpdateNextAvailableVersion { get; } + /// Auto update last applied date time of mcc install. + public DateTimeOffset? AutoUpdateNextAvailableOn { get; } + /// Auto update version that is the applied to update on mcc cache node. + public string AutoUpdateAppliedVersion { get; } + /// Auto Update status details from the backend after applying the new version details. + public string AutoUpdateLastAppliedDetails { get; } + /// Last applied auto update state for mcc install of auto update cycle. + public string AutoUpdateLastAppliedState { get; } + /// Auto update last applied date time of mcc install. + public DateTimeOffset? AutoUpdateLastAppliedOn { get; } + /// Auto update last triggered date time of mcc install. + public DateTimeOffset? AutoUpdateLastTriggeredOn { get; } + /// Resource creation method of mcc cache node resource, cli or portal. + public int? CreationMethod { get; set; } + /// Cache node tls certificate status. + public string TlsStatus { get; } + /// Optional property #1 of Mcc response object. + public string OptionalProperty1 { get; set; } + /// Optional property #2 of Mcc response object. + public string OptionalProperty2 { get; set; } + /// Optional property #3 of Mcc response object. + public string OptionalProperty3 { get; set; } + /// Optional property #4 of Mcc response object. + public string OptionalProperty4 { get; set; } + /// Optional property #5 of Mcc response object. + public string OptionalProperty5 { get; set; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/AdditionalCustomerProperties.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/AdditionalCustomerProperties.Serialization.cs new file mode 100644 index 000000000000..93a0586321f5 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/AdditionalCustomerProperties.Serialization.cs @@ -0,0 +1,543 @@ +// 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.ConnectedCache.Models +{ + public partial class AdditionalCustomerProperties : 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(AdditionalCustomerProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(CustomerPropertiesOverviewCacheEfficiency)) + { + writer.WritePropertyName("customerPropertiesOverviewCacheEfficiency"u8); + writer.WriteNumberValue(CustomerPropertiesOverviewCacheEfficiency.Value); + } + if (options.Format != "W" && Optional.IsDefined(CustomerPropertiesOverviewAverageEgressMbps)) + { + writer.WritePropertyName("customerPropertiesOverviewAverageEgressMbps"u8); + writer.WriteNumberValue(CustomerPropertiesOverviewAverageEgressMbps.Value); + } + if (options.Format != "W" && Optional.IsDefined(CustomerPropertiesOverviewAverageMissMbps)) + { + writer.WritePropertyName("customerPropertiesOverviewAverageMissMbps"u8); + writer.WriteNumberValue(CustomerPropertiesOverviewAverageMissMbps.Value); + } + if (options.Format != "W" && Optional.IsDefined(CustomerPropertiesOverviewEgressMbpsMax)) + { + writer.WritePropertyName("customerPropertiesOverviewEgressMbpsMax"u8); + writer.WriteNumberValue(CustomerPropertiesOverviewEgressMbpsMax.Value); + } + if (options.Format != "W" && Optional.IsDefined(CustomerPropertiesOverviewEgressMbpsMaxOn)) + { + writer.WritePropertyName("customerPropertiesOverviewEgressMbpsMaxDateTime"u8); + writer.WriteStringValue(CustomerPropertiesOverviewEgressMbpsMaxOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(CustomerPropertiesOverviewMissMbpsMax)) + { + writer.WritePropertyName("customerPropertiesOverviewMissMbpsMax"u8); + writer.WriteNumberValue(CustomerPropertiesOverviewMissMbpsMax.Value); + } + if (options.Format != "W" && Optional.IsDefined(CustomerPropertiesOverviewMissMbpsMaxOn)) + { + writer.WritePropertyName("customerPropertiesOverviewMissMbpsMaxDateTime"u8); + writer.WriteStringValue(CustomerPropertiesOverviewMissMbpsMaxOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(CustomerPropertiesOverviewCacheNodesHealthyCount)) + { + writer.WritePropertyName("customerPropertiesOverviewCacheNodesHealthyCount"u8); + writer.WriteNumberValue(CustomerPropertiesOverviewCacheNodesHealthyCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(CustomerPropertiesOverviewCacheNodesUnhealthyCount)) + { + writer.WritePropertyName("customerPropertiesOverviewCacheNodesUnhealthyCount"u8); + writer.WriteNumberValue(CustomerPropertiesOverviewCacheNodesUnhealthyCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(SignupStatus)) + { + writer.WritePropertyName("signupStatus"u8); + writer.WriteBooleanValue(SignupStatus.Value); + } + if (options.Format != "W" && Optional.IsDefined(SignupStatusCode)) + { + writer.WritePropertyName("signupStatusCode"u8); + writer.WriteNumberValue(SignupStatusCode.Value); + } + if (options.Format != "W" && Optional.IsDefined(SignupStatusText)) + { + writer.WritePropertyName("signupStatusText"u8); + writer.WriteStringValue(SignupStatusText); + } + if (options.Format != "W" && Optional.IsDefined(SignupPhaseStatusCode)) + { + writer.WritePropertyName("signupPhaseStatusCode"u8); + writer.WriteNumberValue(SignupPhaseStatusCode.Value); + } + if (options.Format != "W" && Optional.IsDefined(SignupPhaseStatusText)) + { + writer.WritePropertyName("signupPhaseStatusText"u8); + writer.WriteStringValue(SignupPhaseStatusText); + } + if (options.Format != "W" && Optional.IsDefined(PeeringDbLastUpdateDateValue)) + { + writer.WritePropertyName("peeringDbLastUpdateDate"u8); + writer.WriteStringValue(PeeringDbLastUpdateDateValue.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(CustomerOrgName)) + { + writer.WritePropertyName("customerOrgName"u8); + writer.WriteStringValue(CustomerOrgName); + } + if (Optional.IsDefined(CustomerEmail)) + { + writer.WritePropertyName("customerEmail"u8); + writer.WriteStringValue(CustomerEmail); + } + if (Optional.IsDefined(CustomerTransitAsn)) + { + writer.WritePropertyName("customerTransitAsn"u8); + writer.WriteStringValue(CustomerTransitAsn); + } + if (Optional.IsDefined(CustomerTransitState)) + { + writer.WritePropertyName("customerTransitState"u8); + writer.WriteStringValue(CustomerTransitState.Value.ToString()); + } + if (Optional.IsDefined(CustomerAsn)) + { + writer.WritePropertyName("customerAsn"u8); + writer.WriteStringValue(CustomerAsn); + } + if (options.Format != "W" && Optional.IsDefined(CustomerAsnEstimatedEgressPeekGbps)) + { + writer.WritePropertyName("customerAsnEstimatedEgressPeekGbps"u8); + writer.WriteNumberValue(CustomerAsnEstimatedEgressPeekGbps.Value); + } + if (Optional.IsDefined(CustomerEntitlementSkuId)) + { + writer.WritePropertyName("customerEntitlementSkuId"u8); + writer.WriteStringValue(CustomerEntitlementSkuId); + } + if (Optional.IsDefined(CustomerEntitlementSkuGuid)) + { + writer.WritePropertyName("customerEntitlementSkuGuid"u8); + writer.WriteStringValue(CustomerEntitlementSkuGuid); + } + if (Optional.IsDefined(CustomerEntitlementSkuName)) + { + writer.WritePropertyName("customerEntitlementSkuName"u8); + writer.WriteStringValue(CustomerEntitlementSkuName); + } + if (Optional.IsDefined(CustomerEntitlementExpiration)) + { + writer.WritePropertyName("customerEntitlementExpiration"u8); + writer.WriteStringValue(CustomerEntitlementExpiration.Value, "O"); + } + if (Optional.IsDefined(OptionalProperty1)) + { + writer.WritePropertyName("optionalProperty1"u8); + writer.WriteStringValue(OptionalProperty1); + } + if (Optional.IsDefined(OptionalProperty2)) + { + writer.WritePropertyName("optionalProperty2"u8); + writer.WriteStringValue(OptionalProperty2); + } + if (Optional.IsDefined(OptionalProperty3)) + { + writer.WritePropertyName("optionalProperty3"u8); + writer.WriteStringValue(OptionalProperty3); + } + if (Optional.IsDefined(OptionalProperty4)) + { + writer.WritePropertyName("optionalProperty4"u8); + writer.WriteStringValue(OptionalProperty4); + } + if (Optional.IsDefined(OptionalProperty5)) + { + writer.WritePropertyName("optionalProperty5"u8); + writer.WriteStringValue(OptionalProperty5); + } + 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 + } + } + } + + AdditionalCustomerProperties 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(AdditionalCustomerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAdditionalCustomerProperties(document.RootElement, options); + } + + internal static AdditionalCustomerProperties DeserializeAdditionalCustomerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + float? customerPropertiesOverviewCacheEfficiency = default; + float? customerPropertiesOverviewAverageEgressMbps = default; + float? customerPropertiesOverviewAverageMissMbps = default; + float? customerPropertiesOverviewEgressMbpsMax = default; + DateTimeOffset? customerPropertiesOverviewEgressMbpsMaxDateTime = default; + float? customerPropertiesOverviewMissMbpsMax = default; + DateTimeOffset? customerPropertiesOverviewMissMbpsMaxDateTime = default; + int? customerPropertiesOverviewCacheNodesHealthyCount = default; + int? customerPropertiesOverviewCacheNodesUnhealthyCount = default; + bool? signupStatus = default; + int? signupStatusCode = default; + string signupStatusText = default; + int? signupPhaseStatusCode = default; + string signupPhaseStatusText = default; + DateTimeOffset? peeringDbLastUpdateDate = default; + string customerOrgName = default; + string customerEmail = default; + string customerTransitAsn = default; + CustomerTransitState? customerTransitState = default; + string customerAsn = default; + float? customerAsnEstimatedEgressPeekGbps = default; + string customerEntitlementSkuId = default; + string customerEntitlementSkuGuid = default; + string customerEntitlementSkuName = default; + DateTimeOffset? customerEntitlementExpiration = default; + string optionalProperty1 = default; + string optionalProperty2 = default; + string optionalProperty3 = default; + string optionalProperty4 = default; + string optionalProperty5 = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customerPropertiesOverviewCacheEfficiency"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customerPropertiesOverviewCacheEfficiency = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("customerPropertiesOverviewAverageEgressMbps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customerPropertiesOverviewAverageEgressMbps = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("customerPropertiesOverviewAverageMissMbps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customerPropertiesOverviewAverageMissMbps = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("customerPropertiesOverviewEgressMbpsMax"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customerPropertiesOverviewEgressMbpsMax = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("customerPropertiesOverviewEgressMbpsMaxDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customerPropertiesOverviewEgressMbpsMaxDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("customerPropertiesOverviewMissMbpsMax"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customerPropertiesOverviewMissMbpsMax = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("customerPropertiesOverviewMissMbpsMaxDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customerPropertiesOverviewMissMbpsMaxDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("customerPropertiesOverviewCacheNodesHealthyCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customerPropertiesOverviewCacheNodesHealthyCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("customerPropertiesOverviewCacheNodesUnhealthyCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customerPropertiesOverviewCacheNodesUnhealthyCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("signupStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + signupStatus = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("signupStatusCode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + signupStatusCode = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("signupStatusText"u8)) + { + signupStatusText = property.Value.GetString(); + continue; + } + if (property.NameEquals("signupPhaseStatusCode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + signupPhaseStatusCode = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("signupPhaseStatusText"u8)) + { + signupPhaseStatusText = property.Value.GetString(); + continue; + } + if (property.NameEquals("peeringDbLastUpdateDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peeringDbLastUpdateDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("customerOrgName"u8)) + { + customerOrgName = property.Value.GetString(); + continue; + } + if (property.NameEquals("customerEmail"u8)) + { + customerEmail = property.Value.GetString(); + continue; + } + if (property.NameEquals("customerTransitAsn"u8)) + { + customerTransitAsn = property.Value.GetString(); + continue; + } + if (property.NameEquals("customerTransitState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customerTransitState = new CustomerTransitState(property.Value.GetString()); + continue; + } + if (property.NameEquals("customerAsn"u8)) + { + customerAsn = property.Value.GetString(); + continue; + } + if (property.NameEquals("customerAsnEstimatedEgressPeekGbps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customerAsnEstimatedEgressPeekGbps = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("customerEntitlementSkuId"u8)) + { + customerEntitlementSkuId = property.Value.GetString(); + continue; + } + if (property.NameEquals("customerEntitlementSkuGuid"u8)) + { + customerEntitlementSkuGuid = property.Value.GetString(); + continue; + } + if (property.NameEquals("customerEntitlementSkuName"u8)) + { + customerEntitlementSkuName = property.Value.GetString(); + continue; + } + if (property.NameEquals("customerEntitlementExpiration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customerEntitlementExpiration = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("optionalProperty1"u8)) + { + optionalProperty1 = property.Value.GetString(); + continue; + } + if (property.NameEquals("optionalProperty2"u8)) + { + optionalProperty2 = property.Value.GetString(); + continue; + } + if (property.NameEquals("optionalProperty3"u8)) + { + optionalProperty3 = property.Value.GetString(); + continue; + } + if (property.NameEquals("optionalProperty4"u8)) + { + optionalProperty4 = property.Value.GetString(); + continue; + } + if (property.NameEquals("optionalProperty5"u8)) + { + optionalProperty5 = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AdditionalCustomerProperties( + customerPropertiesOverviewCacheEfficiency, + customerPropertiesOverviewAverageEgressMbps, + customerPropertiesOverviewAverageMissMbps, + customerPropertiesOverviewEgressMbpsMax, + customerPropertiesOverviewEgressMbpsMaxDateTime, + customerPropertiesOverviewMissMbpsMax, + customerPropertiesOverviewMissMbpsMaxDateTime, + customerPropertiesOverviewCacheNodesHealthyCount, + customerPropertiesOverviewCacheNodesUnhealthyCount, + signupStatus, + signupStatusCode, + signupStatusText, + signupPhaseStatusCode, + signupPhaseStatusText, + peeringDbLastUpdateDate, + customerOrgName, + customerEmail, + customerTransitAsn, + customerTransitState, + customerAsn, + customerAsnEstimatedEgressPeekGbps, + customerEntitlementSkuId, + customerEntitlementSkuGuid, + customerEntitlementSkuName, + customerEntitlementExpiration, + optionalProperty1, + optionalProperty2, + optionalProperty3, + optionalProperty4, + optionalProperty5, + 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(AdditionalCustomerProperties)} does not support writing '{options.Format}' format."); + } + } + + AdditionalCustomerProperties 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 DeserializeAdditionalCustomerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AdditionalCustomerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/AdditionalCustomerProperties.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/AdditionalCustomerProperties.cs new file mode 100644 index 000000000000..eedfdceaf5db --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/AdditionalCustomerProperties.cs @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + /// Model representing customer for connected cache resource. + public partial class AdditionalCustomerProperties + { + /// + /// 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 AdditionalCustomerProperties() + { + } + + /// Initializes a new instance of . + /// Customer resource cache efficiency. + /// Customer resource average egress in Mbps. + /// Customer resource average cache miss throughput in Mbps. + /// Customer resource maximum egress in Mbps. + /// Customer resource peak egress timestamp. + /// Customer resource maximum cache miss throughput in Mbps. + /// Customer resource peak cache miss throughput timestamp. + /// Customer resource total healthy cache nodes. + /// Customer resource total unhealthy cache nodes. + /// Customer resource signup status as boolean. + /// Customer resource signup status as integer code. + /// Customer resource signup status as string text. + /// Customer resource signup phase status code as integer. + /// Customer resource signup phase status as string text. + /// Customer resource last PeeringDB update timestamp. + /// Customer resource owner organization name. + /// Customer resource contact email. + /// Customer resource transit Asn (autonomous system number). + /// Customer resource transit state. + /// Customer resource Asn (autonomous system number). + /// Customer resource estimated Asn peering peak in Gbps. + /// Customer resource entitlement Sku Id. + /// Customer resource entitlement Sku Guid. + /// Customer resource entitlement Sku name. + /// Customer resource entitlement expiration date string. + /// Optional property #1 of Mcc response object. + /// Optional property #2 of Mcc response object. + /// Optional property #3 of Mcc response object. + /// Optional property #4 of Mcc response object. + /// Optional property #5 of Mcc response object. + /// Keeps track of any properties unknown to the library. + internal AdditionalCustomerProperties(float? customerPropertiesOverviewCacheEfficiency, float? customerPropertiesOverviewAverageEgressMbps, float? customerPropertiesOverviewAverageMissMbps, float? customerPropertiesOverviewEgressMbpsMax, DateTimeOffset? customerPropertiesOverviewEgressMbpsMaxOn, float? customerPropertiesOverviewMissMbpsMax, DateTimeOffset? customerPropertiesOverviewMissMbpsMaxOn, int? customerPropertiesOverviewCacheNodesHealthyCount, int? customerPropertiesOverviewCacheNodesUnhealthyCount, bool? signupStatus, int? signupStatusCode, string signupStatusText, int? signupPhaseStatusCode, string signupPhaseStatusText, DateTimeOffset? peeringDbLastUpdateDateValue, string customerOrgName, string customerEmail, string customerTransitAsn, CustomerTransitState? customerTransitState, string customerAsn, float? customerAsnEstimatedEgressPeekGbps, string customerEntitlementSkuId, string customerEntitlementSkuGuid, string customerEntitlementSkuName, DateTimeOffset? customerEntitlementExpiration, string optionalProperty1, string optionalProperty2, string optionalProperty3, string optionalProperty4, string optionalProperty5, IDictionary serializedAdditionalRawData) + { + CustomerPropertiesOverviewCacheEfficiency = customerPropertiesOverviewCacheEfficiency; + CustomerPropertiesOverviewAverageEgressMbps = customerPropertiesOverviewAverageEgressMbps; + CustomerPropertiesOverviewAverageMissMbps = customerPropertiesOverviewAverageMissMbps; + CustomerPropertiesOverviewEgressMbpsMax = customerPropertiesOverviewEgressMbpsMax; + CustomerPropertiesOverviewEgressMbpsMaxOn = customerPropertiesOverviewEgressMbpsMaxOn; + CustomerPropertiesOverviewMissMbpsMax = customerPropertiesOverviewMissMbpsMax; + CustomerPropertiesOverviewMissMbpsMaxOn = customerPropertiesOverviewMissMbpsMaxOn; + CustomerPropertiesOverviewCacheNodesHealthyCount = customerPropertiesOverviewCacheNodesHealthyCount; + CustomerPropertiesOverviewCacheNodesUnhealthyCount = customerPropertiesOverviewCacheNodesUnhealthyCount; + SignupStatus = signupStatus; + SignupStatusCode = signupStatusCode; + SignupStatusText = signupStatusText; + SignupPhaseStatusCode = signupPhaseStatusCode; + SignupPhaseStatusText = signupPhaseStatusText; + PeeringDbLastUpdateDateValue = peeringDbLastUpdateDateValue; + CustomerOrgName = customerOrgName; + CustomerEmail = customerEmail; + CustomerTransitAsn = customerTransitAsn; + CustomerTransitState = customerTransitState; + CustomerAsn = customerAsn; + CustomerAsnEstimatedEgressPeekGbps = customerAsnEstimatedEgressPeekGbps; + CustomerEntitlementSkuId = customerEntitlementSkuId; + CustomerEntitlementSkuGuid = customerEntitlementSkuGuid; + CustomerEntitlementSkuName = customerEntitlementSkuName; + CustomerEntitlementExpiration = customerEntitlementExpiration; + OptionalProperty1 = optionalProperty1; + OptionalProperty2 = optionalProperty2; + OptionalProperty3 = optionalProperty3; + OptionalProperty4 = optionalProperty4; + OptionalProperty5 = optionalProperty5; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Customer resource cache efficiency. + public float? CustomerPropertiesOverviewCacheEfficiency { get; } + /// Customer resource average egress in Mbps. + public float? CustomerPropertiesOverviewAverageEgressMbps { get; } + /// Customer resource average cache miss throughput in Mbps. + public float? CustomerPropertiesOverviewAverageMissMbps { get; } + /// Customer resource maximum egress in Mbps. + public float? CustomerPropertiesOverviewEgressMbpsMax { get; } + /// Customer resource peak egress timestamp. + public DateTimeOffset? CustomerPropertiesOverviewEgressMbpsMaxOn { get; } + /// Customer resource maximum cache miss throughput in Mbps. + public float? CustomerPropertiesOverviewMissMbpsMax { get; } + /// Customer resource peak cache miss throughput timestamp. + public DateTimeOffset? CustomerPropertiesOverviewMissMbpsMaxOn { get; } + /// Customer resource total healthy cache nodes. + public int? CustomerPropertiesOverviewCacheNodesHealthyCount { get; } + /// Customer resource total unhealthy cache nodes. + public int? CustomerPropertiesOverviewCacheNodesUnhealthyCount { get; } + /// Customer resource signup status as boolean. + public bool? SignupStatus { get; } + /// Customer resource signup status as integer code. + public int? SignupStatusCode { get; } + /// Customer resource signup status as string text. + public string SignupStatusText { get; } + /// Customer resource signup phase status code as integer. + public int? SignupPhaseStatusCode { get; } + /// Customer resource signup phase status as string text. + public string SignupPhaseStatusText { get; } + /// Customer resource last PeeringDB update timestamp. + public DateTimeOffset? PeeringDbLastUpdateDateValue { get; } + /// Customer resource owner organization name. + public string CustomerOrgName { get; } + /// Customer resource contact email. + public string CustomerEmail { get; set; } + /// Customer resource transit Asn (autonomous system number). + public string CustomerTransitAsn { get; set; } + /// Customer resource transit state. + public CustomerTransitState? CustomerTransitState { get; set; } + /// Customer resource Asn (autonomous system number). + public string CustomerAsn { get; set; } + /// Customer resource estimated Asn peering peak in Gbps. + public float? CustomerAsnEstimatedEgressPeekGbps { get; } + /// Customer resource entitlement Sku Id. + public string CustomerEntitlementSkuId { get; set; } + /// Customer resource entitlement Sku Guid. + public string CustomerEntitlementSkuGuid { get; set; } + /// Customer resource entitlement Sku name. + public string CustomerEntitlementSkuName { get; set; } + /// Customer resource entitlement expiration date string. + public DateTimeOffset? CustomerEntitlementExpiration { get; set; } + /// Optional property #1 of Mcc response object. + public string OptionalProperty1 { get; set; } + /// Optional property #2 of Mcc response object. + public string OptionalProperty2 { get; set; } + /// Optional property #3 of Mcc response object. + public string OptionalProperty3 { get; set; } + /// Optional property #4 of Mcc response object. + public string OptionalProperty4 { get; set; } + /// Optional property #5 of Mcc response object. + public string OptionalProperty5 { get; set; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/AutoUpdateRingType.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/AutoUpdateRingType.cs new file mode 100644 index 000000000000..3ffab60def18 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/AutoUpdateRingType.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.ConnectedCache.Models +{ + /// Auto update Ring type. + public readonly partial struct AutoUpdateRingType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AutoUpdateRingType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PreviewValue = "Preview"; + private const string SlowValue = "Slow"; + private const string FastValue = "Fast"; + + /// customer selection of preview update install mcc on their physical vm. + public static AutoUpdateRingType Preview { get; } = new AutoUpdateRingType(PreviewValue); + /// customer selection of slow update to install mcc on their physical vm. + public static AutoUpdateRingType Slow { get; } = new AutoUpdateRingType(SlowValue); + /// customer selection of fast / auto update to install mcc on their physical vm. + public static AutoUpdateRingType Fast { get; } = new AutoUpdateRingType(FastValue); + /// Determines if two values are the same. + public static bool operator ==(AutoUpdateRingType left, AutoUpdateRingType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AutoUpdateRingType left, AutoUpdateRingType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AutoUpdateRingType(string value) => new AutoUpdateRingType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AutoUpdateRingType other && Equals(other); + /// + public bool Equals(AutoUpdateRingType 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/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/BgpCidrsConfiguration.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/BgpCidrsConfiguration.Serialization.cs new file mode 100644 index 000000000000..633abfa57f32 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/BgpCidrsConfiguration.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + internal partial class BgpCidrsConfiguration : 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(BgpCidrsConfiguration)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsCollectionDefined(BgpCidrs)) + { + writer.WritePropertyName("bgpCidrs"u8); + writer.WriteStartArray(); + foreach (var item in BgpCidrs) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BgpCidrsConfiguration 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(BgpCidrsConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBgpCidrsConfiguration(document.RootElement, options); + } + + internal static BgpCidrsConfiguration DeserializeBgpCidrsConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList bgpCidrs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("bgpCidrs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + bgpCidrs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BgpCidrsConfiguration(bgpCidrs ?? 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(BgpCidrsConfiguration)} does not support writing '{options.Format}' format."); + } + } + + BgpCidrsConfiguration 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 DeserializeBgpCidrsConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BgpCidrsConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/BgpCidrsConfiguration.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/BgpCidrsConfiguration.cs new file mode 100644 index 000000000000..353ee7a54742 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/BgpCidrsConfiguration.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + /// Mcc cache node Bgp Cidr details. + internal partial class BgpCidrsConfiguration + { + /// + /// 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 BgpCidrsConfiguration() + { + BgpCidrs = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Mcc cache node Bgp Cidr details. + /// Keeps track of any properties unknown to the library. + internal BgpCidrsConfiguration(IReadOnlyList bgpCidrs, IDictionary serializedAdditionalRawData) + { + BgpCidrs = bgpCidrs; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Mcc cache node Bgp Cidr details. + public IReadOnlyList BgpCidrs { get; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/BgpConfiguration.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/BgpConfiguration.Serialization.cs new file mode 100644 index 000000000000..19d937e77e8d --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/BgpConfiguration.Serialization.cs @@ -0,0 +1,129 @@ +// 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.ConnectedCache.Models +{ + internal partial class BgpConfiguration : 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(BgpConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AsnToIPAddressMapping)) + { + writer.WritePropertyName("asnToIpAddressMapping"u8); + writer.WriteStringValue(AsnToIPAddressMapping); + } + 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 + } + } + } + + BgpConfiguration 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(BgpConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBgpConfiguration(document.RootElement, options); + } + + internal static BgpConfiguration DeserializeBgpConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string asnToIPAddressMapping = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("asnToIpAddressMapping"u8)) + { + asnToIPAddressMapping = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BgpConfiguration(asnToIPAddressMapping, 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(BgpConfiguration)} does not support writing '{options.Format}' format."); + } + } + + BgpConfiguration 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 DeserializeBgpConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BgpConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/BgpConfiguration.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/BgpConfiguration.cs new file mode 100644 index 000000000000..7316b30e551d --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/BgpConfiguration.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + /// Bgp configuration of cache node. + internal partial class BgpConfiguration + { + /// + /// 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 BgpConfiguration() + { + } + + /// Initializes a new instance of . + /// Asn to ip address mapping. + /// Keeps track of any properties unknown to the library. + internal BgpConfiguration(string asnToIPAddressMapping, IDictionary serializedAdditionalRawData) + { + AsnToIPAddressMapping = asnToIPAddressMapping; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Asn to ip address mapping. + public string AsnToIPAddressMapping { get; set; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/BgpReviewStateEnum.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/BgpReviewStateEnum.cs new file mode 100644 index 000000000000..aee6762d82ec --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/BgpReviewStateEnum.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.ConnectedCache.Models +{ + /// Cache node resource Bgp review state as integer. + public readonly partial struct BgpReviewStateEnum : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BgpReviewStateEnum(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotConfiguredValue = "NotConfigured"; + private const string InReviewValue = "InReview"; + private const string ApprovedValue = "Approved"; + private const string AttentionRequiredValue = "AttentionRequired"; + + /// bgp not configured. + public static BgpReviewStateEnum NotConfigured { get; } = new BgpReviewStateEnum(NotConfiguredValue); + /// bgp is in review state. + public static BgpReviewStateEnum InReview { get; } = new BgpReviewStateEnum(InReviewValue); + /// bgp is in Approved state. + public static BgpReviewStateEnum Approved { get; } = new BgpReviewStateEnum(ApprovedValue); + /// bgp is setup need an attention for more troubleshoot. + public static BgpReviewStateEnum AttentionRequired { get; } = new BgpReviewStateEnum(AttentionRequiredValue); + /// Determines if two values are the same. + public static bool operator ==(BgpReviewStateEnum left, BgpReviewStateEnum right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BgpReviewStateEnum left, BgpReviewStateEnum right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BgpReviewStateEnum(string value) => new BgpReviewStateEnum(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BgpReviewStateEnum other && Equals(other); + /// + public bool Equals(BgpReviewStateEnum 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/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CacheNodeDriveConfiguration.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CacheNodeDriveConfiguration.Serialization.cs new file mode 100644 index 000000000000..81d4171e7db2 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CacheNodeDriveConfiguration.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + public partial class CacheNodeDriveConfiguration : 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(CacheNodeDriveConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(PhysicalPath)) + { + writer.WritePropertyName("physicalPath"u8); + writer.WriteStringValue(PhysicalPath); + } + if (Optional.IsDefined(SizeInGb)) + { + writer.WritePropertyName("sizeInGb"u8); + writer.WriteNumberValue(SizeInGb.Value); + } + if (Optional.IsDefined(CacheNumber)) + { + writer.WritePropertyName("cacheNumber"u8); + writer.WriteNumberValue(CacheNumber.Value); + } + if (Optional.IsDefined(NginxMapping)) + { + writer.WritePropertyName("nginxMapping"u8); + writer.WriteStringValue(NginxMapping); + } + 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 + } + } + } + + CacheNodeDriveConfiguration 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(CacheNodeDriveConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCacheNodeDriveConfiguration(document.RootElement, options); + } + + internal static CacheNodeDriveConfiguration DeserializeCacheNodeDriveConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string physicalPath = default; + int? sizeInGb = default; + int? cacheNumber = default; + string nginxMapping = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("physicalPath"u8)) + { + physicalPath = property.Value.GetString(); + continue; + } + if (property.NameEquals("sizeInGb"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sizeInGb = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("cacheNumber"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cacheNumber = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("nginxMapping"u8)) + { + nginxMapping = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CacheNodeDriveConfiguration(physicalPath, sizeInGb, cacheNumber, nginxMapping, 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(CacheNodeDriveConfiguration)} does not support writing '{options.Format}' format."); + } + } + + CacheNodeDriveConfiguration 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 DeserializeCacheNodeDriveConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CacheNodeDriveConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CacheNodeDriveConfiguration.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CacheNodeDriveConfiguration.cs new file mode 100644 index 000000000000..e0a296f4da5a --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CacheNodeDriveConfiguration.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.ConnectedCache.Models +{ + /// Drive configuration for cache node. + public partial class CacheNodeDriveConfiguration + { + /// + /// 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 CacheNodeDriveConfiguration() + { + } + + /// Initializes a new instance of . + /// physical path location of the folder used for caching content. + /// physical size of the drive used for caching content. + /// corresponding nginx cache number. Valid cache numbers are 1 - 20. + /// full binding for corresponding nginx cache drive. + /// Keeps track of any properties unknown to the library. + internal CacheNodeDriveConfiguration(string physicalPath, int? sizeInGb, int? cacheNumber, string nginxMapping, IDictionary serializedAdditionalRawData) + { + PhysicalPath = physicalPath; + SizeInGb = sizeInGb; + CacheNumber = cacheNumber; + NginxMapping = nginxMapping; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// physical path location of the folder used for caching content. + public string PhysicalPath { get; set; } + /// physical size of the drive used for caching content. + public int? SizeInGb { get; set; } + /// corresponding nginx cache number. Valid cache numbers are 1 - 20. + public int? CacheNumber { get; set; } + /// full binding for corresponding nginx cache drive. + public string NginxMapping { get; set; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CacheNodeEntity.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CacheNodeEntity.Serialization.cs new file mode 100644 index 000000000000..94a6ea0bc15b --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CacheNodeEntity.Serialization.cs @@ -0,0 +1,877 @@ +// 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.ConnectedCache.Models +{ + public partial class CacheNodeEntity : 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(CacheNodeEntity)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(FullyQualifiedResourceId)) + { + writer.WritePropertyName("fullyQualifiedResourceId"u8); + writer.WriteStringValue(FullyQualifiedResourceId); + } + if (options.Format != "W" && Optional.IsDefined(CustomerId)) + { + writer.WritePropertyName("customerId"u8); + writer.WriteStringValue(CustomerId); + } + if (Optional.IsDefined(CustomerName)) + { + writer.WritePropertyName("customerName"u8); + writer.WriteStringValue(CustomerName); + } + if (Optional.IsDefined(IPAddress)) + { + writer.WritePropertyName("ipAddress"u8); + writer.WriteStringValue(IPAddress); + } + if (Optional.IsDefined(CustomerIndex)) + { + writer.WritePropertyName("customerIndex"u8); + writer.WriteStringValue(CustomerIndex); + } + if (Optional.IsDefined(CacheNodeId)) + { + writer.WritePropertyName("cacheNodeId"u8); + writer.WriteStringValue(CacheNodeId); + } + if (Optional.IsDefined(CacheNodeName)) + { + writer.WritePropertyName("cacheNodeName"u8); + writer.WriteStringValue(CacheNodeName); + } + if (Optional.IsDefined(CustomerAsn)) + { + writer.WritePropertyName("customerAsn"u8); + writer.WriteNumberValue(CustomerAsn.Value); + } + if (Optional.IsDefined(IsEnabled)) + { + writer.WritePropertyName("isEnabled"u8); + writer.WriteBooleanValue(IsEnabled.Value); + } + if (Optional.IsDefined(MaxAllowableEgressInMbps)) + { + writer.WritePropertyName("maxAllowableEgressInMbps"u8); + writer.WriteNumberValue(MaxAllowableEgressInMbps.Value); + } + if (options.Format != "W" && Optional.IsDefined(MaxAllowableProbability)) + { + writer.WritePropertyName("maxAllowableProbability"u8); + writer.WriteNumberValue(MaxAllowableProbability.Value); + } + if (options.Format != "W" && Optional.IsDefined(XCid)) + { + writer.WritePropertyName("xCid"u8); + writer.WriteStringValue(XCid); + } + if (Optional.IsDefined(IsEnterpriseManaged)) + { + writer.WritePropertyName("isEnterpriseManaged"u8); + writer.WriteBooleanValue(IsEnterpriseManaged.Value); + } + if (options.Format != "W" && Optional.IsDefined(CreateAsyncOperationId)) + { + writer.WritePropertyName("createAsyncOperationId"u8); + writer.WriteStringValue(CreateAsyncOperationId); + } + if (options.Format != "W" && Optional.IsDefined(DeleteAsyncOperationId)) + { + writer.WritePropertyName("deleteAsyncOperationId"u8); + writer.WriteStringValue(DeleteAsyncOperationId); + } + if (options.Format != "W" && Optional.IsDefined(ClientTenantId)) + { + writer.WritePropertyName("clientTenantId"u8); + writer.WriteStringValue(ClientTenantId); + } + if (options.Format != "W" && Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + } + if (options.Format != "W" && Optional.IsDefined(ReleaseVersion)) + { + writer.WritePropertyName("releaseVersion"u8); + writer.WriteNumberValue(ReleaseVersion.Value); + } + if (options.Format != "W" && Optional.IsDefined(LastSyncWithAzureTimestamp)) + { + writer.WritePropertyName("lastSyncWithAzureTimestamp"u8); + writer.WriteStringValue(LastSyncWithAzureTimestamp.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LastUpdatedTimestamp)) + { + writer.WritePropertyName("lastUpdatedTimestamp"u8); + writer.WriteStringValue(LastUpdatedTimestamp.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(SynchWithAzureAttemptsCount)) + { + writer.WritePropertyName("synchWithAzureAttemptsCount"u8); + writer.WriteNumberValue(SynchWithAzureAttemptsCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(ContainerConfigurations)) + { + writer.WritePropertyName("containerConfigurations"u8); + writer.WriteStringValue(ContainerConfigurations); + } + if (Optional.IsCollectionDefined(CidrCsv)) + { + writer.WritePropertyName("cidrCsv"u8); + writer.WriteStartArray(); + foreach (var item in CidrCsv) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(CidrCsvLastUpdateOn)) + { + writer.WritePropertyName("cidrCsvLastUpdateTime"u8); + writer.WriteStringValue(CidrCsvLastUpdateOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(BgpCidrCsvLastUpdateOn)) + { + writer.WritePropertyName("bgpCidrCsvLastUpdateTime"u8); + writer.WriteStringValue(BgpCidrCsvLastUpdateOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(BgpLastReportedOn)) + { + writer.WritePropertyName("bgpLastReportedTime"u8); + writer.WriteStringValue(BgpLastReportedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(BgpReviewStateText)) + { + writer.WritePropertyName("bgpReviewStateText"u8); + writer.WriteStringValue(BgpReviewStateText); + } + if (options.Format != "W" && Optional.IsDefined(BgpReviewState)) + { + writer.WritePropertyName("bgpReviewState"u8); + writer.WriteStringValue(BgpReviewState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(BgpReviewFeedback)) + { + writer.WritePropertyName("bgpReviewFeedback"u8); + writer.WriteStringValue(BgpReviewFeedback); + } + if (options.Format != "W" && Optional.IsDefined(BgpNumberOfTimesUpdated)) + { + writer.WritePropertyName("bgpNumberOfTimesUpdated"u8); + writer.WriteNumberValue(BgpNumberOfTimesUpdated.Value); + } + if (options.Format != "W" && Optional.IsDefined(BgpNumberOfRecords)) + { + writer.WritePropertyName("bgpNumberOfRecords"u8); + writer.WriteNumberValue(BgpNumberOfRecords.Value); + } + if (options.Format != "W" && Optional.IsDefined(BgpCidrBlocksCount)) + { + writer.WritePropertyName("bgpCidrBlocksCount"u8); + writer.WriteNumberValue(BgpCidrBlocksCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(BgpAddressSpace)) + { + writer.WritePropertyName("bgpAddressSpace"u8); + writer.WriteNumberValue(BgpAddressSpace.Value); + } + if (Optional.IsDefined(ShouldMigrate)) + { + writer.WritePropertyName("shouldMigrate"u8); + writer.WriteBooleanValue(ShouldMigrate.Value); + } + if (options.Format != "W" && Optional.IsDefined(BgpFileBytesTruncated)) + { + writer.WritePropertyName("bgpFileBytesTruncated"u8); + writer.WriteNumberValue(BgpFileBytesTruncated.Value); + } + if (Optional.IsDefined(CidrSelectionType)) + { + writer.WritePropertyName("cidrSelectionType"u8); + writer.WriteNumberValue(CidrSelectionType.Value); + } + if (options.Format != "W" && Optional.IsDefined(IsFrozen)) + { + writer.WritePropertyName("isFrozen"u8); + writer.WriteBooleanValue(IsFrozen.Value); + } + if (options.Format != "W" && Optional.IsDefined(ReviewState)) + { + writer.WritePropertyName("reviewState"u8); + writer.WriteNumberValue(ReviewState.Value); + } + if (options.Format != "W" && Optional.IsDefined(ReviewStateText)) + { + writer.WritePropertyName("reviewStateText"u8); + writer.WriteStringValue(ReviewStateText); + } + if (options.Format != "W" && Optional.IsDefined(ReviewFeedback)) + { + writer.WritePropertyName("reviewFeedback"u8); + writer.WriteStringValue(ReviewFeedback); + } + if (options.Format != "W" && Optional.IsDefined(ConfigurationState)) + { + writer.WritePropertyName("configurationState"u8); + writer.WriteStringValue(ConfigurationState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ConfigurationStateText)) + { + writer.WritePropertyName("configurationStateText"u8); + writer.WriteStringValue(ConfigurationStateText); + } + if (options.Format != "W" && Optional.IsDefined(AddressSpace)) + { + writer.WritePropertyName("addressSpace"u8); + writer.WriteNumberValue(AddressSpace.Value); + } + if (options.Format != "W" && Optional.IsDefined(WorkerConnections)) + { + writer.WritePropertyName("workerConnections"u8); + writer.WriteNumberValue(WorkerConnections.Value); + } + if (options.Format != "W" && Optional.IsDefined(WorkerConnectionsLastUpdatedOn)) + { + writer.WritePropertyName("workerConnectionsLastUpdatedDateTime"u8); + writer.WriteStringValue(WorkerConnectionsLastUpdatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(ContainerResyncTrigger)) + { + writer.WritePropertyName("containerResyncTrigger"u8); + writer.WriteNumberValue(ContainerResyncTrigger.Value); + } + if (options.Format != "W" && Optional.IsDefined(ImageUri)) + { + writer.WritePropertyName("imageUri"u8); + writer.WriteStringValue(ImageUri); + } + if (Optional.IsDefined(FullyQualifiedDomainName)) + { + writer.WritePropertyName("fullyQualifiedDomainName"u8); + writer.WriteStringValue(FullyQualifiedDomainName); + } + if (Optional.IsDefined(AutoUpdateRingType)) + { + writer.WritePropertyName("autoUpdateRingType"u8); + writer.WriteStringValue(AutoUpdateRingType.Value.ToString()); + } + if (Optional.IsDefined(AutoUpdateRequestedWeek)) + { + writer.WritePropertyName("autoUpdateRequestedWeek"u8); + writer.WriteNumberValue(AutoUpdateRequestedWeek.Value); + } + if (Optional.IsDefined(AutoUpdateRequestedDay)) + { + writer.WritePropertyName("autoUpdateRequestedDay"u8); + writer.WriteNumberValue(AutoUpdateRequestedDay.Value); + } + if (Optional.IsDefined(AutoUpdateRequestedTime)) + { + writer.WritePropertyName("autoUpdateRequestedTime"u8); + writer.WriteStringValue(AutoUpdateRequestedTime); + } + 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 + } + } + } + + CacheNodeEntity 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(CacheNodeEntity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCacheNodeEntity(document.RootElement, options); + } + + internal static CacheNodeEntity DeserializeCacheNodeEntity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string fullyQualifiedResourceId = default; + string customerId = default; + string customerName = default; + string ipAddress = default; + string customerIndex = default; + string cacheNodeId = default; + string cacheNodeName = default; + int? customerAsn = default; + bool? isEnabled = default; + int? maxAllowableEgressInMbps = default; + float? maxAllowableProbability = default; + string xCid = default; + bool? isEnterpriseManaged = default; + string createAsyncOperationId = default; + string deleteAsyncOperationId = default; + string clientTenantId = default; + string category = default; + int? releaseVersion = default; + DateTimeOffset? lastSyncWithAzureTimestamp = default; + DateTimeOffset? lastUpdatedTimestamp = default; + int? synchWithAzureAttemptsCount = default; + string containerConfigurations = default; + IList cidrCsv = default; + DateTimeOffset? cidrCsvLastUpdateTime = default; + DateTimeOffset? bgpCidrCsvLastUpdateTime = default; + DateTimeOffset? bgpLastReportedTime = default; + string bgpReviewStateText = default; + BgpReviewStateEnum? bgpReviewState = default; + string bgpReviewFeedback = default; + int? bgpNumberOfTimesUpdated = default; + int? bgpNumberOfRecords = default; + int? bgpCidrBlocksCount = default; + int? bgpAddressSpace = default; + bool? shouldMigrate = default; + int? bgpFileBytesTruncated = default; + int? cidrSelectionType = default; + bool? isFrozen = default; + int? reviewState = default; + string reviewStateText = default; + string reviewFeedback = default; + ConfigurationState? configurationState = default; + string configurationStateText = default; + int? addressSpace = default; + int? workerConnections = default; + DateTimeOffset? workerConnectionsLastUpdatedDateTime = default; + int? containerResyncTrigger = default; + string imageUri = default; + string fullyQualifiedDomainName = default; + AutoUpdateRingType? autoUpdateRingType = default; + int? autoUpdateRequestedWeek = default; + int? autoUpdateRequestedDay = default; + string autoUpdateRequestedTime = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("fullyQualifiedResourceId"u8)) + { + fullyQualifiedResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("customerId"u8)) + { + customerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("customerName"u8)) + { + customerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipAddress"u8)) + { + ipAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("customerIndex"u8)) + { + customerIndex = property.Value.GetString(); + continue; + } + if (property.NameEquals("cacheNodeId"u8)) + { + cacheNodeId = property.Value.GetString(); + continue; + } + if (property.NameEquals("cacheNodeName"u8)) + { + cacheNodeName = property.Value.GetString(); + continue; + } + if (property.NameEquals("customerAsn"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customerAsn = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("isEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("maxAllowableEgressInMbps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxAllowableEgressInMbps = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxAllowableProbability"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxAllowableProbability = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("xCid"u8)) + { + xCid = property.Value.GetString(); + continue; + } + if (property.NameEquals("isEnterpriseManaged"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isEnterpriseManaged = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("createAsyncOperationId"u8)) + { + createAsyncOperationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("deleteAsyncOperationId"u8)) + { + deleteAsyncOperationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("clientTenantId"u8)) + { + clientTenantId = property.Value.GetString(); + continue; + } + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (property.NameEquals("releaseVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + releaseVersion = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("lastSyncWithAzureTimestamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSyncWithAzureTimestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdatedTimestamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastUpdatedTimestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("synchWithAzureAttemptsCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + synchWithAzureAttemptsCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("containerConfigurations"u8)) + { + containerConfigurations = property.Value.GetString(); + continue; + } + if (property.NameEquals("cidrCsv"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + cidrCsv = array; + continue; + } + if (property.NameEquals("cidrCsvLastUpdateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cidrCsvLastUpdateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("bgpCidrCsvLastUpdateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bgpCidrCsvLastUpdateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("bgpLastReportedTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bgpLastReportedTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("bgpReviewStateText"u8)) + { + bgpReviewStateText = property.Value.GetString(); + continue; + } + if (property.NameEquals("bgpReviewState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bgpReviewState = new BgpReviewStateEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("bgpReviewFeedback"u8)) + { + bgpReviewFeedback = property.Value.GetString(); + continue; + } + if (property.NameEquals("bgpNumberOfTimesUpdated"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bgpNumberOfTimesUpdated = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("bgpNumberOfRecords"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bgpNumberOfRecords = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("bgpCidrBlocksCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bgpCidrBlocksCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("bgpAddressSpace"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bgpAddressSpace = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("shouldMigrate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + shouldMigrate = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("bgpFileBytesTruncated"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bgpFileBytesTruncated = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("cidrSelectionType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cidrSelectionType = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("isFrozen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isFrozen = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("reviewState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + reviewState = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("reviewStateText"u8)) + { + reviewStateText = property.Value.GetString(); + continue; + } + if (property.NameEquals("reviewFeedback"u8)) + { + reviewFeedback = property.Value.GetString(); + continue; + } + if (property.NameEquals("configurationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configurationState = new ConfigurationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("configurationStateText"u8)) + { + configurationStateText = property.Value.GetString(); + continue; + } + if (property.NameEquals("addressSpace"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + addressSpace = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("workerConnections"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + workerConnections = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("workerConnectionsLastUpdatedDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + workerConnectionsLastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("containerResyncTrigger"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + containerResyncTrigger = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("imageUri"u8)) + { + imageUri = property.Value.GetString(); + continue; + } + if (property.NameEquals("fullyQualifiedDomainName"u8)) + { + fullyQualifiedDomainName = property.Value.GetString(); + continue; + } + if (property.NameEquals("autoUpdateRingType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoUpdateRingType = new AutoUpdateRingType(property.Value.GetString()); + continue; + } + if (property.NameEquals("autoUpdateRequestedWeek"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoUpdateRequestedWeek = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("autoUpdateRequestedDay"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoUpdateRequestedDay = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("autoUpdateRequestedTime"u8)) + { + autoUpdateRequestedTime = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CacheNodeEntity( + fullyQualifiedResourceId, + customerId, + customerName, + ipAddress, + customerIndex, + cacheNodeId, + cacheNodeName, + customerAsn, + isEnabled, + maxAllowableEgressInMbps, + maxAllowableProbability, + xCid, + isEnterpriseManaged, + createAsyncOperationId, + deleteAsyncOperationId, + clientTenantId, + category, + releaseVersion, + lastSyncWithAzureTimestamp, + lastUpdatedTimestamp, + synchWithAzureAttemptsCount, + containerConfigurations, + cidrCsv ?? new ChangeTrackingList(), + cidrCsvLastUpdateTime, + bgpCidrCsvLastUpdateTime, + bgpLastReportedTime, + bgpReviewStateText, + bgpReviewState, + bgpReviewFeedback, + bgpNumberOfTimesUpdated, + bgpNumberOfRecords, + bgpCidrBlocksCount, + bgpAddressSpace, + shouldMigrate, + bgpFileBytesTruncated, + cidrSelectionType, + isFrozen, + reviewState, + reviewStateText, + reviewFeedback, + configurationState, + configurationStateText, + addressSpace, + workerConnections, + workerConnectionsLastUpdatedDateTime, + containerResyncTrigger, + imageUri, + fullyQualifiedDomainName, + autoUpdateRingType, + autoUpdateRequestedWeek, + autoUpdateRequestedDay, + autoUpdateRequestedTime, + 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(CacheNodeEntity)} does not support writing '{options.Format}' format."); + } + } + + CacheNodeEntity 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 DeserializeCacheNodeEntity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CacheNodeEntity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CacheNodeEntity.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CacheNodeEntity.cs new file mode 100644 index 000000000000..232d2485407e --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CacheNodeEntity.cs @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + /// Model representing Cache Node for ConnectedCache resource. + public partial class CacheNodeEntity + { + /// + /// 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 CacheNodeEntity() + { + CidrCsv = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Cache node resource Azure fully qualified resource Id. + /// Cache node resource customer resource GUID Id. + /// Cache node resource customer resource name. + /// Cache node resource Ip address. + /// Cache node resource customer index as string. + /// Cache node resource identifier of the cache node. + /// Cache node resource name. + /// Cache node resource customer resource Asn (autonomous system number). + /// Cache node resource flag for indicating if cache node is enabled. + /// Cache node resource maximum allowed egress in Mbps. + /// Cache node resource maximum allowed probability of egress. + /// Cache node resource Azure XCid. + /// Cache node resource flag for determining if managed by enterprise as boolean. + /// Cache node resource create async operation Id. + /// Cache node resource deletion async operation Id. + /// Cache node resource customer resource client tenant Id of subscription. + /// Cache node resource category. + /// Cache node resource release version. + /// Cache node resource last sync timestamp. + /// Cache node resource last backend updated timestamp. + /// Cache node resource attempts to sync with Azure. + /// Cache node resource container configuration details. + /// Cache node resource comma separated values of Cidrs. + /// Cache node resource last Cidr Csv update timestamp. + /// Cache node resource last Bgp Cidr Csv update timestamp. + /// Cache node resource last Bgp report timestamp. + /// Cache node resource Bgp review state string text in detail. + /// Cache node resource Bgp review state string text. + /// Cache node resource Bgp review feedback text. + /// Cache node resource Bgp update count. + /// Cache node resource Bgp record count. + /// Cache node resource Bgp block count. + /// Cache node resource total addressable space defined by Bgp and Cidr Csv blocks. + /// Cache node resource flag for determining if customer will be migrated. + /// Cache node resource bytes truncated from Bgp output file. + /// Cache node resource current Cidr range precedence selection type. + /// Cache node resource flag for indicating the cache node resource is frozen (not selectable, not editable in UI). + /// Cache node resource review process state as integer. + /// Cache node resource review state text. + /// Cache node resource review feedback text. + /// Cache node resource configuration state. + /// Cache node resource configuration state text. + /// Cache node resource total addressable space defined by the Cidr Csv block. + /// Cache node resource Mcc container deployment worker connection count. + /// Cache node resource last updated Mcc container deployment worker connection count timestamp. + /// Cache node resource Mcc container configuration details re-sync trigger. + /// Cache node resource Mcc Container Id Uri. + /// FQDN(fully qualified domain name) value of the mcc cache node. + /// Auto Update Ring Type which is slow or fast etc. + /// Customer requested week of month for mcc install of auto update cycle. + /// Customer requested day of week for mcc install of auto update cycle. + /// Customer requested time of the day for mcc install of auto update cycle, should be hh:mm. + /// Keeps track of any properties unknown to the library. + internal CacheNodeEntity(string fullyQualifiedResourceId, string customerId, string customerName, string ipAddress, string customerIndex, string cacheNodeId, string cacheNodeName, int? customerAsn, bool? isEnabled, int? maxAllowableEgressInMbps, float? maxAllowableProbability, string xCid, bool? isEnterpriseManaged, string createAsyncOperationId, string deleteAsyncOperationId, string clientTenantId, string category, int? releaseVersion, DateTimeOffset? lastSyncWithAzureTimestamp, DateTimeOffset? lastUpdatedTimestamp, int? synchWithAzureAttemptsCount, string containerConfigurations, IList cidrCsv, DateTimeOffset? cidrCsvLastUpdateOn, DateTimeOffset? bgpCidrCsvLastUpdateOn, DateTimeOffset? bgpLastReportedOn, string bgpReviewStateText, BgpReviewStateEnum? bgpReviewState, string bgpReviewFeedback, int? bgpNumberOfTimesUpdated, int? bgpNumberOfRecords, int? bgpCidrBlocksCount, int? bgpAddressSpace, bool? shouldMigrate, int? bgpFileBytesTruncated, int? cidrSelectionType, bool? isFrozen, int? reviewState, string reviewStateText, string reviewFeedback, ConfigurationState? configurationState, string configurationStateText, int? addressSpace, int? workerConnections, DateTimeOffset? workerConnectionsLastUpdatedOn, int? containerResyncTrigger, string imageUri, string fullyQualifiedDomainName, AutoUpdateRingType? autoUpdateRingType, int? autoUpdateRequestedWeek, int? autoUpdateRequestedDay, string autoUpdateRequestedTime, IDictionary serializedAdditionalRawData) + { + FullyQualifiedResourceId = fullyQualifiedResourceId; + CustomerId = customerId; + CustomerName = customerName; + IPAddress = ipAddress; + CustomerIndex = customerIndex; + CacheNodeId = cacheNodeId; + CacheNodeName = cacheNodeName; + CustomerAsn = customerAsn; + IsEnabled = isEnabled; + MaxAllowableEgressInMbps = maxAllowableEgressInMbps; + MaxAllowableProbability = maxAllowableProbability; + XCid = xCid; + IsEnterpriseManaged = isEnterpriseManaged; + CreateAsyncOperationId = createAsyncOperationId; + DeleteAsyncOperationId = deleteAsyncOperationId; + ClientTenantId = clientTenantId; + Category = category; + ReleaseVersion = releaseVersion; + LastSyncWithAzureTimestamp = lastSyncWithAzureTimestamp; + LastUpdatedTimestamp = lastUpdatedTimestamp; + SynchWithAzureAttemptsCount = synchWithAzureAttemptsCount; + ContainerConfigurations = containerConfigurations; + CidrCsv = cidrCsv; + CidrCsvLastUpdateOn = cidrCsvLastUpdateOn; + BgpCidrCsvLastUpdateOn = bgpCidrCsvLastUpdateOn; + BgpLastReportedOn = bgpLastReportedOn; + BgpReviewStateText = bgpReviewStateText; + BgpReviewState = bgpReviewState; + BgpReviewFeedback = bgpReviewFeedback; + BgpNumberOfTimesUpdated = bgpNumberOfTimesUpdated; + BgpNumberOfRecords = bgpNumberOfRecords; + BgpCidrBlocksCount = bgpCidrBlocksCount; + BgpAddressSpace = bgpAddressSpace; + ShouldMigrate = shouldMigrate; + BgpFileBytesTruncated = bgpFileBytesTruncated; + CidrSelectionType = cidrSelectionType; + IsFrozen = isFrozen; + ReviewState = reviewState; + ReviewStateText = reviewStateText; + ReviewFeedback = reviewFeedback; + ConfigurationState = configurationState; + ConfigurationStateText = configurationStateText; + AddressSpace = addressSpace; + WorkerConnections = workerConnections; + WorkerConnectionsLastUpdatedOn = workerConnectionsLastUpdatedOn; + ContainerResyncTrigger = containerResyncTrigger; + ImageUri = imageUri; + FullyQualifiedDomainName = fullyQualifiedDomainName; + AutoUpdateRingType = autoUpdateRingType; + AutoUpdateRequestedWeek = autoUpdateRequestedWeek; + AutoUpdateRequestedDay = autoUpdateRequestedDay; + AutoUpdateRequestedTime = autoUpdateRequestedTime; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Cache node resource Azure fully qualified resource Id. + public string FullyQualifiedResourceId { get; set; } + /// Cache node resource customer resource GUID Id. + public string CustomerId { get; } + /// Cache node resource customer resource name. + public string CustomerName { get; set; } + /// Cache node resource Ip address. + public string IPAddress { get; set; } + /// Cache node resource customer index as string. + public string CustomerIndex { get; set; } + /// Cache node resource identifier of the cache node. + public string CacheNodeId { get; set; } + /// Cache node resource name. + public string CacheNodeName { get; set; } + /// Cache node resource customer resource Asn (autonomous system number). + public int? CustomerAsn { get; set; } + /// Cache node resource flag for indicating if cache node is enabled. + public bool? IsEnabled { get; set; } + /// Cache node resource maximum allowed egress in Mbps. + public int? MaxAllowableEgressInMbps { get; set; } + /// Cache node resource maximum allowed probability of egress. + public float? MaxAllowableProbability { get; } + /// Cache node resource Azure XCid. + public string XCid { get; } + /// Cache node resource flag for determining if managed by enterprise as boolean. + public bool? IsEnterpriseManaged { get; set; } + /// Cache node resource create async operation Id. + public string CreateAsyncOperationId { get; } + /// Cache node resource deletion async operation Id. + public string DeleteAsyncOperationId { get; } + /// Cache node resource customer resource client tenant Id of subscription. + public string ClientTenantId { get; } + /// Cache node resource category. + public string Category { get; } + /// Cache node resource release version. + public int? ReleaseVersion { get; } + /// Cache node resource last sync timestamp. + public DateTimeOffset? LastSyncWithAzureTimestamp { get; } + /// Cache node resource last backend updated timestamp. + public DateTimeOffset? LastUpdatedTimestamp { get; } + /// Cache node resource attempts to sync with Azure. + public int? SynchWithAzureAttemptsCount { get; } + /// Cache node resource container configuration details. + public string ContainerConfigurations { get; } + /// Cache node resource comma separated values of Cidrs. + public IList CidrCsv { get; } + /// Cache node resource last Cidr Csv update timestamp. + public DateTimeOffset? CidrCsvLastUpdateOn { get; } + /// Cache node resource last Bgp Cidr Csv update timestamp. + public DateTimeOffset? BgpCidrCsvLastUpdateOn { get; } + /// Cache node resource last Bgp report timestamp. + public DateTimeOffset? BgpLastReportedOn { get; } + /// Cache node resource Bgp review state string text in detail. + public string BgpReviewStateText { get; } + /// Cache node resource Bgp review state string text. + public BgpReviewStateEnum? BgpReviewState { get; } + /// Cache node resource Bgp review feedback text. + public string BgpReviewFeedback { get; } + /// Cache node resource Bgp update count. + public int? BgpNumberOfTimesUpdated { get; } + /// Cache node resource Bgp record count. + public int? BgpNumberOfRecords { get; } + /// Cache node resource Bgp block count. + public int? BgpCidrBlocksCount { get; } + /// Cache node resource total addressable space defined by Bgp and Cidr Csv blocks. + public int? BgpAddressSpace { get; } + /// Cache node resource flag for determining if customer will be migrated. + public bool? ShouldMigrate { get; set; } + /// Cache node resource bytes truncated from Bgp output file. + public int? BgpFileBytesTruncated { get; } + /// Cache node resource current Cidr range precedence selection type. + public int? CidrSelectionType { get; set; } + /// Cache node resource flag for indicating the cache node resource is frozen (not selectable, not editable in UI). + public bool? IsFrozen { get; } + /// Cache node resource review process state as integer. + public int? ReviewState { get; } + /// Cache node resource review state text. + public string ReviewStateText { get; } + /// Cache node resource review feedback text. + public string ReviewFeedback { get; } + /// Cache node resource configuration state. + public ConfigurationState? ConfigurationState { get; } + /// Cache node resource configuration state text. + public string ConfigurationStateText { get; } + /// Cache node resource total addressable space defined by the Cidr Csv block. + public int? AddressSpace { get; } + /// Cache node resource Mcc container deployment worker connection count. + public int? WorkerConnections { get; } + /// Cache node resource last updated Mcc container deployment worker connection count timestamp. + public DateTimeOffset? WorkerConnectionsLastUpdatedOn { get; } + /// Cache node resource Mcc container configuration details re-sync trigger. + public int? ContainerResyncTrigger { get; } + /// Cache node resource Mcc Container Id Uri. + public string ImageUri { get; } + /// FQDN(fully qualified domain name) value of the mcc cache node. + public string FullyQualifiedDomainName { get; set; } + /// Auto Update Ring Type which is slow or fast etc. + public AutoUpdateRingType? AutoUpdateRingType { get; set; } + /// Customer requested week of month for mcc install of auto update cycle. + public int? AutoUpdateRequestedWeek { get; set; } + /// Customer requested day of week for mcc install of auto update cycle. + public int? AutoUpdateRequestedDay { get; set; } + /// Customer requested time of the day for mcc install of auto update cycle, should be hh:mm. + public string AutoUpdateRequestedTime { get; set; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CacheNodeInstallProperties.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CacheNodeInstallProperties.Serialization.cs new file mode 100644 index 000000000000..2ff976c5e6df --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CacheNodeInstallProperties.Serialization.cs @@ -0,0 +1,233 @@ +// 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.ConnectedCache.Models +{ + public partial class CacheNodeInstallProperties : 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(CacheNodeInstallProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(CustomerId)) + { + writer.WritePropertyName("customerId"u8); + writer.WriteStringValue(CustomerId); + } + if (Optional.IsDefined(CacheNodeId)) + { + writer.WritePropertyName("cacheNodeId"u8); + writer.WriteStringValue(CacheNodeId); + } + if (options.Format != "W" && Optional.IsDefined(PrimaryAccountKey)) + { + writer.WritePropertyName("primaryAccountKey"u8); + writer.WriteStringValue(PrimaryAccountKey); + } + if (options.Format != "W" && Optional.IsDefined(SecondaryAccountKey)) + { + writer.WritePropertyName("secondaryAccountKey"u8); + writer.WriteStringValue(SecondaryAccountKey); + } + if (options.Format != "W" && Optional.IsDefined(RegistrationKey)) + { + writer.WritePropertyName("registrationKey"u8); + writer.WriteStringValue(RegistrationKey); + } + if (options.Format != "W" && Optional.IsDefined(TlsCertificateProvisioningKey)) + { + writer.WritePropertyName("tlsCertificateProvisioningKey"u8); + writer.WriteStringValue(TlsCertificateProvisioningKey); + } + if (Optional.IsCollectionDefined(DriveConfiguration)) + { + writer.WritePropertyName("driveConfiguration"u8); + writer.WriteStartArray(); + foreach (var item in DriveConfiguration) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ProxyUrlConfiguration)) + { + writer.WritePropertyName("proxyUrlConfiguration"u8); + writer.WriteObjectValue(ProxyUrlConfiguration, 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 + } + } + } + + CacheNodeInstallProperties 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(CacheNodeInstallProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCacheNodeInstallProperties(document.RootElement, options); + } + + internal static CacheNodeInstallProperties DeserializeCacheNodeInstallProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string customerId = default; + string cacheNodeId = default; + string primaryAccountKey = default; + string secondaryAccountKey = default; + string registrationKey = default; + string tlsCertificateProvisioningKey = default; + IReadOnlyList driveConfiguration = default; + ProxyUrlConfiguration proxyUrlConfiguration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customerId"u8)) + { + customerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("cacheNodeId"u8)) + { + cacheNodeId = property.Value.GetString(); + continue; + } + if (property.NameEquals("primaryAccountKey"u8)) + { + primaryAccountKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("secondaryAccountKey"u8)) + { + secondaryAccountKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("registrationKey"u8)) + { + registrationKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("tlsCertificateProvisioningKey"u8)) + { + tlsCertificateProvisioningKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("driveConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CacheNodeDriveConfiguration.DeserializeCacheNodeDriveConfiguration(item, options)); + } + driveConfiguration = array; + continue; + } + if (property.NameEquals("proxyUrlConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + proxyUrlConfiguration = ProxyUrlConfiguration.DeserializeProxyUrlConfiguration(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CacheNodeInstallProperties( + customerId, + cacheNodeId, + primaryAccountKey, + secondaryAccountKey, + registrationKey, + tlsCertificateProvisioningKey, + driveConfiguration ?? new ChangeTrackingList(), + proxyUrlConfiguration, + 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(CacheNodeInstallProperties)} does not support writing '{options.Format}' format."); + } + } + + CacheNodeInstallProperties 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 DeserializeCacheNodeInstallProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CacheNodeInstallProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CacheNodeInstallProperties.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CacheNodeInstallProperties.cs new file mode 100644 index 000000000000..f28ddfb3c881 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CacheNodeInstallProperties.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + /// Mcc cache node resource install script properties. + public partial class CacheNodeInstallProperties + { + /// + /// 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 CacheNodeInstallProperties() + { + DriveConfiguration = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Mcc customer resource Id. + /// Mcc cache node resource Id. + /// Mcc primary account key. Internal to Mcc. + /// Mcc secondary account key. Internal to Mcc. + /// Mcc Iot Central temporary device registration key, used once. + /// Mcc Tls certificate provisioning key. + /// Cache node resource drive configurations. + /// proxyUrl configuration of the cache node. + /// Keeps track of any properties unknown to the library. + internal CacheNodeInstallProperties(string customerId, string cacheNodeId, string primaryAccountKey, string secondaryAccountKey, string registrationKey, string tlsCertificateProvisioningKey, IReadOnlyList driveConfiguration, ProxyUrlConfiguration proxyUrlConfiguration, IDictionary serializedAdditionalRawData) + { + CustomerId = customerId; + CacheNodeId = cacheNodeId; + PrimaryAccountKey = primaryAccountKey; + SecondaryAccountKey = secondaryAccountKey; + RegistrationKey = registrationKey; + TlsCertificateProvisioningKey = tlsCertificateProvisioningKey; + DriveConfiguration = driveConfiguration; + ProxyUrlConfiguration = proxyUrlConfiguration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Mcc customer resource Id. + public string CustomerId { get; } + /// Mcc cache node resource Id. + public string CacheNodeId { get; } + /// Mcc primary account key. Internal to Mcc. + public string PrimaryAccountKey { get; } + /// Mcc secondary account key. Internal to Mcc. + public string SecondaryAccountKey { get; } + /// Mcc Iot Central temporary device registration key, used once. + public string RegistrationKey { get; } + /// Mcc Tls certificate provisioning key. + public string TlsCertificateProvisioningKey { get; } + /// Cache node resource drive configurations. + public IReadOnlyList DriveConfiguration { get; } + /// proxyUrl configuration of the cache node. + internal ProxyUrlConfiguration ProxyUrlConfiguration { get; } + /// Host Proxy Address configuration along with port number. This can be a proxy or ip address. ex: xx.xx.xx.xxxx:80 or host name http://exampleproxy.com:80. + public string ProxyUri + { + get => ProxyUrlConfiguration?.ProxyUri; + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CacheNodeProperty.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CacheNodeProperty.Serialization.cs new file mode 100644 index 000000000000..bfb4b456fdc8 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CacheNodeProperty.Serialization.cs @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + public partial class CacheNodeProperty : 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(CacheNodeProperty)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(CacheNode)) + { + writer.WritePropertyName("cacheNode"u8); + writer.WriteObjectValue(CacheNode, options); + } + if (Optional.IsDefined(AdditionalCacheNodeProperties)) + { + writer.WritePropertyName("additionalCacheNodeProperties"u8); + writer.WriteObjectValue(AdditionalCacheNodeProperties, options); + } + if (Optional.IsDefined(StatusCode)) + { + writer.WritePropertyName("statusCode"u8); + writer.WriteStringValue(StatusCode); + } + if (Optional.IsDefined(StatusText)) + { + writer.WritePropertyName("statusText"u8); + writer.WriteStringValue(StatusText); + } + if (Optional.IsDefined(StatusDetails)) + { + writer.WritePropertyName("statusDetails"u8); + writer.WriteStringValue(StatusDetails); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + JsonSerializer.Serialize(writer, Error); + } + 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 + } + } + } + + CacheNodeProperty 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(CacheNodeProperty)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCacheNodeProperty(document.RootElement, options); + } + + internal static CacheNodeProperty DeserializeCacheNodeProperty(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProvisioningState? provisioningState = default; + CacheNodeEntity cacheNode = default; + AdditionalCacheNodeProperties additionalCacheNodeProperties = default; + string statusCode = default; + string statusText = default; + string statusDetails = default; + string status = default; + ResponseError error = 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("cacheNode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cacheNode = CacheNodeEntity.DeserializeCacheNodeEntity(property.Value, options); + continue; + } + if (property.NameEquals("additionalCacheNodeProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + additionalCacheNodeProperties = AdditionalCacheNodeProperties.DeserializeAdditionalCacheNodeProperties(property.Value, options); + continue; + } + if (property.NameEquals("statusCode"u8)) + { + statusCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("statusText"u8)) + { + statusText = property.Value.GetString(); + continue; + } + if (property.NameEquals("statusDetails"u8)) + { + statusDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + status = property.Value.GetString(); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CacheNodeProperty( + provisioningState, + cacheNode, + additionalCacheNodeProperties, + statusCode, + statusText, + statusDetails, + status, + error, + 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(CacheNodeProperty)} does not support writing '{options.Format}' format."); + } + } + + CacheNodeProperty 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 DeserializeCacheNodeProperty(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CacheNodeProperty)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CacheNodeProperty.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CacheNodeProperty.cs new file mode 100644 index 000000000000..e12d26911bbf --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CacheNodeProperty.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + /// Model representing an Mcc cache node connectedCache resource. + public partial class CacheNodeProperty + { + /// + /// 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 CacheNodeProperty() + { + } + + /// Initializes a new instance of . + /// The provisioned state of the resource. + /// Mcc cache node resource (cache node entity). + /// Mcc cache node resource additional properties. + /// Mcc response status code. + /// Mcc response status text as string for retrieving status details. + /// Mcc response status details for retrieving response inner details. + /// HTTP error status code. + /// Mcc response error details. + /// Keeps track of any properties unknown to the library. + internal CacheNodeProperty(ProvisioningState? provisioningState, CacheNodeEntity cacheNode, AdditionalCacheNodeProperties additionalCacheNodeProperties, string statusCode, string statusText, string statusDetails, string status, ResponseError error, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + CacheNode = cacheNode; + AdditionalCacheNodeProperties = additionalCacheNodeProperties; + StatusCode = statusCode; + StatusText = statusText; + StatusDetails = statusDetails; + Status = status; + Error = error; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The provisioned state of the resource. + public ProvisioningState? ProvisioningState { get; } + /// Mcc cache node resource (cache node entity). + public CacheNodeEntity CacheNode { get; set; } + /// Mcc cache node resource additional properties. + public AdditionalCacheNodeProperties AdditionalCacheNodeProperties { get; set; } + /// Mcc response status code. + public string StatusCode { get; set; } + /// Mcc response status text as string for retrieving status details. + public string StatusText { get; set; } + /// Mcc response status details for retrieving response inner details. + public string StatusDetails { get; set; } + /// HTTP error status code. + public string Status { get; } + /// Mcc response error details. + public ResponseError Error { get; set; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/ConfigurationState.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/ConfigurationState.cs new file mode 100644 index 000000000000..f043c9b76075 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/ConfigurationState.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + /// Cache node configuration setup state. + public readonly partial struct ConfigurationState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ConfigurationState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ConfiguredValue = "Configured"; + private const string NotConfiguredIPValue = "NotConfigured_Ip"; + + /// connected cache setup configured. + public static ConfigurationState Configured { get; } = new ConfigurationState(ConfiguredValue); + /// connected cache setup not configured. + public static ConfigurationState NotConfiguredIP { get; } = new ConfigurationState(NotConfiguredIPValue); + /// Determines if two values are the same. + public static bool operator ==(ConfigurationState left, ConfigurationState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ConfigurationState left, ConfigurationState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ConfigurationState(string value) => new ConfigurationState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ConfigurationState other && Equals(other); + /// + public bool Equals(ConfigurationState 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/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/ConnectedCachePatchContent.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/ConnectedCachePatchContent.Serialization.cs new file mode 100644 index 000000000000..48b8913a2b5e --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/ConnectedCachePatchContent.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + public partial class ConnectedCachePatchContent : 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(ConnectedCachePatchContent)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + 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 + } + } + } + + ConnectedCachePatchContent 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(ConnectedCachePatchContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedCachePatchContent(document.RootElement, options); + } + + internal static ConnectedCachePatchContent DeserializeConnectedCachePatchContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedCachePatchContent(tags ?? new ChangeTrackingDictionary(), 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(ConnectedCachePatchContent)} does not support writing '{options.Format}' format."); + } + } + + ConnectedCachePatchContent 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 DeserializeConnectedCachePatchContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedCachePatchContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/ConnectedCachePatchContent.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/ConnectedCachePatchContent.cs new file mode 100644 index 000000000000..4cc7dcaee6f0 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/ConnectedCachePatchContent.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + /// Mcc PATCH operation properties. + public partial class ConnectedCachePatchContent + { + /// + /// 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 ConnectedCachePatchContent() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// Keeps track of any properties unknown to the library. + internal ConnectedCachePatchContent(IDictionary tags, IDictionary serializedAdditionalRawData) + { + Tags = tags; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CustomerEntity.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CustomerEntity.Serialization.cs new file mode 100644 index 000000000000..318541e79ede --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CustomerEntity.Serialization.cs @@ -0,0 +1,367 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + public partial class CustomerEntity : 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(CustomerEntity)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(FullyQualifiedResourceId)) + { + writer.WritePropertyName("fullyQualifiedResourceId"u8); + writer.WriteStringValue(FullyQualifiedResourceId); + } + if (options.Format != "W" && Optional.IsDefined(CustomerId)) + { + writer.WritePropertyName("customerId"u8); + writer.WriteStringValue(CustomerId); + } + if (Optional.IsDefined(CustomerName)) + { + writer.WritePropertyName("customerName"u8); + writer.WriteStringValue(CustomerName); + } + if (Optional.IsDefined(ContactEmail)) + { + writer.WritePropertyName("contactEmail"u8); + writer.WriteStringValue(ContactEmail); + } + if (Optional.IsDefined(ContactPhone)) + { + writer.WritePropertyName("contactPhone"u8); + writer.WriteStringValue(ContactPhone); + } + if (Optional.IsDefined(ContactName)) + { + writer.WritePropertyName("contactName"u8); + writer.WriteStringValue(ContactName); + } + if (Optional.IsDefined(IsEntitled)) + { + writer.WritePropertyName("isEntitled"u8); + writer.WriteBooleanValue(IsEntitled.Value); + } + if (Optional.IsDefined(ReleaseVersion)) + { + writer.WritePropertyName("releaseVersion"u8); + writer.WriteNumberValue(ReleaseVersion.Value); + } + if (options.Format != "W" && Optional.IsDefined(CreateAsyncOperationId)) + { + writer.WritePropertyName("createAsyncOperationId"u8); + writer.WriteStringValue(CreateAsyncOperationId); + } + if (options.Format != "W" && Optional.IsDefined(DeleteAsyncOperationId)) + { + writer.WritePropertyName("deleteAsyncOperationId"u8); + writer.WriteStringValue(DeleteAsyncOperationId); + } + if (Optional.IsDefined(ClientTenantId)) + { + writer.WritePropertyName("clientTenantId"u8); + writer.WriteStringValue(ClientTenantId); + } + if (options.Format != "W" && Optional.IsDefined(SynchWithAzureAttemptsCount)) + { + writer.WritePropertyName("synchWithAzureAttemptsCount"u8); + writer.WriteNumberValue(SynchWithAzureAttemptsCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(LastSyncWithAzureTimestamp)) + { + writer.WritePropertyName("lastSyncWithAzureTimestamp"u8); + writer.WriteStringValue(LastSyncWithAzureTimestamp.Value, "O"); + } + if (Optional.IsDefined(IsEnterpriseManaged)) + { + writer.WritePropertyName("isEnterpriseManaged"u8); + writer.WriteBooleanValue(IsEnterpriseManaged.Value); + } + if (Optional.IsDefined(ShouldMigrate)) + { + writer.WritePropertyName("shouldMigrate"u8); + writer.WriteBooleanValue(ShouldMigrate.Value); + } + if (Optional.IsDefined(ResendSignupCode)) + { + writer.WritePropertyName("resendSignupCode"u8); + writer.WriteBooleanValue(ResendSignupCode.Value); + } + if (Optional.IsDefined(VerifySignupCode)) + { + writer.WritePropertyName("verifySignupCode"u8); + writer.WriteBooleanValue(VerifySignupCode.Value); + } + if (Optional.IsDefined(VerifySignupPhrase)) + { + writer.WritePropertyName("verifySignupPhrase"u8); + writer.WriteStringValue(VerifySignupPhrase); + } + 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 + } + } + } + + CustomerEntity 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(CustomerEntity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomerEntity(document.RootElement, options); + } + + internal static CustomerEntity DeserializeCustomerEntity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string fullyQualifiedResourceId = default; + string customerId = default; + string customerName = default; + string contactEmail = default; + string contactPhone = default; + string contactName = default; + bool? isEntitled = default; + int? releaseVersion = default; + string createAsyncOperationId = default; + string deleteAsyncOperationId = default; + string clientTenantId = default; + int? synchWithAzureAttemptsCount = default; + DateTimeOffset? lastSyncWithAzureTimestamp = default; + bool? isEnterpriseManaged = default; + bool? shouldMigrate = default; + bool? resendSignupCode = default; + bool? verifySignupCode = default; + string verifySignupPhrase = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("fullyQualifiedResourceId"u8)) + { + fullyQualifiedResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("customerId"u8)) + { + customerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("customerName"u8)) + { + customerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("contactEmail"u8)) + { + contactEmail = property.Value.GetString(); + continue; + } + if (property.NameEquals("contactPhone"u8)) + { + contactPhone = property.Value.GetString(); + continue; + } + if (property.NameEquals("contactName"u8)) + { + contactName = property.Value.GetString(); + continue; + } + if (property.NameEquals("isEntitled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isEntitled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("releaseVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + releaseVersion = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("createAsyncOperationId"u8)) + { + createAsyncOperationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("deleteAsyncOperationId"u8)) + { + deleteAsyncOperationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("clientTenantId"u8)) + { + clientTenantId = property.Value.GetString(); + continue; + } + if (property.NameEquals("synchWithAzureAttemptsCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + synchWithAzureAttemptsCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("lastSyncWithAzureTimestamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSyncWithAzureTimestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("isEnterpriseManaged"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isEnterpriseManaged = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("shouldMigrate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + shouldMigrate = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("resendSignupCode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resendSignupCode = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("verifySignupCode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + verifySignupCode = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("verifySignupPhrase"u8)) + { + verifySignupPhrase = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomerEntity( + fullyQualifiedResourceId, + customerId, + customerName, + contactEmail, + contactPhone, + contactName, + isEntitled, + releaseVersion, + createAsyncOperationId, + deleteAsyncOperationId, + clientTenantId, + synchWithAzureAttemptsCount, + lastSyncWithAzureTimestamp, + isEnterpriseManaged, + shouldMigrate, + resendSignupCode, + verifySignupCode, + verifySignupPhrase, + 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(CustomerEntity)} does not support writing '{options.Format}' format."); + } + } + + CustomerEntity 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 DeserializeCustomerEntity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomerEntity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CustomerEntity.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CustomerEntity.cs new file mode 100644 index 000000000000..e7887cc10b2e --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CustomerEntity.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + /// Model representing Customer resource for ConnectedCache resource. + public partial class CustomerEntity + { + /// + /// 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 CustomerEntity() + { + } + + /// Initializes a new instance of . + /// Customer resource Azure fully qualified resource Id. + /// Customer resource Guid Id. + /// Customer resource name. + /// Customer resource contact email. + /// Customer resource contact phone. + /// Customer resource contact full name. + /// Customer resource entitlement flag as boolean. + /// Customer resource Mcc release version. + /// Customer resource create async operation Id. + /// Customer resource deletion async operation Id. + /// Customer resource client tenant Id of subscription. + /// Customer resource sync attempts. + /// Customer resource last Azure sync timestamp. + /// Customer resource flag for enterprise management as boolean. + /// Customer resource flag for migration. + /// Customer resource flag for resending signup code as boolean. + /// Customer resource flag for requiring verification of signup code as boolean. + /// Customer resource phrase for verifying signup. + /// Keeps track of any properties unknown to the library. + internal CustomerEntity(string fullyQualifiedResourceId, string customerId, string customerName, string contactEmail, string contactPhone, string contactName, bool? isEntitled, int? releaseVersion, string createAsyncOperationId, string deleteAsyncOperationId, string clientTenantId, int? synchWithAzureAttemptsCount, DateTimeOffset? lastSyncWithAzureTimestamp, bool? isEnterpriseManaged, bool? shouldMigrate, bool? resendSignupCode, bool? verifySignupCode, string verifySignupPhrase, IDictionary serializedAdditionalRawData) + { + FullyQualifiedResourceId = fullyQualifiedResourceId; + CustomerId = customerId; + CustomerName = customerName; + ContactEmail = contactEmail; + ContactPhone = contactPhone; + ContactName = contactName; + IsEntitled = isEntitled; + ReleaseVersion = releaseVersion; + CreateAsyncOperationId = createAsyncOperationId; + DeleteAsyncOperationId = deleteAsyncOperationId; + ClientTenantId = clientTenantId; + SynchWithAzureAttemptsCount = synchWithAzureAttemptsCount; + LastSyncWithAzureTimestamp = lastSyncWithAzureTimestamp; + IsEnterpriseManaged = isEnterpriseManaged; + ShouldMigrate = shouldMigrate; + ResendSignupCode = resendSignupCode; + VerifySignupCode = verifySignupCode; + VerifySignupPhrase = verifySignupPhrase; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Customer resource Azure fully qualified resource Id. + public string FullyQualifiedResourceId { get; set; } + /// Customer resource Guid Id. + public string CustomerId { get; } + /// Customer resource name. + public string CustomerName { get; set; } + /// Customer resource contact email. + public string ContactEmail { get; set; } + /// Customer resource contact phone. + public string ContactPhone { get; set; } + /// Customer resource contact full name. + public string ContactName { get; set; } + /// Customer resource entitlement flag as boolean. + public bool? IsEntitled { get; set; } + /// Customer resource Mcc release version. + public int? ReleaseVersion { get; set; } + /// Customer resource create async operation Id. + public string CreateAsyncOperationId { get; } + /// Customer resource deletion async operation Id. + public string DeleteAsyncOperationId { get; } + /// Customer resource client tenant Id of subscription. + public string ClientTenantId { get; set; } + /// Customer resource sync attempts. + public int? SynchWithAzureAttemptsCount { get; } + /// Customer resource last Azure sync timestamp. + public DateTimeOffset? LastSyncWithAzureTimestamp { get; } + /// Customer resource flag for enterprise management as boolean. + public bool? IsEnterpriseManaged { get; set; } + /// Customer resource flag for migration. + public bool? ShouldMigrate { get; set; } + /// Customer resource flag for resending signup code as boolean. + public bool? ResendSignupCode { get; set; } + /// Customer resource flag for requiring verification of signup code as boolean. + public bool? VerifySignupCode { get; set; } + /// Customer resource phrase for verifying signup. + public string VerifySignupPhrase { get; set; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CustomerProperty.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CustomerProperty.Serialization.cs new file mode 100644 index 000000000000..87fb5b810290 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CustomerProperty.Serialization.cs @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + public partial class CustomerProperty : 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(CustomerProperty)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(Customer)) + { + writer.WritePropertyName("customer"u8); + writer.WriteObjectValue(Customer, options); + } + if (Optional.IsDefined(AdditionalCustomerProperties)) + { + writer.WritePropertyName("additionalCustomerProperties"u8); + writer.WriteObjectValue(AdditionalCustomerProperties, options); + } + if (options.Format != "W" && Optional.IsDefined(StatusCode)) + { + writer.WritePropertyName("statusCode"u8); + writer.WriteStringValue(StatusCode); + } + if (options.Format != "W" && Optional.IsDefined(StatusText)) + { + writer.WritePropertyName("statusText"u8); + writer.WriteStringValue(StatusText); + } + if (options.Format != "W" && Optional.IsDefined(StatusDetails)) + { + writer.WritePropertyName("statusDetails"u8); + writer.WriteStringValue(StatusDetails); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status); + } + if (options.Format != "W" && Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + JsonSerializer.Serialize(writer, Error); + } + 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 + } + } + } + + CustomerProperty 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(CustomerProperty)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomerProperty(document.RootElement, options); + } + + internal static CustomerProperty DeserializeCustomerProperty(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProvisioningState? provisioningState = default; + CustomerEntity customer = default; + AdditionalCustomerProperties additionalCustomerProperties = default; + string statusCode = default; + string statusText = default; + string statusDetails = default; + string status = default; + ResponseError error = 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("customer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customer = CustomerEntity.DeserializeCustomerEntity(property.Value, options); + continue; + } + if (property.NameEquals("additionalCustomerProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + additionalCustomerProperties = AdditionalCustomerProperties.DeserializeAdditionalCustomerProperties(property.Value, options); + continue; + } + if (property.NameEquals("statusCode"u8)) + { + statusCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("statusText"u8)) + { + statusText = property.Value.GetString(); + continue; + } + if (property.NameEquals("statusDetails"u8)) + { + statusDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + status = property.Value.GetString(); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomerProperty( + provisioningState, + customer, + additionalCustomerProperties, + statusCode, + statusText, + statusDetails, + status, + error, + 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(CustomerProperty)} does not support writing '{options.Format}' format."); + } + } + + CustomerProperty 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 DeserializeCustomerProperty(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomerProperty)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CustomerProperty.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CustomerProperty.cs new file mode 100644 index 000000000000..e19ded09eded --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CustomerProperty.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + /// Model representing customer for connectedCache resource. + public partial class CustomerProperty + { + /// + /// 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 CustomerProperty() + { + } + + /// Initializes a new instance of . + /// The provisioned state of the resource. + /// Mcc customer resource (customer entity). + /// Mcc customer resource additional properties. + /// Mcc response status code. + /// Mcc response status text as string for retrieving status details. + /// Mcc response status details for retrieving response inner details. + /// HTTP error status code. + /// Mcc response error details. + /// Keeps track of any properties unknown to the library. + internal CustomerProperty(ProvisioningState? provisioningState, CustomerEntity customer, AdditionalCustomerProperties additionalCustomerProperties, string statusCode, string statusText, string statusDetails, string status, ResponseError error, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + Customer = customer; + AdditionalCustomerProperties = additionalCustomerProperties; + StatusCode = statusCode; + StatusText = statusText; + StatusDetails = statusDetails; + Status = status; + Error = error; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The provisioned state of the resource. + public ProvisioningState? ProvisioningState { get; } + /// Mcc customer resource (customer entity). + public CustomerEntity Customer { get; set; } + /// Mcc customer resource additional properties. + public AdditionalCustomerProperties AdditionalCustomerProperties { get; set; } + /// Mcc response status code. + public string StatusCode { get; } + /// Mcc response status text as string for retrieving status details. + public string StatusText { get; } + /// Mcc response status details for retrieving response inner details. + public string StatusDetails { get; } + /// HTTP error status code. + public string Status { get; } + /// Mcc response error details. + public ResponseError Error { get; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CustomerTransitState.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CustomerTransitState.cs new file mode 100644 index 000000000000..e61b5e356180 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/CustomerTransitState.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.ConnectedCache.Models +{ + /// Customer resource transit states. + public readonly partial struct CustomerTransitState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CustomerTransitState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoTransitValue = "NoTransit"; + private const string CombinedTransitValue = "CombinedTransit"; + private const string TransitOnlyValue = "TransitOnly"; + + /// do not have transit. + public static CustomerTransitState NoTransit { get; } = new CustomerTransitState(NoTransitValue); + /// transit provider and have own subscribers. + public static CustomerTransitState CombinedTransit { get; } = new CustomerTransitState(CombinedTransitValue); + /// pure transit provider or network service provider. + public static CustomerTransitState TransitOnly { get; } = new CustomerTransitState(TransitOnlyValue); + /// Determines if two values are the same. + public static bool operator ==(CustomerTransitState left, CustomerTransitState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CustomerTransitState left, CustomerTransitState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CustomerTransitState(string value) => new CustomerTransitState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CustomerTransitState other && Equals(other); + /// + public bool Equals(CustomerTransitState 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/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/EnterpriseMccCacheNodeResourceListResult.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/EnterpriseMccCacheNodeResourceListResult.Serialization.cs new file mode 100644 index 000000000000..6baf3911d078 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/EnterpriseMccCacheNodeResourceListResult.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.ConnectedCache.Models +{ + internal partial class EnterpriseMccCacheNodeResourceListResult : 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(EnterpriseMccCacheNodeResourceListResult)} 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 + } + } + } + + EnterpriseMccCacheNodeResourceListResult 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(EnterpriseMccCacheNodeResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEnterpriseMccCacheNodeResourceListResult(document.RootElement, options); + } + + internal static EnterpriseMccCacheNodeResourceListResult DeserializeEnterpriseMccCacheNodeResourceListResult(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(EnterpriseMccCacheNodeResourceData.DeserializeEnterpriseMccCacheNodeResourceData(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 EnterpriseMccCacheNodeResourceListResult(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(EnterpriseMccCacheNodeResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + EnterpriseMccCacheNodeResourceListResult 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 DeserializeEnterpriseMccCacheNodeResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EnterpriseMccCacheNodeResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/EnterpriseMccCacheNodeResourceListResult.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/EnterpriseMccCacheNodeResourceListResult.cs new file mode 100644 index 000000000000..cb773265b654 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/EnterpriseMccCacheNodeResourceListResult.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.ConnectedCache.Models +{ + /// The response of a EnterpriseMccCacheNodeResource list operation. + internal partial class EnterpriseMccCacheNodeResourceListResult + { + /// + /// 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 EnterpriseMccCacheNodeResource items on this page. + /// is null. + internal EnterpriseMccCacheNodeResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The EnterpriseMccCacheNodeResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal EnterpriseMccCacheNodeResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EnterpriseMccCacheNodeResourceListResult() + { + } + + /// The EnterpriseMccCacheNodeResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/EnterpriseMccCustomerResourceListResult.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/EnterpriseMccCustomerResourceListResult.Serialization.cs new file mode 100644 index 000000000000..55f4b489ee8d --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/EnterpriseMccCustomerResourceListResult.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.ConnectedCache.Models +{ + internal partial class EnterpriseMccCustomerResourceListResult : 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(EnterpriseMccCustomerResourceListResult)} 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 + } + } + } + + EnterpriseMccCustomerResourceListResult 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(EnterpriseMccCustomerResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEnterpriseMccCustomerResourceListResult(document.RootElement, options); + } + + internal static EnterpriseMccCustomerResourceListResult DeserializeEnterpriseMccCustomerResourceListResult(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(EnterpriseMccCustomerResourceData.DeserializeEnterpriseMccCustomerResourceData(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 EnterpriseMccCustomerResourceListResult(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(EnterpriseMccCustomerResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + EnterpriseMccCustomerResourceListResult 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 DeserializeEnterpriseMccCustomerResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EnterpriseMccCustomerResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/EnterpriseMccCustomerResourceListResult.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/EnterpriseMccCustomerResourceListResult.cs new file mode 100644 index 000000000000..907a96c7bf46 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/EnterpriseMccCustomerResourceListResult.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.ConnectedCache.Models +{ + /// The response of a EnterpriseMccCustomerResource list operation. + internal partial class EnterpriseMccCustomerResourceListResult + { + /// + /// 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 EnterpriseMccCustomerResource items on this page. + /// is null. + internal EnterpriseMccCustomerResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The EnterpriseMccCustomerResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal EnterpriseMccCustomerResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EnterpriseMccCustomerResourceListResult() + { + } + + /// The EnterpriseMccCustomerResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/IspCacheNodeResourceListResult.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/IspCacheNodeResourceListResult.Serialization.cs new file mode 100644 index 000000000000..382d2fd49b49 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/IspCacheNodeResourceListResult.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.ConnectedCache.Models +{ + internal partial class IspCacheNodeResourceListResult : 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(IspCacheNodeResourceListResult)} 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 + } + } + } + + IspCacheNodeResourceListResult 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(IspCacheNodeResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIspCacheNodeResourceListResult(document.RootElement, options); + } + + internal static IspCacheNodeResourceListResult DeserializeIspCacheNodeResourceListResult(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(IspCacheNodeResourceData.DeserializeIspCacheNodeResourceData(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 IspCacheNodeResourceListResult(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(IspCacheNodeResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + IspCacheNodeResourceListResult 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 DeserializeIspCacheNodeResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IspCacheNodeResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/IspCacheNodeResourceListResult.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/IspCacheNodeResourceListResult.cs new file mode 100644 index 000000000000..7efc4f95d63b --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/IspCacheNodeResourceListResult.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.ConnectedCache.Models +{ + /// The response of a IspCacheNodeResource list operation. + internal partial class IspCacheNodeResourceListResult + { + /// + /// 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 IspCacheNodeResource items on this page. + /// is null. + internal IspCacheNodeResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The IspCacheNodeResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal IspCacheNodeResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IspCacheNodeResourceListResult() + { + } + + /// The IspCacheNodeResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/IspCustomerResourceListResult.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/IspCustomerResourceListResult.Serialization.cs new file mode 100644 index 000000000000..94904fa23ba6 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/IspCustomerResourceListResult.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.ConnectedCache.Models +{ + internal partial class IspCustomerResourceListResult : 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(IspCustomerResourceListResult)} 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 + } + } + } + + IspCustomerResourceListResult 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(IspCustomerResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIspCustomerResourceListResult(document.RootElement, options); + } + + internal static IspCustomerResourceListResult DeserializeIspCustomerResourceListResult(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(IspCustomerResourceData.DeserializeIspCustomerResourceData(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 IspCustomerResourceListResult(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(IspCustomerResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + IspCustomerResourceListResult 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 DeserializeIspCustomerResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IspCustomerResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/IspCustomerResourceListResult.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/IspCustomerResourceListResult.cs new file mode 100644 index 000000000000..2aa8709f8ac1 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/IspCustomerResourceListResult.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.ConnectedCache.Models +{ + /// The response of a IspCustomerResource list operation. + internal partial class IspCustomerResourceListResult + { + /// + /// 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 IspCustomerResource items on this page. + /// is null. + internal IspCustomerResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The IspCustomerResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal IspCustomerResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IspCustomerResourceListResult() + { + } + + /// The IspCustomerResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeAutoUpdateHistory.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeAutoUpdateHistory.Serialization.cs new file mode 100644 index 000000000000..3f162581bb96 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeAutoUpdateHistory.Serialization.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + public partial class MccCacheNodeAutoUpdateHistory : 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(MccCacheNodeAutoUpdateHistory)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + } + + MccCacheNodeAutoUpdateHistory 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(MccCacheNodeAutoUpdateHistory)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMccCacheNodeAutoUpdateHistory(document.RootElement, options); + } + + internal static MccCacheNodeAutoUpdateHistory DeserializeMccCacheNodeAutoUpdateHistory(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MccCacheNodeAutoUpdateHistoryProperties properties = default; + IReadOnlyDictionary tags = default; + string location = 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 = MccCacheNodeAutoUpdateHistoryProperties.DeserializeMccCacheNodeAutoUpdateHistoryProperties(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MccCacheNodeAutoUpdateHistory( + id, + name, + type, + systemData, + properties, + tags ?? new ChangeTrackingDictionary(), + location, + 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(MccCacheNodeAutoUpdateHistory)} does not support writing '{options.Format}' format."); + } + } + + MccCacheNodeAutoUpdateHistory 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 DeserializeMccCacheNodeAutoUpdateHistory(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MccCacheNodeAutoUpdateHistory)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeAutoUpdateHistory.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeAutoUpdateHistory.cs new file mode 100644 index 000000000000..37de2c6c6a29 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeAutoUpdateHistory.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + /// Mcc cache node resource auto update history. + public partial class MccCacheNodeAutoUpdateHistory : 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 . + /// The geo-location where the resource lives. + /// is null. + internal MccCacheNodeAutoUpdateHistory(string location) + { + Argument.AssertNotNull(location, nameof(location)); + + Tags = new ChangeTrackingDictionary(); + Location = location; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Mcc cache node resource auto update history properties. + /// Resource tags. + /// The geo-location where the resource lives. + /// Keeps track of any properties unknown to the library. + internal MccCacheNodeAutoUpdateHistory(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MccCacheNodeAutoUpdateHistoryProperties properties, IReadOnlyDictionary tags, string location, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + Tags = tags; + Location = location; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MccCacheNodeAutoUpdateHistory() + { + } + + /// Mcc cache node resource auto update history properties. + public MccCacheNodeAutoUpdateHistoryProperties Properties { get; } + /// Resource tags. + public IReadOnlyDictionary Tags { get; } + /// The geo-location where the resource lives. + public string Location { get; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeAutoUpdateHistoryProperties.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeAutoUpdateHistoryProperties.Serialization.cs new file mode 100644 index 000000000000..6eb828db6416 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeAutoUpdateHistoryProperties.Serialization.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + public partial class MccCacheNodeAutoUpdateHistoryProperties : 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(MccCacheNodeAutoUpdateHistoryProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(CustomerId)) + { + writer.WritePropertyName("customerId"u8); + writer.WriteStringValue(CustomerId); + } + if (options.Format != "W" && Optional.IsDefined(CacheNodeId)) + { + writer.WritePropertyName("cacheNodeId"u8); + writer.WriteStringValue(CacheNodeId); + } + if (Optional.IsCollectionDefined(AutoUpdateHistory)) + { + writer.WritePropertyName("autoUpdateHistory"u8); + writer.WriteStartArray(); + foreach (var item in AutoUpdateHistory) + { + 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 + } + } + } + + MccCacheNodeAutoUpdateHistoryProperties 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(MccCacheNodeAutoUpdateHistoryProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMccCacheNodeAutoUpdateHistoryProperties(document.RootElement, options); + } + + internal static MccCacheNodeAutoUpdateHistoryProperties DeserializeMccCacheNodeAutoUpdateHistoryProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string customerId = default; + string cacheNodeId = default; + IReadOnlyList autoUpdateHistory = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customerId"u8)) + { + customerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("cacheNodeId"u8)) + { + cacheNodeId = property.Value.GetString(); + continue; + } + if (property.NameEquals("autoUpdateHistory"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MccCacheNodeAutoUpdateInfo.DeserializeMccCacheNodeAutoUpdateInfo(item, options)); + } + autoUpdateHistory = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MccCacheNodeAutoUpdateHistoryProperties(customerId, cacheNodeId, autoUpdateHistory ?? 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(MccCacheNodeAutoUpdateHistoryProperties)} does not support writing '{options.Format}' format."); + } + } + + MccCacheNodeAutoUpdateHistoryProperties 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 DeserializeMccCacheNodeAutoUpdateHistoryProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MccCacheNodeAutoUpdateHistoryProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeAutoUpdateHistoryProperties.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeAutoUpdateHistoryProperties.cs new file mode 100644 index 000000000000..7a44c6988fdf --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeAutoUpdateHistoryProperties.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + /// Mcc cache node resource auto update history properties. + public partial class MccCacheNodeAutoUpdateHistoryProperties + { + /// + /// 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 MccCacheNodeAutoUpdateHistoryProperties() + { + AutoUpdateHistory = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Mcc customer resource Id. + /// Mcc cache node resource Id. + /// Cache node resource auto update history information. + /// Keeps track of any properties unknown to the library. + internal MccCacheNodeAutoUpdateHistoryProperties(string customerId, string cacheNodeId, IReadOnlyList autoUpdateHistory, IDictionary serializedAdditionalRawData) + { + CustomerId = customerId; + CacheNodeId = cacheNodeId; + AutoUpdateHistory = autoUpdateHistory; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Mcc customer resource Id. + public string CustomerId { get; } + /// Mcc cache node resource Id. + public string CacheNodeId { get; } + /// Cache node resource auto update history information. + public IReadOnlyList AutoUpdateHistory { get; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeAutoUpdateInfo.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeAutoUpdateInfo.Serialization.cs new file mode 100644 index 000000000000..b9a990e5765c --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeAutoUpdateInfo.Serialization.cs @@ -0,0 +1,355 @@ +// 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.ConnectedCache.Models +{ + public partial class MccCacheNodeAutoUpdateInfo : 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(MccCacheNodeAutoUpdateInfo)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ImageUriBeforeUpdate)) + { + writer.WritePropertyName("imageUriBeforeUpdate"u8); + writer.WriteStringValue(ImageUriBeforeUpdate); + } + if (options.Format != "W" && Optional.IsDefined(ImageUriTargeted)) + { + writer.WritePropertyName("imageUriTargeted"u8); + writer.WriteStringValue(ImageUriTargeted); + } + if (options.Format != "W" && Optional.IsDefined(ImageUriTerminal)) + { + writer.WritePropertyName("imageUriTerminal"u8); + writer.WriteStringValue(ImageUriTerminal); + } + if (options.Format != "W" && Optional.IsDefined(AutoUpdateRingType)) + { + writer.WritePropertyName("autoUpdateRingType"u8); + writer.WriteNumberValue(AutoUpdateRingType.Value); + } + if (options.Format != "W" && Optional.IsDefined(MovedToTerminalStateOn)) + { + writer.WritePropertyName("movedToTerminalStateDateTime"u8); + writer.WriteStringValue(MovedToTerminalStateOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(RuleRequestedWeek)) + { + writer.WritePropertyName("ruleRequestedWeek"u8); + writer.WriteNumberValue(RuleRequestedWeek.Value); + } + if (options.Format != "W" && Optional.IsDefined(RuleRequestedDay)) + { + writer.WritePropertyName("ruleRequestedDay"u8); + writer.WriteNumberValue(RuleRequestedDay.Value); + } + if (options.Format != "W" && Optional.IsDefined(CreatedDateTimeUtc)) + { + writer.WritePropertyName("createdDateTimeUtc"u8); + writer.WriteStringValue(CreatedDateTimeUtc.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(UpdatedRegistryDateTimeUtc)) + { + writer.WritePropertyName("updatedRegistryDateTimeUtc"u8); + writer.WriteStringValue(UpdatedRegistryDateTimeUtc.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(PlanChangeLogText)) + { + writer.WritePropertyName("planChangeLogText"u8); + writer.WriteStringValue(PlanChangeLogText); + } + if (options.Format != "W" && Optional.IsDefined(AutoUpdateLastAppliedStatus)) + { + writer.WritePropertyName("autoUpdateLastAppliedStatus"u8); + writer.WriteNumberValue(AutoUpdateLastAppliedStatus.Value); + } + if (options.Format != "W" && Optional.IsDefined(AutoUpdateLastAppliedStatusText)) + { + writer.WritePropertyName("autoUpdateLastAppliedStatusText"u8); + writer.WriteStringValue(AutoUpdateLastAppliedStatusText); + } + if (options.Format != "W" && Optional.IsDefined(AutoUpdateLastAppliedStatusDetailedText)) + { + writer.WritePropertyName("autoUpdateLastAppliedStatusDetailedText"u8); + writer.WriteStringValue(AutoUpdateLastAppliedStatusDetailedText); + } + if (options.Format != "W" && Optional.IsDefined(PlanId)) + { + writer.WritePropertyName("planId"u8); + writer.WriteNumberValue(PlanId.Value); + } + if (options.Format != "W" && Optional.IsDefined(TimeToGoLiveDateTime)) + { + writer.WritePropertyName("timeToGoLiveDateTime"u8); + writer.WriteStringValue(TimeToGoLiveDateTime); + } + if (options.Format != "W" && Optional.IsDefined(RuleRequestedMinute)) + { + writer.WritePropertyName("ruleRequestedMinute"u8); + writer.WriteStringValue(RuleRequestedMinute); + } + if (options.Format != "W" && Optional.IsDefined(RuleRequestedHour)) + { + writer.WritePropertyName("ruleRequestedHour"u8); + writer.WriteStringValue(RuleRequestedHour); + } + 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 + } + } + } + + MccCacheNodeAutoUpdateInfo 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(MccCacheNodeAutoUpdateInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMccCacheNodeAutoUpdateInfo(document.RootElement, options); + } + + internal static MccCacheNodeAutoUpdateInfo DeserializeMccCacheNodeAutoUpdateInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string imageUriBeforeUpdate = default; + string imageUriTargeted = default; + string imageUriTerminal = default; + int? autoUpdateRingType = default; + DateTimeOffset? movedToTerminalStateDateTime = default; + int? ruleRequestedWeek = default; + int? ruleRequestedDay = default; + DateTimeOffset? createdDateTimeUtc = default; + DateTimeOffset? updatedRegistryDateTimeUtc = default; + string planChangeLogText = default; + int? autoUpdateLastAppliedStatus = default; + string autoUpdateLastAppliedStatusText = default; + string autoUpdateLastAppliedStatusDetailedText = default; + long? planId = default; + string timeToGoLiveDateTime = default; + string ruleRequestedMinute = default; + string ruleRequestedHour = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("imageUriBeforeUpdate"u8)) + { + imageUriBeforeUpdate = property.Value.GetString(); + continue; + } + if (property.NameEquals("imageUriTargeted"u8)) + { + imageUriTargeted = property.Value.GetString(); + continue; + } + if (property.NameEquals("imageUriTerminal"u8)) + { + imageUriTerminal = property.Value.GetString(); + continue; + } + if (property.NameEquals("autoUpdateRingType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoUpdateRingType = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("movedToTerminalStateDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + movedToTerminalStateDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("ruleRequestedWeek"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ruleRequestedWeek = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("ruleRequestedDay"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ruleRequestedDay = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("createdDateTimeUtc"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdDateTimeUtc = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("updatedRegistryDateTimeUtc"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedRegistryDateTimeUtc = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("planChangeLogText"u8)) + { + planChangeLogText = property.Value.GetString(); + continue; + } + if (property.NameEquals("autoUpdateLastAppliedStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoUpdateLastAppliedStatus = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("autoUpdateLastAppliedStatusText"u8)) + { + autoUpdateLastAppliedStatusText = property.Value.GetString(); + continue; + } + if (property.NameEquals("autoUpdateLastAppliedStatusDetailedText"u8)) + { + autoUpdateLastAppliedStatusDetailedText = property.Value.GetString(); + continue; + } + if (property.NameEquals("planId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + planId = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("timeToGoLiveDateTime"u8)) + { + timeToGoLiveDateTime = property.Value.GetString(); + continue; + } + if (property.NameEquals("ruleRequestedMinute"u8)) + { + ruleRequestedMinute = property.Value.GetString(); + continue; + } + if (property.NameEquals("ruleRequestedHour"u8)) + { + ruleRequestedHour = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MccCacheNodeAutoUpdateInfo( + imageUriBeforeUpdate, + imageUriTargeted, + imageUriTerminal, + autoUpdateRingType, + movedToTerminalStateDateTime, + ruleRequestedWeek, + ruleRequestedDay, + createdDateTimeUtc, + updatedRegistryDateTimeUtc, + planChangeLogText, + autoUpdateLastAppliedStatus, + autoUpdateLastAppliedStatusText, + autoUpdateLastAppliedStatusDetailedText, + planId, + timeToGoLiveDateTime, + ruleRequestedMinute, + ruleRequestedHour, + 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(MccCacheNodeAutoUpdateInfo)} does not support writing '{options.Format}' format."); + } + } + + MccCacheNodeAutoUpdateInfo 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 DeserializeMccCacheNodeAutoUpdateInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MccCacheNodeAutoUpdateInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeAutoUpdateInfo.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeAutoUpdateInfo.cs new file mode 100644 index 000000000000..3b05b1b79eed --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeAutoUpdateInfo.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + /// Mcc cache node resource auto update properties. + public partial class MccCacheNodeAutoUpdateInfo + { + /// + /// 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 MccCacheNodeAutoUpdateInfo() + { + } + + /// Initializes a new instance of . + /// Auto update image uri before update. + /// Auto update image uri targetted to update. + /// Auto update image uri at Terminal. + /// Auto update Ring Type. + /// Auto update image uri after update. + /// Auto update image uri before update. + /// Auto update image uri after update. + /// Auto update entity created datetime. + /// Auto update entity last updated datetime. + /// This text describing the purpose of the plan of auto update. + /// Auto update last applied status. + /// Auto update last applied status text. + /// Auto update last applied detailed status text. + /// Auto update planId. + /// Auto update time to go live date time. + /// Auto update rule requested minute. + /// Auto update rule requested hour. + /// Keeps track of any properties unknown to the library. + internal MccCacheNodeAutoUpdateInfo(string imageUriBeforeUpdate, string imageUriTargeted, string imageUriTerminal, int? autoUpdateRingType, DateTimeOffset? movedToTerminalStateOn, int? ruleRequestedWeek, int? ruleRequestedDay, DateTimeOffset? createdDateTimeUtc, DateTimeOffset? updatedRegistryDateTimeUtc, string planChangeLogText, int? autoUpdateLastAppliedStatus, string autoUpdateLastAppliedStatusText, string autoUpdateLastAppliedStatusDetailedText, long? planId, string timeToGoLiveDateTime, string ruleRequestedMinute, string ruleRequestedHour, IDictionary serializedAdditionalRawData) + { + ImageUriBeforeUpdate = imageUriBeforeUpdate; + ImageUriTargeted = imageUriTargeted; + ImageUriTerminal = imageUriTerminal; + AutoUpdateRingType = autoUpdateRingType; + MovedToTerminalStateOn = movedToTerminalStateOn; + RuleRequestedWeek = ruleRequestedWeek; + RuleRequestedDay = ruleRequestedDay; + CreatedDateTimeUtc = createdDateTimeUtc; + UpdatedRegistryDateTimeUtc = updatedRegistryDateTimeUtc; + PlanChangeLogText = planChangeLogText; + AutoUpdateLastAppliedStatus = autoUpdateLastAppliedStatus; + AutoUpdateLastAppliedStatusText = autoUpdateLastAppliedStatusText; + AutoUpdateLastAppliedStatusDetailedText = autoUpdateLastAppliedStatusDetailedText; + PlanId = planId; + TimeToGoLiveDateTime = timeToGoLiveDateTime; + RuleRequestedMinute = ruleRequestedMinute; + RuleRequestedHour = ruleRequestedHour; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Auto update image uri before update. + public string ImageUriBeforeUpdate { get; } + /// Auto update image uri targetted to update. + public string ImageUriTargeted { get; } + /// Auto update image uri at Terminal. + public string ImageUriTerminal { get; } + /// Auto update Ring Type. + public int? AutoUpdateRingType { get; } + /// Auto update image uri after update. + public DateTimeOffset? MovedToTerminalStateOn { get; } + /// Auto update image uri before update. + public int? RuleRequestedWeek { get; } + /// Auto update image uri after update. + public int? RuleRequestedDay { get; } + /// Auto update entity created datetime. + public DateTimeOffset? CreatedDateTimeUtc { get; } + /// Auto update entity last updated datetime. + public DateTimeOffset? UpdatedRegistryDateTimeUtc { get; } + /// This text describing the purpose of the plan of auto update. + public string PlanChangeLogText { get; } + /// Auto update last applied status. + public int? AutoUpdateLastAppliedStatus { get; } + /// Auto update last applied status text. + public string AutoUpdateLastAppliedStatusText { get; } + /// Auto update last applied detailed status text. + public string AutoUpdateLastAppliedStatusDetailedText { get; } + /// Auto update planId. + public long? PlanId { get; } + /// Auto update time to go live date time. + public string TimeToGoLiveDateTime { get; } + /// Auto update rule requested minute. + public string RuleRequestedMinute { get; } + /// Auto update rule requested hour. + public string RuleRequestedHour { get; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeBgpCidrDetails.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeBgpCidrDetails.Serialization.cs new file mode 100644 index 000000000000..b00c9bcfd45b --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeBgpCidrDetails.Serialization.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + public partial class MccCacheNodeBgpCidrDetails : 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(MccCacheNodeBgpCidrDetails)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + } + + MccCacheNodeBgpCidrDetails 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(MccCacheNodeBgpCidrDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMccCacheNodeBgpCidrDetails(document.RootElement, options); + } + + internal static MccCacheNodeBgpCidrDetails DeserializeMccCacheNodeBgpCidrDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BgpCidrsConfiguration properties = default; + IReadOnlyDictionary tags = default; + string location = 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 = BgpCidrsConfiguration.DeserializeBgpCidrsConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MccCacheNodeBgpCidrDetails( + id, + name, + type, + systemData, + properties, + tags ?? new ChangeTrackingDictionary(), + location, + 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(MccCacheNodeBgpCidrDetails)} does not support writing '{options.Format}' format."); + } + } + + MccCacheNodeBgpCidrDetails 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 DeserializeMccCacheNodeBgpCidrDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MccCacheNodeBgpCidrDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeBgpCidrDetails.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeBgpCidrDetails.cs new file mode 100644 index 000000000000..b61563824da5 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeBgpCidrDetails.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + /// Represents all Cidr details of the Bgp request for a specific cache node resource. + public partial class MccCacheNodeBgpCidrDetails : 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 . + /// The geo-location where the resource lives. + /// is null. + internal MccCacheNodeBgpCidrDetails(string location) + { + Argument.AssertNotNull(location, nameof(location)); + + Tags = new ChangeTrackingDictionary(); + Location = location; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Mcc cache node resource Bgp Cidr properties. + /// Resource tags. + /// The geo-location where the resource lives. + /// Keeps track of any properties unknown to the library. + internal MccCacheNodeBgpCidrDetails(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, BgpCidrsConfiguration properties, IReadOnlyDictionary tags, string location, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + Tags = tags; + Location = location; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MccCacheNodeBgpCidrDetails() + { + } + + /// Mcc cache node resource Bgp Cidr properties. + internal BgpCidrsConfiguration Properties { get; } + /// Mcc cache node Bgp Cidr details. + public IReadOnlyList BgpCidrs + { + get => Properties?.BgpCidrs; + } + + /// Resource tags. + public IReadOnlyDictionary Tags { get; } + /// The geo-location where the resource lives. + public string Location { get; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeInstallDetails.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeInstallDetails.Serialization.cs new file mode 100644 index 000000000000..181283807210 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeInstallDetails.Serialization.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + public partial class MccCacheNodeInstallDetails : 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(MccCacheNodeInstallDetails)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + } + + MccCacheNodeInstallDetails 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(MccCacheNodeInstallDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMccCacheNodeInstallDetails(document.RootElement, options); + } + + internal static MccCacheNodeInstallDetails DeserializeMccCacheNodeInstallDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CacheNodeInstallProperties properties = default; + IReadOnlyDictionary tags = default; + string location = 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 = CacheNodeInstallProperties.DeserializeCacheNodeInstallProperties(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MccCacheNodeInstallDetails( + id, + name, + type, + systemData, + properties, + tags ?? new ChangeTrackingDictionary(), + location, + 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(MccCacheNodeInstallDetails)} does not support writing '{options.Format}' format."); + } + } + + MccCacheNodeInstallDetails 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 DeserializeMccCacheNodeInstallDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MccCacheNodeInstallDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeInstallDetails.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeInstallDetails.cs new file mode 100644 index 000000000000..9e45243a8915 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeInstallDetails.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + /// Mcc cache node resource all install details. + public partial class MccCacheNodeInstallDetails : 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 . + /// The geo-location where the resource lives. + /// is null. + internal MccCacheNodeInstallDetails(string location) + { + Argument.AssertNotNull(location, nameof(location)); + + Tags = new ChangeTrackingDictionary(); + Location = location; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Mcc cache node resource install script details. + /// Resource tags. + /// The geo-location where the resource lives. + /// Keeps track of any properties unknown to the library. + internal MccCacheNodeInstallDetails(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, CacheNodeInstallProperties properties, IReadOnlyDictionary tags, string location, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + Tags = tags; + Location = location; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MccCacheNodeInstallDetails() + { + } + + /// Mcc cache node resource install script details. + public CacheNodeInstallProperties Properties { get; } + /// Resource tags. + public IReadOnlyDictionary Tags { get; } + /// The geo-location where the resource lives. + public string Location { get; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeIssueHistory.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeIssueHistory.Serialization.cs new file mode 100644 index 000000000000..62b9ed7f8655 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeIssueHistory.Serialization.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + public partial class MccCacheNodeIssueHistory : 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(MccCacheNodeIssueHistory)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + } + + MccCacheNodeIssueHistory 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(MccCacheNodeIssueHistory)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMccCacheNodeIssueHistory(document.RootElement, options); + } + + internal static MccCacheNodeIssueHistory DeserializeMccCacheNodeIssueHistory(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MccCacheNodeIssueHistoryProperties properties = default; + IReadOnlyDictionary tags = default; + string location = 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 = MccCacheNodeIssueHistoryProperties.DeserializeMccCacheNodeIssueHistoryProperties(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MccCacheNodeIssueHistory( + id, + name, + type, + systemData, + properties, + tags ?? new ChangeTrackingDictionary(), + location, + 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(MccCacheNodeIssueHistory)} does not support writing '{options.Format}' format."); + } + } + + MccCacheNodeIssueHistory 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 DeserializeMccCacheNodeIssueHistory(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MccCacheNodeIssueHistory)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeIssueHistory.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeIssueHistory.cs new file mode 100644 index 000000000000..a0137478c894 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeIssueHistory.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + /// Mcc cache node resource issue history. + public partial class MccCacheNodeIssueHistory : 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 . + /// The geo-location where the resource lives. + /// is null. + internal MccCacheNodeIssueHistory(string location) + { + Argument.AssertNotNull(location, nameof(location)); + + Tags = new ChangeTrackingDictionary(); + Location = location; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Mcc cache node resource issue history properties. + /// Resource tags. + /// The geo-location where the resource lives. + /// Keeps track of any properties unknown to the library. + internal MccCacheNodeIssueHistory(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MccCacheNodeIssueHistoryProperties properties, IReadOnlyDictionary tags, string location, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + Tags = tags; + Location = location; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MccCacheNodeIssueHistory() + { + } + + /// Mcc cache node resource issue history properties. + public MccCacheNodeIssueHistoryProperties Properties { get; } + /// Resource tags. + public IReadOnlyDictionary Tags { get; } + /// The geo-location where the resource lives. + public string Location { get; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeIssueHistoryProperties.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeIssueHistoryProperties.Serialization.cs new file mode 100644 index 000000000000..4e47fc37eee8 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeIssueHistoryProperties.Serialization.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + public partial class MccCacheNodeIssueHistoryProperties : 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(MccCacheNodeIssueHistoryProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(CustomerId)) + { + writer.WritePropertyName("customerId"u8); + writer.WriteStringValue(CustomerId); + } + if (options.Format != "W" && Optional.IsDefined(CacheNodeId)) + { + writer.WritePropertyName("cacheNodeId"u8); + writer.WriteStringValue(CacheNodeId); + } + if (Optional.IsCollectionDefined(MccIssueHistory)) + { + writer.WritePropertyName("mccIssueHistory"u8); + writer.WriteStartArray(); + foreach (var item in MccIssueHistory) + { + 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 + } + } + } + + MccCacheNodeIssueHistoryProperties 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(MccCacheNodeIssueHistoryProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMccCacheNodeIssueHistoryProperties(document.RootElement, options); + } + + internal static MccCacheNodeIssueHistoryProperties DeserializeMccCacheNodeIssueHistoryProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string customerId = default; + string cacheNodeId = default; + IReadOnlyList mccIssueHistory = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customerId"u8)) + { + customerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("cacheNodeId"u8)) + { + cacheNodeId = property.Value.GetString(); + continue; + } + if (property.NameEquals("mccIssueHistory"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MccIssue.DeserializeMccIssue(item, options)); + } + mccIssueHistory = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MccCacheNodeIssueHistoryProperties(customerId, cacheNodeId, mccIssueHistory ?? 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(MccCacheNodeIssueHistoryProperties)} does not support writing '{options.Format}' format."); + } + } + + MccCacheNodeIssueHistoryProperties 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 DeserializeMccCacheNodeIssueHistoryProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MccCacheNodeIssueHistoryProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeIssueHistoryProperties.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeIssueHistoryProperties.cs new file mode 100644 index 000000000000..c48efebfb16f --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeIssueHistoryProperties.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + /// Mcc cache node resource issue history properties. + public partial class MccCacheNodeIssueHistoryProperties + { + /// + /// 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 MccCacheNodeIssueHistoryProperties() + { + MccIssueHistory = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Mcc customer resource Id. + /// Mcc cache node resource Id. + /// Cache node resource issue details history. + /// Keeps track of any properties unknown to the library. + internal MccCacheNodeIssueHistoryProperties(string customerId, string cacheNodeId, IReadOnlyList mccIssueHistory, IDictionary serializedAdditionalRawData) + { + CustomerId = customerId; + CacheNodeId = cacheNodeId; + MccIssueHistory = mccIssueHistory; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Mcc customer resource Id. + public string CustomerId { get; } + /// Mcc cache node resource Id. + public string CacheNodeId { get; } + /// Cache node resource issue details history. + public IReadOnlyList MccIssueHistory { get; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeTlsCertificate.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeTlsCertificate.Serialization.cs new file mode 100644 index 000000000000..2501affd1685 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeTlsCertificate.Serialization.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + public partial class MccCacheNodeTlsCertificate : 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(MccCacheNodeTlsCertificate)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ActionRequired)) + { + writer.WritePropertyName("actionRequired"u8); + writer.WriteStringValue(ActionRequired); + } + if (options.Format != "W" && Optional.IsDefined(CertificateFileName)) + { + writer.WritePropertyName("certificateFileName"u8); + writer.WriteStringValue(CertificateFileName); + } + if (options.Format != "W" && Optional.IsDefined(Thumbprint)) + { + writer.WritePropertyName("thumbprint"u8); + writer.WriteStringValue(Thumbprint); + } + if (options.Format != "W" && Optional.IsDefined(ExpiryOn)) + { + writer.WritePropertyName("expiryDate"u8); + writer.WriteStringValue(ExpiryOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(NotBeforeOn)) + { + writer.WritePropertyName("notBeforeDate"u8); + writer.WriteStringValue(NotBeforeOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Subject)) + { + writer.WritePropertyName("subject"u8); + writer.WriteStringValue(Subject); + } + if (options.Format != "W" && Optional.IsDefined(SubjectAltName)) + { + writer.WritePropertyName("subjectAltName"u8); + writer.WriteStringValue(SubjectAltName); + } + 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 + } + } + } + + MccCacheNodeTlsCertificate 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(MccCacheNodeTlsCertificate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMccCacheNodeTlsCertificate(document.RootElement, options); + } + + internal static MccCacheNodeTlsCertificate DeserializeMccCacheNodeTlsCertificate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string actionRequired = default; + string certificateFileName = default; + string thumbprint = default; + DateTimeOffset? expiryDate = default; + DateTimeOffset? notBeforeDate = default; + string subject = default; + string subjectAltName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("actionRequired"u8)) + { + actionRequired = property.Value.GetString(); + continue; + } + if (property.NameEquals("certificateFileName"u8)) + { + certificateFileName = property.Value.GetString(); + continue; + } + if (property.NameEquals("thumbprint"u8)) + { + thumbprint = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiryDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiryDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("notBeforeDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + notBeforeDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("subject"u8)) + { + subject = property.Value.GetString(); + continue; + } + if (property.NameEquals("subjectAltName"u8)) + { + subjectAltName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MccCacheNodeTlsCertificate( + actionRequired, + certificateFileName, + thumbprint, + expiryDate, + notBeforeDate, + subject, + subjectAltName, + 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(MccCacheNodeTlsCertificate)} does not support writing '{options.Format}' format."); + } + } + + MccCacheNodeTlsCertificate 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 DeserializeMccCacheNodeTlsCertificate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MccCacheNodeTlsCertificate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeTlsCertificate.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeTlsCertificate.cs new file mode 100644 index 000000000000..1fefe3444e95 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeTlsCertificate.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + /// Mcc cache node resource Tls certificate details. + public partial class MccCacheNodeTlsCertificate + { + /// + /// 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 MccCacheNodeTlsCertificate() + { + } + + /// Initializes a new instance of . + /// Mcc cache node Tls certificate status. + /// Mcc cache node Tls certificate file name. + /// Mcc cache node Tls certificate thumbprint. + /// Mcc cache node Tls certificate expiry date. + /// Mcc cache node Tls certificate not before date. + /// Mcc cache node Tls certificate subject name. + /// Mcc cache node Tls certificate subject alternate name. + /// Keeps track of any properties unknown to the library. + internal MccCacheNodeTlsCertificate(string actionRequired, string certificateFileName, string thumbprint, DateTimeOffset? expiryOn, DateTimeOffset? notBeforeOn, string subject, string subjectAltName, IDictionary serializedAdditionalRawData) + { + ActionRequired = actionRequired; + CertificateFileName = certificateFileName; + Thumbprint = thumbprint; + ExpiryOn = expiryOn; + NotBeforeOn = notBeforeOn; + Subject = subject; + SubjectAltName = subjectAltName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Mcc cache node Tls certificate status. + public string ActionRequired { get; } + /// Mcc cache node Tls certificate file name. + public string CertificateFileName { get; } + /// Mcc cache node Tls certificate thumbprint. + public string Thumbprint { get; } + /// Mcc cache node Tls certificate expiry date. + public DateTimeOffset? ExpiryOn { get; } + /// Mcc cache node Tls certificate not before date. + public DateTimeOffset? NotBeforeOn { get; } + /// Mcc cache node Tls certificate subject name. + public string Subject { get; } + /// Mcc cache node Tls certificate subject alternate name. + public string SubjectAltName { get; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeTlsCertificateHistory.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeTlsCertificateHistory.Serialization.cs new file mode 100644 index 000000000000..b2e59eb6f6df --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeTlsCertificateHistory.Serialization.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + public partial class MccCacheNodeTlsCertificateHistory : 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(MccCacheNodeTlsCertificateHistory)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + } + + MccCacheNodeTlsCertificateHistory 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(MccCacheNodeTlsCertificateHistory)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMccCacheNodeTlsCertificateHistory(document.RootElement, options); + } + + internal static MccCacheNodeTlsCertificateHistory DeserializeMccCacheNodeTlsCertificateHistory(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MccCacheNodeTlsCertificateProperties properties = default; + IReadOnlyDictionary tags = default; + string location = 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 = MccCacheNodeTlsCertificateProperties.DeserializeMccCacheNodeTlsCertificateProperties(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MccCacheNodeTlsCertificateHistory( + id, + name, + type, + systemData, + properties, + tags ?? new ChangeTrackingDictionary(), + location, + 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(MccCacheNodeTlsCertificateHistory)} does not support writing '{options.Format}' format."); + } + } + + MccCacheNodeTlsCertificateHistory 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 DeserializeMccCacheNodeTlsCertificateHistory(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MccCacheNodeTlsCertificateHistory)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeTlsCertificateHistory.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeTlsCertificateHistory.cs new file mode 100644 index 000000000000..7c318eb0d0d7 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeTlsCertificateHistory.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + /// Mcc cache node resource Tls certificate history details. + public partial class MccCacheNodeTlsCertificateHistory : 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 . + /// The geo-location where the resource lives. + /// is null. + internal MccCacheNodeTlsCertificateHistory(string location) + { + Argument.AssertNotNull(location, nameof(location)); + + Tags = new ChangeTrackingDictionary(); + Location = location; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Mcc cache node resource Tls certificate details. + /// Resource tags. + /// The geo-location where the resource lives. + /// Keeps track of any properties unknown to the library. + internal MccCacheNodeTlsCertificateHistory(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MccCacheNodeTlsCertificateProperties properties, IReadOnlyDictionary tags, string location, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + Tags = tags; + Location = location; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MccCacheNodeTlsCertificateHistory() + { + } + + /// Mcc cache node resource Tls certificate details. + public MccCacheNodeTlsCertificateProperties Properties { get; } + /// Resource tags. + public IReadOnlyDictionary Tags { get; } + /// The geo-location where the resource lives. + public string Location { get; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeTlsCertificateProperties.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeTlsCertificateProperties.Serialization.cs new file mode 100644 index 000000000000..4a3e32a9862d --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeTlsCertificateProperties.Serialization.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + public partial class MccCacheNodeTlsCertificateProperties : 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(MccCacheNodeTlsCertificateProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(CustomerId)) + { + writer.WritePropertyName("customerId"u8); + writer.WriteStringValue(CustomerId); + } + if (options.Format != "W" && Optional.IsDefined(CacheNodeId)) + { + writer.WritePropertyName("cacheNodeId"u8); + writer.WriteStringValue(CacheNodeId); + } + if (Optional.IsCollectionDefined(TlsCertificateHistory)) + { + writer.WritePropertyName("tlsCertificateHistory"u8); + writer.WriteStartArray(); + foreach (var item in TlsCertificateHistory) + { + 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 + } + } + } + + MccCacheNodeTlsCertificateProperties 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(MccCacheNodeTlsCertificateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMccCacheNodeTlsCertificateProperties(document.RootElement, options); + } + + internal static MccCacheNodeTlsCertificateProperties DeserializeMccCacheNodeTlsCertificateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string customerId = default; + string cacheNodeId = default; + IReadOnlyList tlsCertificateHistory = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customerId"u8)) + { + customerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("cacheNodeId"u8)) + { + cacheNodeId = property.Value.GetString(); + continue; + } + if (property.NameEquals("tlsCertificateHistory"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MccCacheNodeTlsCertificate.DeserializeMccCacheNodeTlsCertificate(item, options)); + } + tlsCertificateHistory = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MccCacheNodeTlsCertificateProperties(customerId, cacheNodeId, tlsCertificateHistory ?? 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(MccCacheNodeTlsCertificateProperties)} does not support writing '{options.Format}' format."); + } + } + + MccCacheNodeTlsCertificateProperties 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 DeserializeMccCacheNodeTlsCertificateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MccCacheNodeTlsCertificateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeTlsCertificateProperties.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeTlsCertificateProperties.cs new file mode 100644 index 000000000000..5a2e4f16f8fd --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccCacheNodeTlsCertificateProperties.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + /// Mcc cache node resource auto update properties. + public partial class MccCacheNodeTlsCertificateProperties + { + /// + /// 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 MccCacheNodeTlsCertificateProperties() + { + TlsCertificateHistory = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Mcc customer resource Id. + /// Mcc cache node resource Id. + /// Cache node resource tls certificate history details. + /// Keeps track of any properties unknown to the library. + internal MccCacheNodeTlsCertificateProperties(string customerId, string cacheNodeId, IReadOnlyList tlsCertificateHistory, IDictionary serializedAdditionalRawData) + { + CustomerId = customerId; + CacheNodeId = cacheNodeId; + TlsCertificateHistory = tlsCertificateHistory; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Mcc customer resource Id. + public string CustomerId { get; } + /// Mcc cache node resource Id. + public string CacheNodeId { get; } + /// Cache node resource tls certificate history details. + public IReadOnlyList TlsCertificateHistory { get; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccIssue.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccIssue.Serialization.cs new file mode 100644 index 000000000000..acca0f79c693 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccIssue.Serialization.cs @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + public partial class MccIssue : 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(MccIssue)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(MccIssueType)) + { + writer.WritePropertyName("mccIssueType"u8); + writer.WriteStringValue(MccIssueType); + } + if (options.Format != "W" && Optional.IsDefined(ToastString)) + { + writer.WritePropertyName("toastString"u8); + writer.WriteStringValue(ToastString); + } + if (options.Format != "W" && Optional.IsDefined(DetailString)) + { + writer.WritePropertyName("detailString"u8); + writer.WriteStringValue(DetailString); + } + if (options.Format != "W" && Optional.IsDefined(HelpLink)) + { + writer.WritePropertyName("helpLink"u8); + writer.WriteStringValue(HelpLink); + } + if (options.Format != "W" && Optional.IsDefined(IssueStartOn)) + { + writer.WritePropertyName("issueStartDate"u8); + writer.WriteStringValue(IssueStartOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(IssueEndOn)) + { + writer.WritePropertyName("issueEndDate"u8); + writer.WriteStringValue(IssueEndOn.Value, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MccIssue 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(MccIssue)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMccIssue(document.RootElement, options); + } + + internal static MccIssue DeserializeMccIssue(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string mccIssueType = default; + string toastString = default; + string detailString = default; + string helpLink = default; + DateTimeOffset? issueStartDate = default; + DateTimeOffset? issueEndDate = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mccIssueType"u8)) + { + mccIssueType = property.Value.GetString(); + continue; + } + if (property.NameEquals("toastString"u8)) + { + toastString = property.Value.GetString(); + continue; + } + if (property.NameEquals("detailString"u8)) + { + detailString = property.Value.GetString(); + continue; + } + if (property.NameEquals("helpLink"u8)) + { + helpLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("issueStartDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + issueStartDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("issueEndDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + issueEndDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MccIssue( + mccIssueType, + toastString, + detailString, + helpLink, + issueStartDate, + issueEndDate, + 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(MccIssue)} does not support writing '{options.Format}' format."); + } + } + + MccIssue 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 DeserializeMccIssue(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MccIssue)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccIssue.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccIssue.cs new file mode 100644 index 000000000000..c6aff32faaa3 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/MccIssue.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + /// Mcc cache node resource issue properties. + public partial class MccIssue + { + /// + /// 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 MccIssue() + { + } + + /// Initializes a new instance of . + /// Mcc cache node issue type. + /// Mcc cache node issues toastString. + /// Mcc cache node issue detail string. + /// Mcc cache node issue related help link. + /// Mcc cache node issue start date. + /// Mcc cache node issue end date. + /// Keeps track of any properties unknown to the library. + internal MccIssue(string mccIssueType, string toastString, string detailString, string helpLink, DateTimeOffset? issueStartOn, DateTimeOffset? issueEndOn, IDictionary serializedAdditionalRawData) + { + MccIssueType = mccIssueType; + ToastString = toastString; + DetailString = detailString; + HelpLink = helpLink; + IssueStartOn = issueStartOn; + IssueEndOn = issueEndOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Mcc cache node issue type. + public string MccIssueType { get; } + /// Mcc cache node issues toastString. + public string ToastString { get; } + /// Mcc cache node issue detail string. + public string DetailString { get; } + /// Mcc cache node issue related help link. + public string HelpLink { get; } + /// Mcc cache node issue start date. + public DateTimeOffset? IssueStartOn { get; } + /// Mcc cache node issue end date. + public DateTimeOffset? IssueEndOn { get; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/OSType.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/OSType.cs new file mode 100644 index 000000000000..9e91f3b4d854 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/OSType.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.ConnectedCache.Models +{ + /// Operating System of the cache node. + public readonly partial struct OSType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OSType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WindowsValue = "Windows"; + private const string LinuxValue = "Linux"; + private const string EflowValue = "Eflow"; + + /// cache node installs on windows operating system. + public static OSType Windows { get; } = new OSType(WindowsValue); + /// cache node installs on Linux Operating system. + public static OSType Linux { get; } = new OSType(LinuxValue); + /// cache node installs on Azure Eflow. + public static OSType Eflow { get; } = new OSType(EflowValue); + /// Determines if two values are the same. + public static bool operator ==(OSType left, OSType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OSType left, OSType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OSType(string value) => new OSType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OSType other && Equals(other); + /// + public bool Equals(OSType 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/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/ProvisioningState.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 000000000000..fdb884f09e85 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/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.ConnectedCache.Models +{ + /// provisioning state of the resource. + 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 UnknownValue = "Unknown"; + private const string AcceptedValue = "Accepted"; + private const string UpgradingValue = "Upgrading"; + private const string DeletingValue = "Deleting"; + + /// Resource has been created. + public static ProvisioningState Succeeded { get; } = new ProvisioningState(SucceededValue); + /// Resource creation failed. + public static ProvisioningState Failed { get; } = new ProvisioningState(FailedValue); + /// Resource creation was canceled. + public static ProvisioningState Canceled { get; } = new ProvisioningState(CanceledValue); + /// unknown state of the provisioning state. + public static ProvisioningState Unknown { get; } = new ProvisioningState(UnknownValue); + /// Accepted state of the provisioning state during the Async Operations. + public static ProvisioningState Accepted { get; } = new ProvisioningState(AcceptedValue); + /// Upgrading state of the provisioning state. + public static ProvisioningState Upgrading { get; } = new ProvisioningState(UpgradingValue); + /// Deleting state of the provisioning state. + public static ProvisioningState Deleting { get; } = new ProvisioningState(DeletingValue); + /// 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/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/ProxyRequired.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/ProxyRequired.cs new file mode 100644 index 000000000000..532958a0683b --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/ProxyRequired.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + /// Proxy details enum. + public readonly partial struct ProxyRequired : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProxyRequired(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string RequiredValue = "Required"; + + /// Proxy is not required in setup. + public static ProxyRequired None { get; } = new ProxyRequired(NoneValue); + /// proxy is required in setup. + public static ProxyRequired Required { get; } = new ProxyRequired(RequiredValue); + /// Determines if two values are the same. + public static bool operator ==(ProxyRequired left, ProxyRequired right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProxyRequired left, ProxyRequired right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ProxyRequired(string value) => new ProxyRequired(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProxyRequired other && Equals(other); + /// + public bool Equals(ProxyRequired 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/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/ProxyUrlConfiguration.Serialization.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/ProxyUrlConfiguration.Serialization.cs new file mode 100644 index 000000000000..32c94ab7ff27 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/ProxyUrlConfiguration.Serialization.cs @@ -0,0 +1,129 @@ +// 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.ConnectedCache.Models +{ + internal partial class ProxyUrlConfiguration : 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(ProxyUrlConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ProxyUri)) + { + writer.WritePropertyName("proxyUrl"u8); + writer.WriteStringValue(ProxyUri); + } + 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 + } + } + } + + ProxyUrlConfiguration 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(ProxyUrlConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProxyUrlConfiguration(document.RootElement, options); + } + + internal static ProxyUrlConfiguration DeserializeProxyUrlConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string proxyUrl = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("proxyUrl"u8)) + { + proxyUrl = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProxyUrlConfiguration(proxyUrl, 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(ProxyUrlConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ProxyUrlConfiguration 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 DeserializeProxyUrlConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProxyUrlConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/ProxyUrlConfiguration.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/ProxyUrlConfiguration.cs new file mode 100644 index 000000000000..37dbb4ca99b3 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/Models/ProxyUrlConfiguration.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ConnectedCache.Models +{ + /// ProxyUrl configuration of cache node. + internal partial class ProxyUrlConfiguration + { + /// + /// 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 ProxyUrlConfiguration() + { + } + + /// Initializes a new instance of . + /// Host Proxy Address configuration along with port number. This can be a proxy or ip address. ex: xx.xx.xx.xxxx:80 or host name http://exampleproxy.com:80. + /// Keeps track of any properties unknown to the library. + internal ProxyUrlConfiguration(string proxyUri, IDictionary serializedAdditionalRawData) + { + ProxyUri = proxyUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Host Proxy Address configuration along with port number. This can be a proxy or ip address. ex: xx.xx.xx.xxxx:80 or host name http://exampleproxy.com:80. + public string ProxyUri { get; set; } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/ProviderConstants.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..11d8ddbe7a7e --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/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.ConnectedCache +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/RestOperations/EnterpriseMccCacheNodesRestOperations.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/RestOperations/EnterpriseMccCacheNodesRestOperations.cs new file mode 100644 index 000000000000..8dc4d876838c --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/RestOperations/EnterpriseMccCacheNodesRestOperations.cs @@ -0,0 +1,1029 @@ +// 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.ConnectedCache.Models; + +namespace Azure.ResourceManager.ConnectedCache +{ + internal partial class EnterpriseMccCacheNodesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of EnterpriseMccCacheNodesRestOperations. + /// 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 EnterpriseMccCacheNodesRestOperations(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-11-30-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + 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.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/enterpriseMccCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + 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.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/enterpriseMccCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This api gets ispCacheNode resource information. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// 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 customerResourceName, string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EnterpriseMccCacheNodeResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = EnterpriseMccCacheNodeResourceData.DeserializeEnterpriseMccCacheNodeResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EnterpriseMccCacheNodeResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api gets ispCacheNode resource information. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// 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 customerResourceName, string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EnterpriseMccCacheNodeResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = EnterpriseMccCacheNodeResourceData.DeserializeEnterpriseMccCacheNodeResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EnterpriseMccCacheNodeResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, EnterpriseMccCacheNodeResourceData 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.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/enterpriseMccCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, EnterpriseMccCacheNodeResourceData 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.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/enterpriseMccCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, 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; + } + + /// This api creates an ispCacheNode with the specified create parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// 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 CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, EnterpriseMccCacheNodeResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName, 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); + } + } + + /// This api creates an ispCacheNode with the specified create parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// 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 CreateOrUpdate(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, EnterpriseMccCacheNodeResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, ConnectedCachePatchContent 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.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/enterpriseMccCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, ConnectedCachePatchContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/enterpriseMccCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + 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; + } + + /// This api updates an existing ispCacheNode resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, ConnectedCachePatchContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EnterpriseMccCacheNodeResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = EnterpriseMccCacheNodeResourceData.DeserializeEnterpriseMccCacheNodeResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api updates an existing ispCacheNode resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, ConnectedCachePatchContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EnterpriseMccCacheNodeResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = EnterpriseMccCacheNodeResourceData.DeserializeEnterpriseMccCacheNodeResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + 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.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/enterpriseMccCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + 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.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/enterpriseMccCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This api deletes an existing ispCacheNode resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// 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 customerResourceName, string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api deletes an existing ispCacheNode resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// 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 customerResourceName, string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByEnterpriseMccCustomerResourceRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName) + { + 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.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/enterpriseMccCacheNodes", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByEnterpriseMccCustomerResourceRequest(string subscriptionId, string resourceGroupName, string customerResourceName) + { + 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.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/enterpriseMccCacheNodes", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This api retrieves information about all ispCacheNode resources under the given subscription and resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByEnterpriseMccCustomerResourceAsync(string subscriptionId, string resourceGroupName, string customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var message = CreateListByEnterpriseMccCustomerResourceRequest(subscriptionId, resourceGroupName, customerResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EnterpriseMccCacheNodeResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = EnterpriseMccCacheNodeResourceListResult.DeserializeEnterpriseMccCacheNodeResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api retrieves information about all ispCacheNode resources under the given subscription and resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByEnterpriseMccCustomerResource(string subscriptionId, string resourceGroupName, string customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var message = CreateListByEnterpriseMccCustomerResourceRequest(subscriptionId, resourceGroupName, customerResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EnterpriseMccCacheNodeResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = EnterpriseMccCacheNodeResourceListResult.DeserializeEnterpriseMccCacheNodeResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetCacheNodeInstallDetailsRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + 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.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/enterpriseMccCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendPath("/getCacheNodeInstallDetails", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetCacheNodeInstallDetailsRequest(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + 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.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/enterpriseMccCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendPath("/getCacheNodeInstallDetails", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This api gets secrets of the ispCacheNode resource install details. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetCacheNodeInstallDetailsAsync(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var message = CreateGetCacheNodeInstallDetailsRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MccCacheNodeInstallDetails value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MccCacheNodeInstallDetails.DeserializeMccCacheNodeInstallDetails(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api gets secrets of the ispCacheNode resource install details. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetCacheNodeInstallDetails(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var message = CreateGetCacheNodeInstallDetailsRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MccCacheNodeInstallDetails value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MccCacheNodeInstallDetails.DeserializeMccCacheNodeInstallDetails(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetCacheNodeAutoUpdateHistoryRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + 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.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/enterpriseMccCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendPath("/getCacheNodeAutoUpdateHistory", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetCacheNodeAutoUpdateHistoryRequest(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + 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.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/enterpriseMccCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendPath("/getCacheNodeAutoUpdateHistory", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This api gets ispCacheNode resource auto update histrory information. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetCacheNodeAutoUpdateHistoryAsync(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var message = CreateGetCacheNodeAutoUpdateHistoryRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MccCacheNodeAutoUpdateHistory value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MccCacheNodeAutoUpdateHistory.DeserializeMccCacheNodeAutoUpdateHistory(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api gets ispCacheNode resource auto update histrory information. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetCacheNodeAutoUpdateHistory(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var message = CreateGetCacheNodeAutoUpdateHistoryRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MccCacheNodeAutoUpdateHistory value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MccCacheNodeAutoUpdateHistory.DeserializeMccCacheNodeAutoUpdateHistory(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetCacheNodeMccIssueDetailsHistoryRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + 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.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/enterpriseMccCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendPath("/getCacheNodeMccIssueDetailsHistory", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetCacheNodeMccIssueDetailsHistoryRequest(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + 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.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/enterpriseMccCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendPath("/getCacheNodeMccIssueDetailsHistory", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This api gets ispCacheNode resource issues details histrory information. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetCacheNodeMccIssueDetailsHistoryAsync(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var message = CreateGetCacheNodeMccIssueDetailsHistoryRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MccCacheNodeIssueHistory value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MccCacheNodeIssueHistory.DeserializeMccCacheNodeIssueHistory(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api gets ispCacheNode resource issues details histrory information. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetCacheNodeMccIssueDetailsHistory(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var message = CreateGetCacheNodeMccIssueDetailsHistoryRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MccCacheNodeIssueHistory value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MccCacheNodeIssueHistory.DeserializeMccCacheNodeIssueHistory(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetCacheNodeTlsCertificateHistoryRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + 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.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/enterpriseMccCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendPath("/getCacheNodeTlsCertificateHistory", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetCacheNodeTlsCertificateHistoryRequest(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + 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.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/enterpriseMccCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendPath("/getCacheNodeTlsCertificateHistory", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This api gets ispCacheNode resource tls certificate histrory information. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetCacheNodeTlsCertificateHistoryAsync(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var message = CreateGetCacheNodeTlsCertificateHistoryRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MccCacheNodeTlsCertificateHistory value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MccCacheNodeTlsCertificateHistory.DeserializeMccCacheNodeTlsCertificateHistory(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api gets ispCacheNode resource tls certificate histrory information. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetCacheNodeTlsCertificateHistory(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var message = CreateGetCacheNodeTlsCertificateHistoryRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MccCacheNodeTlsCertificateHistory value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MccCacheNodeTlsCertificateHistory.DeserializeMccCacheNodeTlsCertificateHistory(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByEnterpriseMccCustomerResourceNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string customerResourceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByEnterpriseMccCustomerResourceNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string customerResourceName) + { + 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; + } + + /// This api retrieves information about all ispCacheNode resources under the given subscription and resource group. + /// 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. + /// Name of the Customer resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByEnterpriseMccCustomerResourceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var message = CreateListByEnterpriseMccCustomerResourceNextPageRequest(nextLink, subscriptionId, resourceGroupName, customerResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EnterpriseMccCacheNodeResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = EnterpriseMccCacheNodeResourceListResult.DeserializeEnterpriseMccCacheNodeResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api retrieves information about all ispCacheNode resources under the given subscription and resource group. + /// 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. + /// Name of the Customer resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByEnterpriseMccCustomerResourceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var message = CreateListByEnterpriseMccCustomerResourceNextPageRequest(nextLink, subscriptionId, resourceGroupName, customerResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EnterpriseMccCacheNodeResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = EnterpriseMccCacheNodeResourceListResult.DeserializeEnterpriseMccCacheNodeResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/RestOperations/EnterpriseMccCustomersRestOperations.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/RestOperations/EnterpriseMccCustomersRestOperations.cs new file mode 100644 index 000000000000..3cc8e1dbe499 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/RestOperations/EnterpriseMccCustomersRestOperations.cs @@ -0,0 +1,731 @@ +// 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.ConnectedCache.Models; + +namespace Azure.ResourceManager.ConnectedCache +{ + internal partial class EnterpriseMccCustomersRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of EnterpriseMccCustomersRestOperations. + /// 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 EnterpriseMccCustomersRestOperations(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-11-30-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName) + { + 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.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string customerResourceName) + { + 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.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the enterprise mcc customer resource information using this get call. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// 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 customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, customerResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EnterpriseMccCustomerResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = EnterpriseMccCustomerResourceData.DeserializeEnterpriseMccCustomerResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EnterpriseMccCustomerResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the enterprise mcc customer resource information using this get call. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// 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 customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, customerResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EnterpriseMccCustomerResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = EnterpriseMccCustomerResourceData.DeserializeEnterpriseMccCustomerResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EnterpriseMccCustomerResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName, EnterpriseMccCustomerResourceData 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.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string customerResourceName, EnterpriseMccCustomerResourceData 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.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, 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; + } + + /// This api creates an enterprise mcc customer with the specified create parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// 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 CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string customerResourceName, EnterpriseMccCustomerResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, customerResourceName, 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); + } + } + + /// This api creates an enterprise mcc customer with the specified create parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// 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 CreateOrUpdate(string subscriptionId, string resourceGroupName, string customerResourceName, EnterpriseMccCustomerResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, customerResourceName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName, ConnectedCachePatchContent 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.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string customerResourceName, ConnectedCachePatchContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + 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; + } + + /// This api updates an existing enterprise mcc customer resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string customerResourceName, ConnectedCachePatchContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, customerResourceName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EnterpriseMccCustomerResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = EnterpriseMccCustomerResourceData.DeserializeEnterpriseMccCustomerResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api updates an existing enterprise mcc customer resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string customerResourceName, ConnectedCachePatchContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, customerResourceName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EnterpriseMccCustomerResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = EnterpriseMccCustomerResourceData.DeserializeEnterpriseMccCustomerResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName) + { + 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.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string customerResourceName) + { + 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.ConnectedCache/enterpriseMccCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This api deletes an existing enterprise mcc customer resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// 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 customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, customerResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api deletes an existing enterprise mcc customer resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// 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 customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, customerResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ConnectedCache/enterpriseMccCustomers", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ConnectedCache/enterpriseMccCustomers", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This api gets the information about all enterprise mcc customer resources under the given subscription and resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EnterpriseMccCustomerResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = EnterpriseMccCustomerResourceListResult.DeserializeEnterpriseMccCustomerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api gets the information about all enterprise mcc customer resources under the given subscription and resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EnterpriseMccCustomerResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = EnterpriseMccCustomerResourceListResult.DeserializeEnterpriseMccCustomerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ConnectedCache/enterpriseMccCustomers", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ConnectedCache/enterpriseMccCustomers", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This api gets information about all enterpriseMccCustomer resources under the given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EnterpriseMccCustomerResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = EnterpriseMccCustomerResourceListResult.DeserializeEnterpriseMccCustomerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api gets information about all enterpriseMccCustomer resources under the given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EnterpriseMccCustomerResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = EnterpriseMccCustomerResourceListResult.DeserializeEnterpriseMccCustomerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This api gets the information about all enterprise mcc customer resources under the given subscription and resource group. + /// 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. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EnterpriseMccCustomerResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = EnterpriseMccCustomerResourceListResult.DeserializeEnterpriseMccCustomerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api gets the information about all enterprise mcc customer resources under the given subscription and resource group. + /// 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. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EnterpriseMccCustomerResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = EnterpriseMccCustomerResourceListResult.DeserializeEnterpriseMccCustomerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This api gets information about all enterpriseMccCustomer resources under the given subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EnterpriseMccCustomerResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = EnterpriseMccCustomerResourceListResult.DeserializeEnterpriseMccCustomerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api gets information about all enterpriseMccCustomer resources under the given subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EnterpriseMccCustomerResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = EnterpriseMccCustomerResourceListResult.DeserializeEnterpriseMccCustomerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/RestOperations/IspCacheNodesRestOperations.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/RestOperations/IspCacheNodesRestOperations.cs new file mode 100644 index 000000000000..7ab84bbdbbc9 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/RestOperations/IspCacheNodesRestOperations.cs @@ -0,0 +1,1029 @@ +// 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.ConnectedCache.Models; + +namespace Azure.ResourceManager.ConnectedCache +{ + internal partial class IspCacheNodesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of IspCacheNodesRestOperations. + /// 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 IspCacheNodesRestOperations(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-11-30-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + 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.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/ispCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + 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.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/ispCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This api gets ispCacheNode resource information. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// 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 customerResourceName, string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IspCacheNodeResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = IspCacheNodeResourceData.DeserializeIspCacheNodeResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((IspCacheNodeResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api gets ispCacheNode resource information. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// 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 customerResourceName, string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IspCacheNodeResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = IspCacheNodeResourceData.DeserializeIspCacheNodeResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((IspCacheNodeResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, IspCacheNodeResourceData 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.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/ispCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, IspCacheNodeResourceData 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.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/ispCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, 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; + } + + /// This api creates an ispCacheNode with the specified create parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// 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 CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, IspCacheNodeResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName, 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); + } + } + + /// This api creates an ispCacheNode with the specified create parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// 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 CreateOrUpdate(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, IspCacheNodeResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, ConnectedCachePatchContent 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.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/ispCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, ConnectedCachePatchContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/ispCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + 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; + } + + /// This api updates an existing ispCacheNode resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, ConnectedCachePatchContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IspCacheNodeResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = IspCacheNodeResourceData.DeserializeIspCacheNodeResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api updates an existing ispCacheNode resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, ConnectedCachePatchContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IspCacheNodeResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = IspCacheNodeResourceData.DeserializeIspCacheNodeResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + 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.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/ispCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + 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.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/ispCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This api deletes an existing ispCacheNode resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// 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 customerResourceName, string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api deletes an existing ispCacheNode resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// 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 customerResourceName, string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByIspCustomerResourceRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName) + { + 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.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/ispCacheNodes", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByIspCustomerResourceRequest(string subscriptionId, string resourceGroupName, string customerResourceName) + { + 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.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/ispCacheNodes", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This api retrieves information about all ispCacheNode resources under the given subscription and resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByIspCustomerResourceAsync(string subscriptionId, string resourceGroupName, string customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var message = CreateListByIspCustomerResourceRequest(subscriptionId, resourceGroupName, customerResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IspCacheNodeResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = IspCacheNodeResourceListResult.DeserializeIspCacheNodeResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api retrieves information about all ispCacheNode resources under the given subscription and resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByIspCustomerResource(string subscriptionId, string resourceGroupName, string customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var message = CreateListByIspCustomerResourceRequest(subscriptionId, resourceGroupName, customerResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IspCacheNodeResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = IspCacheNodeResourceListResult.DeserializeIspCacheNodeResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetBgpCidrsRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + 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.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/ispCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendPath("/getBgpCidrs", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetBgpCidrsRequest(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + 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.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/ispCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendPath("/getBgpCidrs", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This api gets ispCacheNode resource information. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetBgpCidrsAsync(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var message = CreateGetBgpCidrsRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MccCacheNodeBgpCidrDetails value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MccCacheNodeBgpCidrDetails.DeserializeMccCacheNodeBgpCidrDetails(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api gets ispCacheNode resource information. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetBgpCidrs(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var message = CreateGetBgpCidrsRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MccCacheNodeBgpCidrDetails value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MccCacheNodeBgpCidrDetails.DeserializeMccCacheNodeBgpCidrDetails(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetCacheNodeInstallDetailsRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + 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.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/ispCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendPath("/getCacheNodeInstallDetails", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetCacheNodeInstallDetailsRequest(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + 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.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/ispCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendPath("/getCacheNodeInstallDetails", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This api gets secrets of the ispCacheNode resource install details. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetCacheNodeInstallDetailsAsync(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var message = CreateGetCacheNodeInstallDetailsRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MccCacheNodeInstallDetails value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MccCacheNodeInstallDetails.DeserializeMccCacheNodeInstallDetails(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api gets secrets of the ispCacheNode resource install details. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetCacheNodeInstallDetails(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var message = CreateGetCacheNodeInstallDetailsRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MccCacheNodeInstallDetails value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MccCacheNodeInstallDetails.DeserializeMccCacheNodeInstallDetails(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetCacheNodeAutoUpdateHistoryRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + 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.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/ispCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendPath("/getCacheNodeAutoUpdateHistory", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetCacheNodeAutoUpdateHistoryRequest(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + 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.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/ispCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendPath("/getCacheNodeAutoUpdateHistory", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This api gets ispCacheNode resource auto update histrory information. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetCacheNodeAutoUpdateHistoryAsync(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var message = CreateGetCacheNodeAutoUpdateHistoryRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MccCacheNodeAutoUpdateHistory value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MccCacheNodeAutoUpdateHistory.DeserializeMccCacheNodeAutoUpdateHistory(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api gets ispCacheNode resource auto update histrory information. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetCacheNodeAutoUpdateHistory(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var message = CreateGetCacheNodeAutoUpdateHistoryRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MccCacheNodeAutoUpdateHistory value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MccCacheNodeAutoUpdateHistory.DeserializeMccCacheNodeAutoUpdateHistory(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetCacheNodeMccIssueDetailsHistoryRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + 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.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/ispCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendPath("/getCacheNodeMccIssueDetailsHistory", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetCacheNodeMccIssueDetailsHistoryRequest(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName) + { + 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.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendPath("/ispCacheNodes/", false); + uri.AppendPath(cacheNodeResourceName, true); + uri.AppendPath("/getCacheNodeMccIssueDetailsHistory", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This api gets ispCacheNode resource issues details histrory information. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetCacheNodeMccIssueDetailsHistoryAsync(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var message = CreateGetCacheNodeMccIssueDetailsHistoryRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MccCacheNodeIssueHistory value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MccCacheNodeIssueHistory.DeserializeMccCacheNodeIssueHistory(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api gets ispCacheNode resource issues details histrory information. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// Name of the ConnectedCache resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetCacheNodeMccIssueDetailsHistory(string subscriptionId, string resourceGroupName, string customerResourceName, string cacheNodeResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNullOrEmpty(cacheNodeResourceName, nameof(cacheNodeResourceName)); + + using var message = CreateGetCacheNodeMccIssueDetailsHistoryRequest(subscriptionId, resourceGroupName, customerResourceName, cacheNodeResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MccCacheNodeIssueHistory value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MccCacheNodeIssueHistory.DeserializeMccCacheNodeIssueHistory(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByIspCustomerResourceNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string customerResourceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByIspCustomerResourceNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string customerResourceName) + { + 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; + } + + /// This api retrieves information about all ispCacheNode resources under the given subscription and resource group. + /// 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. + /// Name of the Customer resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByIspCustomerResourceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var message = CreateListByIspCustomerResourceNextPageRequest(nextLink, subscriptionId, resourceGroupName, customerResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IspCacheNodeResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = IspCacheNodeResourceListResult.DeserializeIspCacheNodeResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api retrieves information about all ispCacheNode resources under the given subscription and resource group. + /// 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. + /// Name of the Customer resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByIspCustomerResourceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var message = CreateListByIspCustomerResourceNextPageRequest(nextLink, subscriptionId, resourceGroupName, customerResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IspCacheNodeResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = IspCacheNodeResourceListResult.DeserializeIspCacheNodeResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/RestOperations/IspCustomersRestOperations.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/RestOperations/IspCustomersRestOperations.cs new file mode 100644 index 000000000000..7bac86418384 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Generated/RestOperations/IspCustomersRestOperations.cs @@ -0,0 +1,731 @@ +// 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.ConnectedCache.Models; + +namespace Azure.ResourceManager.ConnectedCache +{ + internal partial class IspCustomersRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of IspCustomersRestOperations. + /// 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 IspCustomersRestOperations(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-11-30-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName) + { + 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.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string customerResourceName) + { + 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.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the ispCustomer resource information using this get call. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// 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 customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, customerResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IspCustomerResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = IspCustomerResourceData.DeserializeIspCustomerResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((IspCustomerResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the ispCustomer resource information using this get call. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// 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 customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, customerResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IspCustomerResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = IspCustomerResourceData.DeserializeIspCustomerResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((IspCustomerResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName, IspCustomerResourceData 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.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string customerResourceName, IspCustomerResourceData 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.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, 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; + } + + /// This api creates an ispCustomer with the specified create parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// 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 CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string customerResourceName, IspCustomerResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, customerResourceName, 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); + } + } + + /// This api creates an ispCustomer with the specified create parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// 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 CreateOrUpdate(string subscriptionId, string resourceGroupName, string customerResourceName, IspCustomerResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, customerResourceName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName, ConnectedCachePatchContent 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.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string customerResourceName, ConnectedCachePatchContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + 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; + } + + /// This api updates an existing ispCustomer resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string customerResourceName, ConnectedCachePatchContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, customerResourceName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IspCustomerResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = IspCustomerResourceData.DeserializeIspCustomerResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api updates an existing ispCustomer resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string customerResourceName, ConnectedCachePatchContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, customerResourceName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IspCustomerResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = IspCustomerResourceData.DeserializeIspCustomerResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string customerResourceName) + { + 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.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string customerResourceName) + { + 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.ConnectedCache/ispCustomers/", false); + uri.AppendPath(customerResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This api deletes an existing ispCustomer resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// 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 customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, customerResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api deletes an existing ispCustomer resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Customer resource. + /// 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 customerResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(customerResourceName, nameof(customerResourceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, customerResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ConnectedCache/ispCustomers", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ConnectedCache/ispCustomers", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This api gets the information about all ispCustomer resources under the given subscription and resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IspCustomerResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = IspCustomerResourceListResult.DeserializeIspCustomerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api gets the information about all ispCustomer resources under the given subscription and resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IspCustomerResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = IspCustomerResourceListResult.DeserializeIspCustomerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ConnectedCache/ispCustomers", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ConnectedCache/ispCustomers", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This api gets information about all ispCustomer resources under the given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IspCustomerResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = IspCustomerResourceListResult.DeserializeIspCustomerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api gets information about all ispCustomer resources under the given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IspCustomerResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = IspCustomerResourceListResult.DeserializeIspCustomerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This api gets the information about all ispCustomer resources under the given subscription and resource group. + /// 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. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IspCustomerResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = IspCustomerResourceListResult.DeserializeIspCustomerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api gets the information about all ispCustomer resources under the given subscription and resource group. + /// 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. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IspCustomerResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = IspCustomerResourceListResult.DeserializeIspCustomerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This api gets information about all ispCustomer resources under the given subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IspCustomerResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = IspCustomerResourceListResult.DeserializeIspCustomerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// This api gets information about all ispCustomer resources under the given subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IspCustomerResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = IspCustomerResourceListResult.DeserializeIspCustomerResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Properties/AssemblyInfo.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..890b0829b64f --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/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.ConnectedCache.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("ConnectedCache")] diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/tests/Azure.ResourceManager.ConnectedCache.Tests.csproj b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/tests/Azure.ResourceManager.ConnectedCache.Tests.csproj new file mode 100644 index 000000000000..e459d3ce7a99 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/tests/Azure.ResourceManager.ConnectedCache.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/tests/ConnectedCacheManagementTestBase.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/tests/ConnectedCacheManagementTestBase.cs new file mode 100644 index 000000000000..9bc4379dd086 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/tests/ConnectedCacheManagementTestBase.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.ConnectedCache.Tests +{ + public class ConnectedCacheManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected ConnectedCacheManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected ConnectedCacheManagementTestBase(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/connectedcache/Azure.ResourceManager.ConnectedCache/tests/ConnectedCacheManagementTestEnvironment.cs b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/tests/ConnectedCacheManagementTestEnvironment.cs new file mode 100644 index 000000000000..2ec1369bfc8c --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/tests/ConnectedCacheManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.ConnectedCache.Tests +{ + public class ConnectedCacheManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/tsp-location.yaml b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/tsp-location.yaml new file mode 100644 index 000000000000..f0d880aeeed5 --- /dev/null +++ b/sdk/connectedcache/Azure.ResourceManager.ConnectedCache/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/connectedcache/ConnectedCache.Management +commit: bd63bf3710616fd0dc1d883b0760899ca7f9babd +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/connectedcache/ci.mgmt.yml b/sdk/connectedcache/ci.mgmt.yml new file mode 100644 index 000000000000..49db3909b601 --- /dev/null +++ b/sdk/connectedcache/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/connectedcache /ci.mgmt.yml + - sdk/connectedcache /Azure.ResourceManager.ConnectedCache / + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: connectedcache + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.ConnectedCache + safeName: AzureResourceManagerConnectedCache diff --git a/sdk/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml index 9ae0a7e75290..a92dfe532899 100644 --- a/sdk/resourcemanager/ci.mgmt.yml +++ b/sdk/resourcemanager/ci.mgmt.yml @@ -47,6 +47,7 @@ trigger: - sdk/computeschedule/Azure.ResourceManager.ComputeSchedule - sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger - sdk/confluent/Azure.ResourceManager.Confluent + - sdk/connectedcache/Azure.ResourceManager.ConnectedCache - sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere - sdk/consumption/Azure.ResourceManager.Consumption - sdk/containerapps/Azure.ResourceManager.AppContainers @@ -263,6 +264,7 @@ pr: - sdk/computeschedule/Azure.ResourceManager.ComputeSchedule - sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger - sdk/confluent/Azure.ResourceManager.Confluent + - sdk/connectedcache/Azure.ResourceManager.ConnectedCache - sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere - sdk/consumption/Azure.ResourceManager.Consumption - sdk/containerapps/Azure.ResourceManager.AppContainers diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 2ca0501b60bd..4e749e6b85b1 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -12,6 +12,8 @@ trigger: - sdk/storage/Azure.Storage.DataMovement/ - sdk/storage/Azure.Storage.DataMovement.Blobs/ - 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/