diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/Azure.ResourceManager.Hybridkubernetes.sln b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/Azure.ResourceManager.Hybridkubernetes.sln new file mode 100644 index 000000000000..5774053d393e --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/Azure.ResourceManager.Hybridkubernetes.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.Hybridkubernetes.Samples", "samples\Azure.ResourceManager.Hybridkubernetes.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.Hybridkubernetes", "src\Azure.ResourceManager.Hybridkubernetes.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.Hybridkubernetes.Tests", "tests\Azure.ResourceManager.Hybridkubernetes.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/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/CHANGELOG.md b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/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/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/Directory.Build.props b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/README.md b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/README.md new file mode 100644 index 000000000000..8a1d22778be5 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure Hybridkubernetes 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 Hybridkubernetes management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.Hybridkubernetes --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/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/api/Azure.ResourceManager.Hybridkubernetes.net8.0.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/api/Azure.ResourceManager.Hybridkubernetes.net8.0.cs new file mode 100644 index 000000000000..396e723eb5b1 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/api/Azure.ResourceManager.Hybridkubernetes.net8.0.cs @@ -0,0 +1,427 @@ +namespace Azure.ResourceManager.Hybridkubernetes +{ + public partial class AzureResourceManagerHybridkubernetesContext : System.ClientModel.Primitives.ModelReaderWriterContext + { + internal AzureResourceManagerHybridkubernetesContext() { } + public static Azure.ResourceManager.Hybridkubernetes.AzureResourceManagerHybridkubernetesContext Default { get { throw null; } } + protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; } + } + public partial class ConnectedClusterCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ConnectedClusterCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string clusterName, Azure.ResourceManager.Hybridkubernetes.ConnectedClusterData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string clusterName, Azure.ResourceManager.Hybridkubernetes.ConnectedClusterData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string clusterName, 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 clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string clusterName, 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 ConnectedClusterData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedClusterData(Azure.Core.AzureLocation location, Azure.ResourceManager.Models.ManagedServiceIdentity identity, string agentPublicKeyCertificate) { } + public Azure.ResourceManager.Hybridkubernetes.Models.AadProfile AadProfile { get { throw null; } set { } } + public string AgentPublicKeyCertificate { get { throw null; } set { } } + public string AgentVersion { get { throw null; } } + public Azure.ResourceManager.Hybridkubernetes.Models.ArcAgentProfile ArcAgentProfile { get { throw null; } set { } } + public System.Collections.Generic.IList ArcAgentryConfigurations { get { throw null; } set { } } + public Azure.ResourceManager.Hybridkubernetes.Models.AzureHybridBenefit? AzureHybridBenefit { get { throw null; } set { } } + public Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus? ConnectivityStatus { get { throw null; } } + public string Distribution { get { throw null; } set { } } + public string DistributionVersion { get { throw null; } set { } } + public Azure.ResourceManager.Hybridkubernetes.Models.Gateway Gateway { get { throw null; } set { } } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public string Infrastructure { get { throw null; } set { } } + public Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterKind? Kind { get { throw null; } set { } } + public string KubernetesVersion { get { throw null; } } + public System.DateTimeOffset? LastConnectivityOn { get { throw null; } } + public System.DateTimeOffset? ManagedIdentityCertificateExpirationOn { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary MiscellaneousProperties { get { throw null; } } + public string Offering { get { throw null; } } + public Azure.ResourceManager.Hybridkubernetes.Models.OidcIssuerProfile OidcIssuerProfile { get { throw null; } set { } } + public string PrivateLinkScopeResourceId { get { throw null; } set { } } + public Azure.ResourceManager.Hybridkubernetes.Models.PrivateLinkState? PrivateLinkState { get { throw null; } set { } } + public Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState? ProvisioningState { get { throw null; } set { } } + public int? TotalCoreCount { get { throw null; } } + public int? TotalNodeCount { get { throw null; } } + public bool? WorkloadIdentityEnabled { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.ConnectedClusterData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.ConnectedClusterData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 ConnectedClusterResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ConnectedClusterResource() { } + public virtual Azure.ResourceManager.Hybridkubernetes.ConnectedClusterData 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 clusterName) { 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 GetClusterUserCredential(Azure.ResourceManager.Hybridkubernetes.Models.ListClusterUserCredentialProperties properties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetClusterUserCredentialAsync(Azure.ResourceManager.Hybridkubernetes.Models.ListClusterUserCredentialProperties properties, 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.Hybridkubernetes.ConnectedClusterData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.ConnectedClusterData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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.Hybridkubernetes.Models.ConnectedClusterPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class HybridkubernetesExtensions + { + public static Azure.Response GetConnectedCluster(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetConnectedClusterAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.ConnectedClusterResource GetConnectedClusterResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.ConnectedClusterCollection GetConnectedClusters(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetConnectedClusters(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetConnectedClustersAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.Hybridkubernetes.Mocking +{ + public partial class MockableHybridkubernetesArmClient : Azure.ResourceManager.ArmResource + { + protected MockableHybridkubernetesArmClient() { } + public virtual Azure.ResourceManager.Hybridkubernetes.ConnectedClusterResource GetConnectedClusterResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableHybridkubernetesResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableHybridkubernetesResourceGroupResource() { } + public virtual Azure.Response GetConnectedCluster(string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetConnectedClusterAsync(string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Hybridkubernetes.ConnectedClusterCollection GetConnectedClusters() { throw null; } + } + public partial class MockableHybridkubernetesSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableHybridkubernetesSubscriptionResource() { } + public virtual Azure.Pageable GetConnectedClusters(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetConnectedClustersAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.Hybridkubernetes.Models +{ + public partial class AadProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AadProfile() { } + public System.Collections.Generic.IList AdminGroupObjectIds { get { throw null; } } + public bool? EnableAzureRBAC { get { throw null; } set { } } + public string TenantId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.AadProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.AadProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 AgentError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AgentError() { } + public string Component { get { throw null; } } + public string Message { get { throw null; } } + public string Severity { get { throw null; } } + public System.DateTimeOffset? Time { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.AgentError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.AgentError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 ArcAgentProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ArcAgentProfile() { } + public Azure.ResourceManager.Hybridkubernetes.Models.AutoUpgradeOption? AgentAutoUpgrade { get { throw null; } set { } } + public System.Collections.Generic.IList AgentErrors { get { throw null; } } + public string AgentState { get { throw null; } } + public string DesiredAgentVersion { get { throw null; } set { } } + public System.Collections.Generic.IList SystemComponents { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.ArcAgentProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.ArcAgentProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 ArcAgentryConfigurations : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ArcAgentryConfigurations() { } + public string Feature { get { throw null; } set { } } + public System.Collections.Generic.IDictionary ProtectedSettings { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Settings { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.ArcAgentryConfigurations System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.ArcAgentryConfigurations System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 ArmHybridkubernetesModelFactory + { + public static Azure.ResourceManager.Hybridkubernetes.Models.AgentError AgentError(string message = null, string severity = null, string component = null, System.DateTimeOffset? time = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.Models.ArcAgentProfile ArcAgentProfile(string desiredAgentVersion = null, Azure.ResourceManager.Hybridkubernetes.Models.AutoUpgradeOption? agentAutoUpgrade = default(Azure.ResourceManager.Hybridkubernetes.Models.AutoUpgradeOption?), System.Collections.Generic.IEnumerable systemComponents = null, System.Collections.Generic.IEnumerable agentErrors = null, string agentState = null) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.ConnectedClusterData ConnectedClusterData(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.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterKind? kind = default(Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterKind?), string agentPublicKeyCertificate = null, string kubernetesVersion = null, int? totalNodeCount = default(int?), int? totalCoreCount = default(int?), string agentVersion = null, Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState?), string distribution = null, string distributionVersion = null, string infrastructure = null, string offering = null, System.DateTimeOffset? managedIdentityCertificateExpirationOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastConnectivityOn = default(System.DateTimeOffset?), Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus? connectivityStatus = default(Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus?), Azure.ResourceManager.Hybridkubernetes.Models.PrivateLinkState? privateLinkState = default(Azure.ResourceManager.Hybridkubernetes.Models.PrivateLinkState?), string privateLinkScopeResourceId = null, Azure.ResourceManager.Hybridkubernetes.Models.AzureHybridBenefit? azureHybridBenefit = default(Azure.ResourceManager.Hybridkubernetes.Models.AzureHybridBenefit?), Azure.ResourceManager.Hybridkubernetes.Models.AadProfile aadProfile = null, Azure.ResourceManager.Hybridkubernetes.Models.ArcAgentProfile arcAgentProfile = null, bool? workloadIdentityEnabled = default(bool?), Azure.ResourceManager.Hybridkubernetes.Models.OidcIssuerProfile oidcIssuerProfile = null, Azure.ResourceManager.Hybridkubernetes.Models.Gateway gateway = null, System.Collections.Generic.IEnumerable arcAgentryConfigurations = null, System.Collections.Generic.IReadOnlyDictionary miscellaneousProperties = null) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.Models.CredentialResult CredentialResult(string name = null, byte[] value = null) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.Models.CredentialResults CredentialResults(Azure.ResourceManager.Hybridkubernetes.Models.HybridConnectionConfig hybridConnectionConfig = null, System.Collections.Generic.IEnumerable kubeconfigs = null) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.Models.HybridConnectionConfig HybridConnectionConfig(long? expirationTime = default(long?), string hybridConnectionName = null, string relay = null, string token = null, string relayTid = null, string relayType = null) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.Models.OidcIssuerProfile OidcIssuerProfile(bool? enabled = default(bool?), string issuerUri = null, string selfHostedIssuerUri = null) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.Models.SystemComponent SystemComponent(string type = null, string userSpecifiedVersion = null, int? majorVersion = default(int?), string currentVersion = null) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AuthenticationMethod : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AuthenticationMethod(string value) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.Models.AuthenticationMethod AAD { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.AuthenticationMethod Token { get { throw null; } } + public bool Equals(Azure.ResourceManager.Hybridkubernetes.Models.AuthenticationMethod 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.Hybridkubernetes.Models.AuthenticationMethod left, Azure.ResourceManager.Hybridkubernetes.Models.AuthenticationMethod right) { throw null; } + public static implicit operator Azure.ResourceManager.Hybridkubernetes.Models.AuthenticationMethod (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Hybridkubernetes.Models.AuthenticationMethod left, Azure.ResourceManager.Hybridkubernetes.Models.AuthenticationMethod right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AutoUpgradeOption : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AutoUpgradeOption(string value) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.Models.AutoUpgradeOption Disabled { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.AutoUpgradeOption Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.Hybridkubernetes.Models.AutoUpgradeOption 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.Hybridkubernetes.Models.AutoUpgradeOption left, Azure.ResourceManager.Hybridkubernetes.Models.AutoUpgradeOption right) { throw null; } + public static implicit operator Azure.ResourceManager.Hybridkubernetes.Models.AutoUpgradeOption (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Hybridkubernetes.Models.AutoUpgradeOption left, Azure.ResourceManager.Hybridkubernetes.Models.AutoUpgradeOption right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureHybridBenefit : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureHybridBenefit(string value) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.Models.AzureHybridBenefit False { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.AzureHybridBenefit NotApplicable { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.AzureHybridBenefit True { get { throw null; } } + public bool Equals(Azure.ResourceManager.Hybridkubernetes.Models.AzureHybridBenefit 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.Hybridkubernetes.Models.AzureHybridBenefit left, Azure.ResourceManager.Hybridkubernetes.Models.AzureHybridBenefit right) { throw null; } + public static implicit operator Azure.ResourceManager.Hybridkubernetes.Models.AzureHybridBenefit (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Hybridkubernetes.Models.AzureHybridBenefit left, Azure.ResourceManager.Hybridkubernetes.Models.AzureHybridBenefit right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ConnectedClusterKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectedClusterKind(string value) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterKind AWS { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterKind ProvisionedCluster { get { throw null; } } + public bool Equals(Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterKind 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.Hybridkubernetes.Models.ConnectedClusterKind left, Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterKind right) { throw null; } + public static implicit operator Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterKind (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterKind left, Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterKind right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ConnectedClusterPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedClusterPatch() { } + public Azure.ResourceManager.Hybridkubernetes.Models.AzureHybridBenefit? AzureHybridBenefit { get { throw null; } set { } } + public string Distribution { get { throw null; } set { } } + public string DistributionVersion { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 ConnectivityStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectivityStatus(string value) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus AgentNotInstalled { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus Connected { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus Connecting { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus Expired { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus Offline { get { throw null; } } + public bool Equals(Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus 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.Hybridkubernetes.Models.ConnectivityStatus left, Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus left, Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CredentialResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CredentialResult() { } + public string Name { get { throw null; } } + public byte[] Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.CredentialResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.CredentialResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 CredentialResults : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CredentialResults() { } + public Azure.ResourceManager.Hybridkubernetes.Models.HybridConnectionConfig HybridConnectionConfig { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Kubeconfigs { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.CredentialResults System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.CredentialResults System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 Gateway : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Gateway() { } + public bool? Enabled { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.Gateway System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.Gateway System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 HybridConnectionConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HybridConnectionConfig() { } + public long? ExpirationTime { get { throw null; } } + public string HybridConnectionName { get { throw null; } } + public string Relay { get { throw null; } } + public string RelayTid { get { throw null; } } + public string RelayType { get { throw null; } } + public string Token { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.HybridConnectionConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.HybridConnectionConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 ListClusterUserCredentialProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ListClusterUserCredentialProperties(Azure.ResourceManager.Hybridkubernetes.Models.AuthenticationMethod authenticationMethod, bool clientProxy) { } + public Azure.ResourceManager.Hybridkubernetes.Models.AuthenticationMethod AuthenticationMethod { get { throw null; } } + public bool ClientProxy { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.ListClusterUserCredentialProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.ListClusterUserCredentialProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 OidcIssuerProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OidcIssuerProfile() { } + public bool? Enabled { get { throw null; } set { } } + public string IssuerUri { get { throw null; } } + public string SelfHostedIssuerUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.OidcIssuerProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.OidcIssuerProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 PrivateLinkState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PrivateLinkState(string value) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.Models.PrivateLinkState Disabled { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.PrivateLinkState Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.Hybridkubernetes.Models.PrivateLinkState 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.Hybridkubernetes.Models.PrivateLinkState left, Azure.ResourceManager.Hybridkubernetes.Models.PrivateLinkState right) { throw null; } + public static implicit operator Azure.ResourceManager.Hybridkubernetes.Models.PrivateLinkState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Hybridkubernetes.Models.PrivateLinkState left, Azure.ResourceManager.Hybridkubernetes.Models.PrivateLinkState 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.Hybridkubernetes.Models.ProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.Hybridkubernetes.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.Hybridkubernetes.Models.ProvisioningState left, Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState left, Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SystemComponent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SystemComponent() { } + public string CurrentVersion { get { throw null; } } + public int? MajorVersion { get { throw null; } set { } } + public string Type { get { throw null; } set { } } + public string UserSpecifiedVersion { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.SystemComponent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.SystemComponent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/api/Azure.ResourceManager.Hybridkubernetes.netstandard2.0.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/api/Azure.ResourceManager.Hybridkubernetes.netstandard2.0.cs new file mode 100644 index 000000000000..396e723eb5b1 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/api/Azure.ResourceManager.Hybridkubernetes.netstandard2.0.cs @@ -0,0 +1,427 @@ +namespace Azure.ResourceManager.Hybridkubernetes +{ + public partial class AzureResourceManagerHybridkubernetesContext : System.ClientModel.Primitives.ModelReaderWriterContext + { + internal AzureResourceManagerHybridkubernetesContext() { } + public static Azure.ResourceManager.Hybridkubernetes.AzureResourceManagerHybridkubernetesContext Default { get { throw null; } } + protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; } + } + public partial class ConnectedClusterCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ConnectedClusterCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string clusterName, Azure.ResourceManager.Hybridkubernetes.ConnectedClusterData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string clusterName, Azure.ResourceManager.Hybridkubernetes.ConnectedClusterData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string clusterName, 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 clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string clusterName, 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 ConnectedClusterData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedClusterData(Azure.Core.AzureLocation location, Azure.ResourceManager.Models.ManagedServiceIdentity identity, string agentPublicKeyCertificate) { } + public Azure.ResourceManager.Hybridkubernetes.Models.AadProfile AadProfile { get { throw null; } set { } } + public string AgentPublicKeyCertificate { get { throw null; } set { } } + public string AgentVersion { get { throw null; } } + public Azure.ResourceManager.Hybridkubernetes.Models.ArcAgentProfile ArcAgentProfile { get { throw null; } set { } } + public System.Collections.Generic.IList ArcAgentryConfigurations { get { throw null; } set { } } + public Azure.ResourceManager.Hybridkubernetes.Models.AzureHybridBenefit? AzureHybridBenefit { get { throw null; } set { } } + public Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus? ConnectivityStatus { get { throw null; } } + public string Distribution { get { throw null; } set { } } + public string DistributionVersion { get { throw null; } set { } } + public Azure.ResourceManager.Hybridkubernetes.Models.Gateway Gateway { get { throw null; } set { } } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public string Infrastructure { get { throw null; } set { } } + public Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterKind? Kind { get { throw null; } set { } } + public string KubernetesVersion { get { throw null; } } + public System.DateTimeOffset? LastConnectivityOn { get { throw null; } } + public System.DateTimeOffset? ManagedIdentityCertificateExpirationOn { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary MiscellaneousProperties { get { throw null; } } + public string Offering { get { throw null; } } + public Azure.ResourceManager.Hybridkubernetes.Models.OidcIssuerProfile OidcIssuerProfile { get { throw null; } set { } } + public string PrivateLinkScopeResourceId { get { throw null; } set { } } + public Azure.ResourceManager.Hybridkubernetes.Models.PrivateLinkState? PrivateLinkState { get { throw null; } set { } } + public Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState? ProvisioningState { get { throw null; } set { } } + public int? TotalCoreCount { get { throw null; } } + public int? TotalNodeCount { get { throw null; } } + public bool? WorkloadIdentityEnabled { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.ConnectedClusterData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.ConnectedClusterData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 ConnectedClusterResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ConnectedClusterResource() { } + public virtual Azure.ResourceManager.Hybridkubernetes.ConnectedClusterData 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 clusterName) { 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 GetClusterUserCredential(Azure.ResourceManager.Hybridkubernetes.Models.ListClusterUserCredentialProperties properties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetClusterUserCredentialAsync(Azure.ResourceManager.Hybridkubernetes.Models.ListClusterUserCredentialProperties properties, 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.Hybridkubernetes.ConnectedClusterData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.ConnectedClusterData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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.Hybridkubernetes.Models.ConnectedClusterPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class HybridkubernetesExtensions + { + public static Azure.Response GetConnectedCluster(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetConnectedClusterAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.ConnectedClusterResource GetConnectedClusterResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.ConnectedClusterCollection GetConnectedClusters(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetConnectedClusters(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetConnectedClustersAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.Hybridkubernetes.Mocking +{ + public partial class MockableHybridkubernetesArmClient : Azure.ResourceManager.ArmResource + { + protected MockableHybridkubernetesArmClient() { } + public virtual Azure.ResourceManager.Hybridkubernetes.ConnectedClusterResource GetConnectedClusterResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableHybridkubernetesResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableHybridkubernetesResourceGroupResource() { } + public virtual Azure.Response GetConnectedCluster(string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetConnectedClusterAsync(string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Hybridkubernetes.ConnectedClusterCollection GetConnectedClusters() { throw null; } + } + public partial class MockableHybridkubernetesSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableHybridkubernetesSubscriptionResource() { } + public virtual Azure.Pageable GetConnectedClusters(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetConnectedClustersAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.Hybridkubernetes.Models +{ + public partial class AadProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AadProfile() { } + public System.Collections.Generic.IList AdminGroupObjectIds { get { throw null; } } + public bool? EnableAzureRBAC { get { throw null; } set { } } + public string TenantId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.AadProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.AadProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 AgentError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AgentError() { } + public string Component { get { throw null; } } + public string Message { get { throw null; } } + public string Severity { get { throw null; } } + public System.DateTimeOffset? Time { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.AgentError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.AgentError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 ArcAgentProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ArcAgentProfile() { } + public Azure.ResourceManager.Hybridkubernetes.Models.AutoUpgradeOption? AgentAutoUpgrade { get { throw null; } set { } } + public System.Collections.Generic.IList AgentErrors { get { throw null; } } + public string AgentState { get { throw null; } } + public string DesiredAgentVersion { get { throw null; } set { } } + public System.Collections.Generic.IList SystemComponents { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.ArcAgentProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.ArcAgentProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 ArcAgentryConfigurations : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ArcAgentryConfigurations() { } + public string Feature { get { throw null; } set { } } + public System.Collections.Generic.IDictionary ProtectedSettings { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Settings { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.ArcAgentryConfigurations System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.ArcAgentryConfigurations System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 ArmHybridkubernetesModelFactory + { + public static Azure.ResourceManager.Hybridkubernetes.Models.AgentError AgentError(string message = null, string severity = null, string component = null, System.DateTimeOffset? time = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.Models.ArcAgentProfile ArcAgentProfile(string desiredAgentVersion = null, Azure.ResourceManager.Hybridkubernetes.Models.AutoUpgradeOption? agentAutoUpgrade = default(Azure.ResourceManager.Hybridkubernetes.Models.AutoUpgradeOption?), System.Collections.Generic.IEnumerable systemComponents = null, System.Collections.Generic.IEnumerable agentErrors = null, string agentState = null) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.ConnectedClusterData ConnectedClusterData(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.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterKind? kind = default(Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterKind?), string agentPublicKeyCertificate = null, string kubernetesVersion = null, int? totalNodeCount = default(int?), int? totalCoreCount = default(int?), string agentVersion = null, Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState?), string distribution = null, string distributionVersion = null, string infrastructure = null, string offering = null, System.DateTimeOffset? managedIdentityCertificateExpirationOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastConnectivityOn = default(System.DateTimeOffset?), Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus? connectivityStatus = default(Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus?), Azure.ResourceManager.Hybridkubernetes.Models.PrivateLinkState? privateLinkState = default(Azure.ResourceManager.Hybridkubernetes.Models.PrivateLinkState?), string privateLinkScopeResourceId = null, Azure.ResourceManager.Hybridkubernetes.Models.AzureHybridBenefit? azureHybridBenefit = default(Azure.ResourceManager.Hybridkubernetes.Models.AzureHybridBenefit?), Azure.ResourceManager.Hybridkubernetes.Models.AadProfile aadProfile = null, Azure.ResourceManager.Hybridkubernetes.Models.ArcAgentProfile arcAgentProfile = null, bool? workloadIdentityEnabled = default(bool?), Azure.ResourceManager.Hybridkubernetes.Models.OidcIssuerProfile oidcIssuerProfile = null, Azure.ResourceManager.Hybridkubernetes.Models.Gateway gateway = null, System.Collections.Generic.IEnumerable arcAgentryConfigurations = null, System.Collections.Generic.IReadOnlyDictionary miscellaneousProperties = null) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.Models.CredentialResult CredentialResult(string name = null, byte[] value = null) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.Models.CredentialResults CredentialResults(Azure.ResourceManager.Hybridkubernetes.Models.HybridConnectionConfig hybridConnectionConfig = null, System.Collections.Generic.IEnumerable kubeconfigs = null) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.Models.HybridConnectionConfig HybridConnectionConfig(long? expirationTime = default(long?), string hybridConnectionName = null, string relay = null, string token = null, string relayTid = null, string relayType = null) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.Models.OidcIssuerProfile OidcIssuerProfile(bool? enabled = default(bool?), string issuerUri = null, string selfHostedIssuerUri = null) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.Models.SystemComponent SystemComponent(string type = null, string userSpecifiedVersion = null, int? majorVersion = default(int?), string currentVersion = null) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AuthenticationMethod : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AuthenticationMethod(string value) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.Models.AuthenticationMethod AAD { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.AuthenticationMethod Token { get { throw null; } } + public bool Equals(Azure.ResourceManager.Hybridkubernetes.Models.AuthenticationMethod 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.Hybridkubernetes.Models.AuthenticationMethod left, Azure.ResourceManager.Hybridkubernetes.Models.AuthenticationMethod right) { throw null; } + public static implicit operator Azure.ResourceManager.Hybridkubernetes.Models.AuthenticationMethod (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Hybridkubernetes.Models.AuthenticationMethod left, Azure.ResourceManager.Hybridkubernetes.Models.AuthenticationMethod right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AutoUpgradeOption : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AutoUpgradeOption(string value) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.Models.AutoUpgradeOption Disabled { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.AutoUpgradeOption Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.Hybridkubernetes.Models.AutoUpgradeOption 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.Hybridkubernetes.Models.AutoUpgradeOption left, Azure.ResourceManager.Hybridkubernetes.Models.AutoUpgradeOption right) { throw null; } + public static implicit operator Azure.ResourceManager.Hybridkubernetes.Models.AutoUpgradeOption (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Hybridkubernetes.Models.AutoUpgradeOption left, Azure.ResourceManager.Hybridkubernetes.Models.AutoUpgradeOption right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureHybridBenefit : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureHybridBenefit(string value) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.Models.AzureHybridBenefit False { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.AzureHybridBenefit NotApplicable { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.AzureHybridBenefit True { get { throw null; } } + public bool Equals(Azure.ResourceManager.Hybridkubernetes.Models.AzureHybridBenefit 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.Hybridkubernetes.Models.AzureHybridBenefit left, Azure.ResourceManager.Hybridkubernetes.Models.AzureHybridBenefit right) { throw null; } + public static implicit operator Azure.ResourceManager.Hybridkubernetes.Models.AzureHybridBenefit (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Hybridkubernetes.Models.AzureHybridBenefit left, Azure.ResourceManager.Hybridkubernetes.Models.AzureHybridBenefit right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ConnectedClusterKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectedClusterKind(string value) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterKind AWS { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterKind ProvisionedCluster { get { throw null; } } + public bool Equals(Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterKind 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.Hybridkubernetes.Models.ConnectedClusterKind left, Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterKind right) { throw null; } + public static implicit operator Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterKind (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterKind left, Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterKind right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ConnectedClusterPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedClusterPatch() { } + public Azure.ResourceManager.Hybridkubernetes.Models.AzureHybridBenefit? AzureHybridBenefit { get { throw null; } set { } } + public string Distribution { get { throw null; } set { } } + public string DistributionVersion { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.ConnectedClusterPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 ConnectivityStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectivityStatus(string value) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus AgentNotInstalled { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus Connected { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus Connecting { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus Expired { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus Offline { get { throw null; } } + public bool Equals(Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus 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.Hybridkubernetes.Models.ConnectivityStatus left, Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus left, Azure.ResourceManager.Hybridkubernetes.Models.ConnectivityStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CredentialResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CredentialResult() { } + public string Name { get { throw null; } } + public byte[] Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.CredentialResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.CredentialResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 CredentialResults : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CredentialResults() { } + public Azure.ResourceManager.Hybridkubernetes.Models.HybridConnectionConfig HybridConnectionConfig { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Kubeconfigs { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.CredentialResults System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.CredentialResults System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 Gateway : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Gateway() { } + public bool? Enabled { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.Gateway System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.Gateway System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 HybridConnectionConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HybridConnectionConfig() { } + public long? ExpirationTime { get { throw null; } } + public string HybridConnectionName { get { throw null; } } + public string Relay { get { throw null; } } + public string RelayTid { get { throw null; } } + public string RelayType { get { throw null; } } + public string Token { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.HybridConnectionConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.HybridConnectionConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 ListClusterUserCredentialProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ListClusterUserCredentialProperties(Azure.ResourceManager.Hybridkubernetes.Models.AuthenticationMethod authenticationMethod, bool clientProxy) { } + public Azure.ResourceManager.Hybridkubernetes.Models.AuthenticationMethod AuthenticationMethod { get { throw null; } } + public bool ClientProxy { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.ListClusterUserCredentialProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.ListClusterUserCredentialProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 OidcIssuerProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OidcIssuerProfile() { } + public bool? Enabled { get { throw null; } set { } } + public string IssuerUri { get { throw null; } } + public string SelfHostedIssuerUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.OidcIssuerProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.OidcIssuerProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 PrivateLinkState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PrivateLinkState(string value) { throw null; } + public static Azure.ResourceManager.Hybridkubernetes.Models.PrivateLinkState Disabled { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.PrivateLinkState Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.Hybridkubernetes.Models.PrivateLinkState 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.Hybridkubernetes.Models.PrivateLinkState left, Azure.ResourceManager.Hybridkubernetes.Models.PrivateLinkState right) { throw null; } + public static implicit operator Azure.ResourceManager.Hybridkubernetes.Models.PrivateLinkState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Hybridkubernetes.Models.PrivateLinkState left, Azure.ResourceManager.Hybridkubernetes.Models.PrivateLinkState 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.Hybridkubernetes.Models.ProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.Hybridkubernetes.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.Hybridkubernetes.Models.ProvisioningState left, Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState left, Azure.ResourceManager.Hybridkubernetes.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SystemComponent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SystemComponent() { } + public string CurrentVersion { get { throw null; } } + public int? MajorVersion { get { throw null; } set { } } + public string Type { get { throw null; } set { } } + public string UserSpecifiedVersion { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.SystemComponent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Hybridkubernetes.Models.SystemComponent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/assets.json b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/assets.json new file mode 100644 index 000000000000..797844ad0585 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes", + "Tag": "" +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/samples/Azure.ResourceManager.Hybridkubernetes.Samples.csproj b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/samples/Azure.ResourceManager.Hybridkubernetes.Samples.csproj new file mode 100644 index 000000000000..299afe8b8ca9 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/samples/Azure.ResourceManager.Hybridkubernetes.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/samples/Generated/Samples/Sample_ConnectedClusterCollection.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/samples/Generated/Samples/Sample_ConnectedClusterCollection.cs new file mode 100644 index 000000000000..6f19b2c2f8cb --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/samples/Generated/Samples/Sample_ConnectedClusterCollection.cs @@ -0,0 +1,436 @@ +// 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.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Hybridkubernetes.Samples +{ + public partial class Sample_ConnectedClusterCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateClusterAgentlessKindAWSExample() + { + // Generated from example definition: 2024-12-01-preview/CreateClusterAgentless_KindAWSExample.json + // this example is just showing the usage of "ConnectedCluster_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "1bfbb5d0-917e-4346-9026-1d3b344417f5"; + string resourceGroupName = "k8sc-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ConnectedClusterResource + ConnectedClusterCollection collection = resourceGroupResource.GetConnectedClusters(); + + // invoke the operation + string clusterName = "testCluster"; + ConnectedClusterData data = new ConnectedClusterData(default, null, null); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, clusterName, data); + ConnectedClusterResource 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 + ConnectedClusterData 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 CreateOrUpdate_CreateClusterExample() + { + // Generated from example definition: 2024-12-01-preview/CreateClusterExample.json + // this example is just showing the usage of "ConnectedCluster_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "1bfbb5d0-917e-4346-9026-1d3b344417f5"; + string resourceGroupName = "k8sc-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ConnectedClusterResource + ConnectedClusterCollection collection = resourceGroupResource.GetConnectedClusters(); + + // invoke the operation + string clusterName = "testCluster"; + ConnectedClusterData data = new ConnectedClusterData(default, null, null); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, clusterName, data); + ConnectedClusterResource 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 + ConnectedClusterData 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 CreateOrUpdate_CreateClusterPrivateLinkExample() + { + // Generated from example definition: 2024-12-01-preview/CreateClusterPrivateLinkExample.json + // this example is just showing the usage of "ConnectedCluster_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "1bfbb5d0-917e-4346-9026-1d3b344417f5"; + string resourceGroupName = "k8sc-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ConnectedClusterResource + ConnectedClusterCollection collection = resourceGroupResource.GetConnectedClusters(); + + // invoke the operation + string clusterName = "testCluster"; + ConnectedClusterData data = new ConnectedClusterData(default, null, null); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, clusterName, data); + ConnectedClusterResource 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 + ConnectedClusterData 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 CreateOrUpdate_CreateClusterKindExample() + { + // Generated from example definition: 2024-12-01-preview/CreateCluster_KindExample.json + // this example is just showing the usage of "ConnectedCluster_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "1bfbb5d0-917e-4346-9026-1d3b344417f5"; + string resourceGroupName = "k8sc-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ConnectedClusterResource + ConnectedClusterCollection collection = resourceGroupResource.GetConnectedClusters(); + + // invoke the operation + string clusterName = "testCluster"; + ConnectedClusterData data = new ConnectedClusterData(default, null, null); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, clusterName, data); + ConnectedClusterResource 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 + ConnectedClusterData 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 CreateOrUpdate_UpdateClusterByPutExample() + { + // Generated from example definition: 2024-12-01-preview/UpdateClusterByPutExample.json + // this example is just showing the usage of "ConnectedCluster_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "1bfbb5d0-917e-4346-9026-1d3b344417f5"; + string resourceGroupName = "k8sc-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ConnectedClusterResource + ConnectedClusterCollection collection = resourceGroupResource.GetConnectedClusters(); + + // invoke the operation + string clusterName = "testCluster"; + ConnectedClusterData data = new ConnectedClusterData(default, null, null); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, clusterName, data); + ConnectedClusterResource 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 + ConnectedClusterData 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_GetClusterExample() + { + // Generated from example definition: 2024-12-01-preview/GetClusterExample.json + // this example is just showing the usage of "ConnectedCluster_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "1bfbb5d0-917e-4346-9026-1d3b344417f5"; + string resourceGroupName = "k8sc-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ConnectedClusterResource + ConnectedClusterCollection collection = resourceGroupResource.GetConnectedClusters(); + + // invoke the operation + string clusterName = "testCluster"; + ConnectedClusterResource result = await collection.GetAsync(clusterName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ConnectedClusterData 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_GetProvisionedClusterExample() + { + // Generated from example definition: 2024-12-01-preview/GetProvisionedClusterExample.json + // this example is just showing the usage of "ConnectedCluster_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "1bfbb5d0-917e-4346-9026-1d3b344417f5"; + string resourceGroupName = "k8sc-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ConnectedClusterResource + ConnectedClusterCollection collection = resourceGroupResource.GetConnectedClusters(); + + // invoke the operation + string clusterName = "testCluster"; + ConnectedClusterResource result = await collection.GetAsync(clusterName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ConnectedClusterData 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_GetClustersExample() + { + // Generated from example definition: 2024-12-01-preview/GetClustersByResourceGroupExample.json + // this example is just showing the usage of "ConnectedCluster_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 = "1bfbb5d0-917e-4346-9026-1d3b344417f5"; + string resourceGroupName = "k8sc-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ConnectedClusterResource + ConnectedClusterCollection collection = resourceGroupResource.GetConnectedClusters(); + + // invoke the operation and iterate over the result + await foreach (ConnectedClusterResource 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 + ConnectedClusterData 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_GetClusterExample() + { + // Generated from example definition: 2024-12-01-preview/GetClusterExample.json + // this example is just showing the usage of "ConnectedCluster_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "1bfbb5d0-917e-4346-9026-1d3b344417f5"; + string resourceGroupName = "k8sc-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ConnectedClusterResource + ConnectedClusterCollection collection = resourceGroupResource.GetConnectedClusters(); + + // invoke the operation + string clusterName = "testCluster"; + bool result = await collection.ExistsAsync(clusterName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetProvisionedClusterExample() + { + // Generated from example definition: 2024-12-01-preview/GetProvisionedClusterExample.json + // this example is just showing the usage of "ConnectedCluster_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "1bfbb5d0-917e-4346-9026-1d3b344417f5"; + string resourceGroupName = "k8sc-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ConnectedClusterResource + ConnectedClusterCollection collection = resourceGroupResource.GetConnectedClusters(); + + // invoke the operation + string clusterName = "testCluster"; + bool result = await collection.ExistsAsync(clusterName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetClusterExample() + { + // Generated from example definition: 2024-12-01-preview/GetClusterExample.json + // this example is just showing the usage of "ConnectedCluster_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "1bfbb5d0-917e-4346-9026-1d3b344417f5"; + string resourceGroupName = "k8sc-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ConnectedClusterResource + ConnectedClusterCollection collection = resourceGroupResource.GetConnectedClusters(); + + // invoke the operation + string clusterName = "testCluster"; + NullableResponse response = await collection.GetIfExistsAsync(clusterName); + ConnectedClusterResource 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 + ConnectedClusterData 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 GetIfExists_GetProvisionedClusterExample() + { + // Generated from example definition: 2024-12-01-preview/GetProvisionedClusterExample.json + // this example is just showing the usage of "ConnectedCluster_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "1bfbb5d0-917e-4346-9026-1d3b344417f5"; + string resourceGroupName = "k8sc-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ConnectedClusterResource + ConnectedClusterCollection collection = resourceGroupResource.GetConnectedClusters(); + + // invoke the operation + string clusterName = "testCluster"; + NullableResponse response = await collection.GetIfExistsAsync(clusterName); + ConnectedClusterResource 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 + ConnectedClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/samples/Generated/Samples/Sample_ConnectedClusterResource.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/samples/Generated/Samples/Sample_ConnectedClusterResource.cs new file mode 100644 index 000000000000..6db77d92f582 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/samples/Generated/Samples/Sample_ConnectedClusterResource.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.Hybridkubernetes.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Hybridkubernetes.Samples +{ + public partial class Sample_ConnectedClusterResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetClusterExample() + { + // Generated from example definition: 2024-12-01-preview/GetClusterExample.json + // this example is just showing the usage of "ConnectedCluster_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ConnectedClusterResource created on azure + // for more information of creating ConnectedClusterResource, please refer to the document of ConnectedClusterResource + string subscriptionId = "1bfbb5d0-917e-4346-9026-1d3b344417f5"; + string resourceGroupName = "k8sc-rg"; + string clusterName = "testCluster"; + ResourceIdentifier connectedClusterResourceId = ConnectedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); + ConnectedClusterResource connectedCluster = client.GetConnectedClusterResource(connectedClusterResourceId); + + // invoke the operation + ConnectedClusterResource result = await connectedCluster.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 + ConnectedClusterData 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_GetProvisionedClusterExample() + { + // Generated from example definition: 2024-12-01-preview/GetProvisionedClusterExample.json + // this example is just showing the usage of "ConnectedCluster_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ConnectedClusterResource created on azure + // for more information of creating ConnectedClusterResource, please refer to the document of ConnectedClusterResource + string subscriptionId = "1bfbb5d0-917e-4346-9026-1d3b344417f5"; + string resourceGroupName = "k8sc-rg"; + string clusterName = "testCluster"; + ResourceIdentifier connectedClusterResourceId = ConnectedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); + ConnectedClusterResource connectedCluster = client.GetConnectedClusterResource(connectedClusterResourceId); + + // invoke the operation + ConnectedClusterResource result = await connectedCluster.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 + ConnectedClusterData 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_DeleteClusterExample() + { + // Generated from example definition: 2024-12-01-preview/DeleteClusterExample.json + // this example is just showing the usage of "ConnectedCluster_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 ConnectedClusterResource created on azure + // for more information of creating ConnectedClusterResource, please refer to the document of ConnectedClusterResource + string subscriptionId = "1bfbb5d0-917e-4346-9026-1d3b344417f5"; + string resourceGroupName = "k8sc-rg"; + string clusterName = "testCluster"; + ResourceIdentifier connectedClusterResourceId = ConnectedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); + ConnectedClusterResource connectedCluster = client.GetConnectedClusterResource(connectedClusterResourceId); + + // invoke the operation + await connectedCluster.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdateClusterExample() + { + // Generated from example definition: 2024-12-01-preview/UpdateClusterByPatchExample.json + // this example is just showing the usage of "ConnectedCluster_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 ConnectedClusterResource created on azure + // for more information of creating ConnectedClusterResource, please refer to the document of ConnectedClusterResource + string subscriptionId = "1bfbb5d0-917e-4346-9026-1d3b344417f5"; + string resourceGroupName = "k8sc-rg"; + string clusterName = "testCluster"; + ResourceIdentifier connectedClusterResourceId = ConnectedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); + ConnectedClusterResource connectedCluster = client.GetConnectedClusterResource(connectedClusterResourceId); + + // invoke the operation + ConnectedClusterPatch patch = new ConnectedClusterPatch(); + ConnectedClusterResource result = await connectedCluster.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ConnectedClusterData 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 GetClusterUserCredential_ListClusterUserCredentialExample() + { + // Generated from example definition: 2024-12-01-preview/ConnectedClustersListClusterCredentialResultCSPAAD.json + // this example is just showing the usage of "ConnectedClusters_ListClusterUserCredential" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ConnectedClusterResource created on azure + // for more information of creating ConnectedClusterResource, please refer to the document of ConnectedClusterResource + string subscriptionId = "1bfbb5d0-917e-4346-9026-1d3b344417f5"; + string resourceGroupName = "k8sc-rg"; + string clusterName = "testCluster"; + ResourceIdentifier connectedClusterResourceId = ConnectedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); + ConnectedClusterResource connectedCluster = client.GetConnectedClusterResource(connectedClusterResourceId); + + // invoke the operation + ListClusterUserCredentialProperties properties = new ListClusterUserCredentialProperties(default, default); + CredentialResults result = await connectedCluster.GetClusterUserCredentialAsync(properties); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetClusterUserCredential_ListClusterUserCredentialNonAadExample() + { + // Generated from example definition: 2024-12-01-preview/ConnectedClustersListClusterCredentialResultCSPToken.json + // this example is just showing the usage of "ConnectedClusters_ListClusterUserCredential" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ConnectedClusterResource created on azure + // for more information of creating ConnectedClusterResource, please refer to the document of ConnectedClusterResource + string subscriptionId = "1bfbb5d0-917e-4346-9026-1d3b344417f5"; + string resourceGroupName = "k8sc-rg"; + string clusterName = "testCluster"; + ResourceIdentifier connectedClusterResourceId = ConnectedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); + ConnectedClusterResource connectedCluster = client.GetConnectedClusterResource(connectedClusterResourceId); + + // invoke the operation + ListClusterUserCredentialProperties properties = new ListClusterUserCredentialProperties(default, default); + CredentialResults result = await connectedCluster.GetClusterUserCredentialAsync(properties); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetClusterUserCredential_ListClusterUserCredentialCSPExample() + { + // Generated from example definition: 2024-12-01-preview/ConnectedClustersListClusterCredentialResultHPAAD.json + // this example is just showing the usage of "ConnectedClusters_ListClusterUserCredential" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ConnectedClusterResource created on azure + // for more information of creating ConnectedClusterResource, please refer to the document of ConnectedClusterResource + string subscriptionId = "1bfbb5d0-917e-4346-9026-1d3b344417f5"; + string resourceGroupName = "k8sc-rg"; + string clusterName = "testCluster"; + ResourceIdentifier connectedClusterResourceId = ConnectedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); + ConnectedClusterResource connectedCluster = client.GetConnectedClusterResource(connectedClusterResourceId); + + // invoke the operation + ListClusterUserCredentialProperties properties = new ListClusterUserCredentialProperties(default, default); + CredentialResults result = await connectedCluster.GetClusterUserCredentialAsync(properties); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetClusterUserCredential_ListClusterUserCredentialNonAadCSPExample() + { + // Generated from example definition: 2024-12-01-preview/ConnectedClustersListClusterCredentialResultHPToken.json + // this example is just showing the usage of "ConnectedClusters_ListClusterUserCredential" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ConnectedClusterResource created on azure + // for more information of creating ConnectedClusterResource, please refer to the document of ConnectedClusterResource + string subscriptionId = "1bfbb5d0-917e-4346-9026-1d3b344417f5"; + string resourceGroupName = "k8sc-rg"; + string clusterName = "testCluster"; + ResourceIdentifier connectedClusterResourceId = ConnectedClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); + ConnectedClusterResource connectedCluster = client.GetConnectedClusterResource(connectedClusterResourceId); + + // invoke the operation + ListClusterUserCredentialProperties properties = new ListClusterUserCredentialProperties(default, default); + CredentialResults result = await connectedCluster.GetClusterUserCredentialAsync(properties); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..e3041d955ab5 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Hybridkubernetes.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetConnectedClusters_GetClustersBySubscriptionExample() + { + // Generated from example definition: 2024-12-01-preview/GetClustersBySubscriptionExample.json + // this example is just showing the usage of "ConnectedCluster_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 = "1bfbb5d0-917e-4346-9026-1d3b344417f5"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (ConnectedClusterResource item in subscriptionResource.GetConnectedClustersAsync()) + { + // 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 + ConnectedClusterData 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/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Azure.ResourceManager.Hybridkubernetes.csproj b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Azure.ResourceManager.Hybridkubernetes.csproj new file mode 100644 index 000000000000..044f013bf7d9 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Azure.ResourceManager.Hybridkubernetes.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider Hybridkubernetes. + 1.0.0-beta.1 + azure;management;arm;resource manager;hybridkubernetes + Azure.ResourceManager.Hybridkubernetes + + diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/ArmHybridkubernetesModelFactory.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/ArmHybridkubernetesModelFactory.cs new file mode 100644 index 000000000000..fb27a06e4eaf --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/ArmHybridkubernetesModelFactory.cs @@ -0,0 +1,186 @@ +// 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.Hybridkubernetes.Models +{ + /// Model factory for models. + public static partial class ArmHybridkubernetesModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The identity of the connected cluster. Current supported identity types: None, SystemAssigned. + /// The kind of connected cluster. + /// Base64 encoded public certificate used by the agent to do the initial handshake to the backend services in Azure. + /// The Kubernetes version of the connected cluster resource. + /// Number of nodes present in the connected cluster resource. + /// Number of CPU cores present in the connected cluster resource. + /// Version of the agent running on the connected cluster resource. + /// Provisioning state of the connected cluster resource. + /// The Kubernetes distribution running on this connected cluster. + /// The Kubernetes distribution version on this connected cluster. + /// The infrastructure on which the Kubernetes cluster represented by this connected cluster is running on. + /// Connected cluster offering. + /// Expiration time of the managed identity certificate. + /// Time representing the last instance when heart beat was received from the cluster. + /// Represents the connectivity status of the connected cluster. + /// Property which describes the state of private link on a connected cluster resource. + /// This is populated only if privateLinkState is enabled. The resource id of the private link scope this connected cluster is assigned to, if any. + /// Indicates whether Azure Hybrid Benefit is opted in. + /// AAD profile for the connected cluster. + /// Arc agentry configuration for the provisioned cluster. + /// Security profile for the connected cluster. + /// Open ID Connect (OIDC) Issuer Profile for the connected cluster. + /// Details of the gateway used by the Arc router for connectivity. + /// Configuration settings for customizing the behavior of the connected cluster. + /// More properties related to the Connected Cluster. + /// A new instance for mocking. + public static ConnectedClusterData ConnectedClusterData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, ConnectedClusterKind? kind = null, string agentPublicKeyCertificate = null, string kubernetesVersion = null, int? totalNodeCount = null, int? totalCoreCount = null, string agentVersion = null, ProvisioningState? provisioningState = null, string distribution = null, string distributionVersion = null, string infrastructure = null, string offering = null, DateTimeOffset? managedIdentityCertificateExpirationOn = null, DateTimeOffset? lastConnectivityOn = null, ConnectivityStatus? connectivityStatus = null, PrivateLinkState? privateLinkState = null, string privateLinkScopeResourceId = null, AzureHybridBenefit? azureHybridBenefit = null, AadProfile aadProfile = null, ArcAgentProfile arcAgentProfile = null, bool? workloadIdentityEnabled = null, OidcIssuerProfile oidcIssuerProfile = null, Gateway gateway = null, IEnumerable arcAgentryConfigurations = null, IReadOnlyDictionary miscellaneousProperties = null) + { + tags ??= new Dictionary(); + arcAgentryConfigurations ??= new List(); + miscellaneousProperties ??= new Dictionary(); + + return new ConnectedClusterData( + id, + name, + resourceType, + systemData, + tags, + location, + identity, + kind, + agentPublicKeyCertificate, + kubernetesVersion, + totalNodeCount, + totalCoreCount, + agentVersion, + provisioningState, + distribution, + distributionVersion, + infrastructure, + offering, + managedIdentityCertificateExpirationOn, + lastConnectivityOn, + connectivityStatus, + privateLinkState, + privateLinkScopeResourceId, + azureHybridBenefit, + aadProfile, + arcAgentProfile, + workloadIdentityEnabled != null ? new SecurityProfile(new SecurityProfileWorkloadIdentity(workloadIdentityEnabled, serializedAdditionalRawData: null), serializedAdditionalRawData: null) : null, + oidcIssuerProfile, + gateway, + arcAgentryConfigurations?.ToList(), + miscellaneousProperties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Version of the Arc agents to be installed on the cluster resource. + /// Indicates whether the Arc agents on the be upgraded automatically to the latest version. Defaults to Enabled. + /// List of system extensions that are installed on the cluster resource. + /// List of arc agentry and system components errors on the cluster resource. + /// Represents the current state of the Arc agentry and its dependent components. + /// A new instance for mocking. + public static ArcAgentProfile ArcAgentProfile(string desiredAgentVersion = null, AutoUpgradeOption? agentAutoUpgrade = null, IEnumerable systemComponents = null, IEnumerable agentErrors = null, string agentState = null) + { + systemComponents ??= new List(); + agentErrors ??= new List(); + + return new ArcAgentProfile( + desiredAgentVersion, + agentAutoUpgrade, + systemComponents?.ToList(), + agentErrors?.ToList(), + agentState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Type of the system extension. + /// Version of the system extension to be installed on the cluster resource. + /// Major Version of the system extension that is currently installed on the cluster resource. + /// Version of the system extension that is currently installed on the cluster resource. + /// A new instance for mocking. + public static SystemComponent SystemComponent(string type = null, string userSpecifiedVersion = null, int? majorVersion = null, string currentVersion = null) + { + return new SystemComponent(type, userSpecifiedVersion, majorVersion, currentVersion, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Agent error message. + /// Severity of the error message. + /// Agent component where error message occured. + /// The timestamp of error occured (UTC). + /// A new instance for mocking. + public static AgentError AgentError(string message = null, string severity = null, string component = null, DateTimeOffset? time = null) + { + return new AgentError(message, severity, component, time, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Whether to enable oidc issuer for workload identity integration. + /// The issuer url for hybrid clusters connected to Arc used for the workload identity feature. + /// The issuer url for public cloud clusters - AKS, EKS, GKE - used for the workload identity feature. + /// A new instance for mocking. + public static OidcIssuerProfile OidcIssuerProfile(bool? enabled = null, string issuerUri = null, string selfHostedIssuerUri = null) + { + return new OidcIssuerProfile(enabled, issuerUri, selfHostedIssuerUri, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Contains the REP (rendezvous endpoint) and “Sender” access token. + /// Base64-encoded Kubernetes configuration file. + /// A new instance for mocking. + public static CredentialResults CredentialResults(HybridConnectionConfig hybridConnectionConfig = null, IEnumerable kubeconfigs = null) + { + kubeconfigs ??= new List(); + + return new CredentialResults(hybridConnectionConfig, kubeconfigs?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Timestamp when this token will be expired. + /// Name of the connection. + /// Name of the relay. + /// Sender access token. + /// TenantID of the relay. + /// Type of relay. + /// A new instance for mocking. + public static HybridConnectionConfig HybridConnectionConfig(long? expirationTime = null, string hybridConnectionName = null, string relay = null, string token = null, string relayTid = null, string relayType = null) + { + return new HybridConnectionConfig( + expirationTime, + hybridConnectionName, + relay, + token, + relayTid, + relayType, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name of the credential. + /// Base64-encoded Kubernetes configuration file. + /// A new instance for mocking. + public static CredentialResult CredentialResult(string name = null, byte[] value = null) + { + return new CredentialResult(name, value, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/ConnectedClusterCollection.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/ConnectedClusterCollection.cs new file mode 100644 index 000000000000..88da2840702c --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/ConnectedClusterCollection.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.Hybridkubernetes +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetConnectedClusters method from an instance of . + /// + public partial class ConnectedClusterCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _connectedClusterClientDiagnostics; + private readonly ConnectedClustersRestOperations _connectedClusterRestClient; + + /// Initializes a new instance of the class for mocking. + protected ConnectedClusterCollection() + { + } + + /// 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 ConnectedClusterCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _connectedClusterClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Hybridkubernetes", ConnectedClusterResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ConnectedClusterResource.ResourceType, out string connectedClusterApiVersion); + _connectedClusterRestClient = new ConnectedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, connectedClusterApiVersion); +#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)); + } + + /// + /// API to register a new Kubernetes cluster and create or replace a connected cluster tracked resource in Azure Resource Manager (ARM). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_CreateOrReplace + /// + /// + /// Default Api Version + /// 2024-12-01-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 name of the Kubernetes cluster on which get is called. + /// Parameters supplied to Create a Connected Cluster. + /// 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 clusterName, ConnectedClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _connectedClusterClientDiagnostics.CreateScope("ConnectedClusterCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _connectedClusterRestClient.CreateOrReplaceAsync(Id.SubscriptionId, Id.ResourceGroupName, clusterName, data, cancellationToken).ConfigureAwait(false); + var operation = new HybridkubernetesArmOperation(new ConnectedClusterOperationSource(Client), _connectedClusterClientDiagnostics, Pipeline, _connectedClusterRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, clusterName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// API to register a new Kubernetes cluster and create or replace a connected cluster tracked resource in Azure Resource Manager (ARM). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_CreateOrReplace + /// + /// + /// Default Api Version + /// 2024-12-01-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 name of the Kubernetes cluster on which get is called. + /// Parameters supplied to Create a Connected Cluster. + /// 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 clusterName, ConnectedClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _connectedClusterClientDiagnostics.CreateScope("ConnectedClusterCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _connectedClusterRestClient.CreateOrReplace(Id.SubscriptionId, Id.ResourceGroupName, clusterName, data, cancellationToken); + var operation = new HybridkubernetesArmOperation(new ConnectedClusterOperationSource(Client), _connectedClusterClientDiagnostics, Pipeline, _connectedClusterRestClient.CreateCreateOrReplaceRequest(Id.SubscriptionId, Id.ResourceGroupName, clusterName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns the properties of the specified connected cluster, including name, identity, properties, and additional cluster details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_Get + /// + /// + /// Default Api Version + /// 2024-12-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Kubernetes cluster on which get is called. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string clusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + + using var scope = _connectedClusterClientDiagnostics.CreateScope("ConnectedClusterCollection.Get"); + scope.Start(); + try + { + var response = await _connectedClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, clusterName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns the properties of the specified connected cluster, including name, identity, properties, and additional cluster details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_Get + /// + /// + /// Default Api Version + /// 2024-12-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Kubernetes cluster on which get is called. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string clusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + + using var scope = _connectedClusterClientDiagnostics.CreateScope("ConnectedClusterCollection.Get"); + scope.Start(); + try + { + var response = _connectedClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, clusterName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// API to enumerate registered connected K8s clusters under a Resource Group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters + /// + /// + /// Operation Id + /// ConnectedCluster_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-12-01-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) => _connectedClusterRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectedClusterRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ConnectedClusterResource(Client, ConnectedClusterData.DeserializeConnectedClusterData(e)), _connectedClusterClientDiagnostics, Pipeline, "ConnectedClusterCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// API to enumerate registered connected K8s clusters under a Resource Group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters + /// + /// + /// Operation Id + /// ConnectedCluster_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-12-01-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) => _connectedClusterRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectedClusterRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ConnectedClusterResource(Client, ConnectedClusterData.DeserializeConnectedClusterData(e)), _connectedClusterClientDiagnostics, Pipeline, "ConnectedClusterCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_Get + /// + /// + /// Default Api Version + /// 2024-12-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Kubernetes cluster on which get is called. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string clusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + + using var scope = _connectedClusterClientDiagnostics.CreateScope("ConnectedClusterCollection.Exists"); + scope.Start(); + try + { + var response = await _connectedClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, clusterName, 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.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_Get + /// + /// + /// Default Api Version + /// 2024-12-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Kubernetes cluster on which get is called. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string clusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + + using var scope = _connectedClusterClientDiagnostics.CreateScope("ConnectedClusterCollection.Exists"); + scope.Start(); + try + { + var response = _connectedClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, clusterName, 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.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_Get + /// + /// + /// Default Api Version + /// 2024-12-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Kubernetes cluster on which get is called. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string clusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + + using var scope = _connectedClusterClientDiagnostics.CreateScope("ConnectedClusterCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _connectedClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, clusterName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterResource(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.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_Get + /// + /// + /// Default Api Version + /// 2024-12-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Kubernetes cluster on which get is called. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string clusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + + using var scope = _connectedClusterClientDiagnostics.CreateScope("ConnectedClusterCollection.GetIfExists"); + scope.Start(); + try + { + var response = _connectedClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, clusterName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterResource(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/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/ConnectedClusterData.Serialization.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/ConnectedClusterData.Serialization.cs new file mode 100644 index 000000000000..e0ac5f0b0cb7 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/ConnectedClusterData.Serialization.cs @@ -0,0 +1,571 @@ +// 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.Hybridkubernetes.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Hybridkubernetes +{ + public partial class ConnectedClusterData : 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(ConnectedClusterData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("identity"u8); + JsonSerializer.Serialize(writer, Identity); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.Value.ToString()); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + writer.WritePropertyName("agentPublicKeyCertificate"u8); + writer.WriteStringValue(AgentPublicKeyCertificate); + if (options.Format != "W" && Optional.IsDefined(KubernetesVersion)) + { + writer.WritePropertyName("kubernetesVersion"u8); + writer.WriteStringValue(KubernetesVersion); + } + if (options.Format != "W" && Optional.IsDefined(TotalNodeCount)) + { + writer.WritePropertyName("totalNodeCount"u8); + writer.WriteNumberValue(TotalNodeCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(TotalCoreCount)) + { + writer.WritePropertyName("totalCoreCount"u8); + writer.WriteNumberValue(TotalCoreCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(AgentVersion)) + { + writer.WritePropertyName("agentVersion"u8); + writer.WriteStringValue(AgentVersion); + } + if (Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(Distribution)) + { + writer.WritePropertyName("distribution"u8); + writer.WriteStringValue(Distribution); + } + if (Optional.IsDefined(DistributionVersion)) + { + writer.WritePropertyName("distributionVersion"u8); + writer.WriteStringValue(DistributionVersion); + } + if (Optional.IsDefined(Infrastructure)) + { + writer.WritePropertyName("infrastructure"u8); + writer.WriteStringValue(Infrastructure); + } + if (options.Format != "W" && Optional.IsDefined(Offering)) + { + writer.WritePropertyName("offering"u8); + writer.WriteStringValue(Offering); + } + if (options.Format != "W" && Optional.IsDefined(ManagedIdentityCertificateExpirationOn)) + { + writer.WritePropertyName("managedIdentityCertificateExpirationTime"u8); + writer.WriteStringValue(ManagedIdentityCertificateExpirationOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LastConnectivityOn)) + { + writer.WritePropertyName("lastConnectivityTime"u8); + writer.WriteStringValue(LastConnectivityOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(ConnectivityStatus)) + { + writer.WritePropertyName("connectivityStatus"u8); + writer.WriteStringValue(ConnectivityStatus.Value.ToString()); + } + if (Optional.IsDefined(PrivateLinkState)) + { + writer.WritePropertyName("privateLinkState"u8); + writer.WriteStringValue(PrivateLinkState.Value.ToString()); + } + if (Optional.IsDefined(PrivateLinkScopeResourceId)) + { + writer.WritePropertyName("privateLinkScopeResourceId"u8); + writer.WriteStringValue(PrivateLinkScopeResourceId); + } + if (Optional.IsDefined(AzureHybridBenefit)) + { + writer.WritePropertyName("azureHybridBenefit"u8); + writer.WriteStringValue(AzureHybridBenefit.Value.ToString()); + } + if (Optional.IsDefined(AadProfile)) + { + writer.WritePropertyName("aadProfile"u8); + writer.WriteObjectValue(AadProfile, options); + } + if (Optional.IsDefined(ArcAgentProfile)) + { + writer.WritePropertyName("arcAgentProfile"u8); + writer.WriteObjectValue(ArcAgentProfile, options); + } + if (Optional.IsDefined(SecurityProfile)) + { + writer.WritePropertyName("securityProfile"u8); + writer.WriteObjectValue(SecurityProfile, options); + } + if (Optional.IsDefined(OidcIssuerProfile)) + { + writer.WritePropertyName("oidcIssuerProfile"u8); + writer.WriteObjectValue(OidcIssuerProfile, options); + } + if (Optional.IsDefined(Gateway)) + { + if (Gateway != null) + { + writer.WritePropertyName("gateway"u8); + writer.WriteObjectValue(Gateway, options); + } + else + { + writer.WriteNull("gateway"); + } + } + if (Optional.IsCollectionDefined(ArcAgentryConfigurations)) + { + if (ArcAgentryConfigurations != null) + { + writer.WritePropertyName("arcAgentryConfigurations"u8); + writer.WriteStartArray(); + foreach (var item in ArcAgentryConfigurations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("arcAgentryConfigurations"); + } + } + if (options.Format != "W" && Optional.IsCollectionDefined(MiscellaneousProperties)) + { + writer.WritePropertyName("miscellaneousProperties"u8); + writer.WriteStartObject(); + foreach (var item in MiscellaneousProperties) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WriteEndObject(); + } + + ConnectedClusterData 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(ConnectedClusterData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedClusterData(document.RootElement, options); + } + + internal static ConnectedClusterData DeserializeConnectedClusterData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedServiceIdentity identity = default; + ConnectedClusterKind? kind = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + string agentPublicKeyCertificate = default; + string kubernetesVersion = default; + int? totalNodeCount = default; + int? totalCoreCount = default; + string agentVersion = default; + ProvisioningState? provisioningState = default; + string distribution = default; + string distributionVersion = default; + string infrastructure = default; + string offering = default; + DateTimeOffset? managedIdentityCertificateExpirationTime = default; + DateTimeOffset? lastConnectivityTime = default; + ConnectivityStatus? connectivityStatus = default; + PrivateLinkState? privateLinkState = default; + string privateLinkScopeResourceId = default; + AzureHybridBenefit? azureHybridBenefit = default; + AadProfile aadProfile = default; + ArcAgentProfile arcAgentProfile = default; + SecurityProfile securityProfile = default; + OidcIssuerProfile oidcIssuerProfile = default; + Gateway gateway = default; + IList arcAgentryConfigurations = default; + IReadOnlyDictionary miscellaneousProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identity"u8)) + { + identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("kind"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + kind = new ConnectedClusterKind(property.Value.GetString()); + 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 (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("agentPublicKeyCertificate"u8)) + { + agentPublicKeyCertificate = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("kubernetesVersion"u8)) + { + kubernetesVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("totalNodeCount"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalNodeCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("totalCoreCount"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalCoreCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("agentVersion"u8)) + { + agentVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("distribution"u8)) + { + distribution = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("distributionVersion"u8)) + { + distributionVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("infrastructure"u8)) + { + infrastructure = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("offering"u8)) + { + offering = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("managedIdentityCertificateExpirationTime"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + managedIdentityCertificateExpirationTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("lastConnectivityTime"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastConnectivityTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("connectivityStatus"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectivityStatus = new ConnectivityStatus(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("privateLinkState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateLinkState = new PrivateLinkState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("privateLinkScopeResourceId"u8)) + { + privateLinkScopeResourceId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("azureHybridBenefit"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureHybridBenefit = new AzureHybridBenefit(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("aadProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + aadProfile = AadProfile.DeserializeAadProfile(property0.Value, options); + continue; + } + if (property0.NameEquals("arcAgentProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + arcAgentProfile = ArcAgentProfile.DeserializeArcAgentProfile(property0.Value, options); + continue; + } + if (property0.NameEquals("securityProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityProfile = SecurityProfile.DeserializeSecurityProfile(property0.Value, options); + continue; + } + if (property0.NameEquals("oidcIssuerProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + oidcIssuerProfile = OidcIssuerProfile.DeserializeOidcIssuerProfile(property0.Value, options); + continue; + } + if (property0.NameEquals("gateway"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + gateway = null; + continue; + } + gateway = Gateway.DeserializeGateway(property0.Value, options); + continue; + } + if (property0.NameEquals("arcAgentryConfigurations"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(Models.ArcAgentryConfigurations.DeserializeArcAgentryConfigurations(item, options)); + } + arcAgentryConfigurations = array; + continue; + } + if (property0.NameEquals("miscellaneousProperties"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetString()); + } + miscellaneousProperties = dictionary; + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedClusterData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + identity, + kind, + agentPublicKeyCertificate, + kubernetesVersion, + totalNodeCount, + totalCoreCount, + agentVersion, + provisioningState, + distribution, + distributionVersion, + infrastructure, + offering, + managedIdentityCertificateExpirationTime, + lastConnectivityTime, + connectivityStatus, + privateLinkState, + privateLinkScopeResourceId, + azureHybridBenefit, + aadProfile, + arcAgentProfile, + securityProfile, + oidcIssuerProfile, + gateway, + arcAgentryConfigurations ?? new ChangeTrackingList(), + miscellaneousProperties ?? 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, AzureResourceManagerHybridkubernetesContext.Default); + default: + throw new FormatException($"The model {nameof(ConnectedClusterData)} does not support writing '{options.Format}' format."); + } + } + + ConnectedClusterData 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 DeserializeConnectedClusterData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedClusterData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/ConnectedClusterData.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/ConnectedClusterData.cs new file mode 100644 index 000000000000..b9ea6fa8094e --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/ConnectedClusterData.cs @@ -0,0 +1,201 @@ +// 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.Hybridkubernetes.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Hybridkubernetes +{ + /// + /// A class representing the ConnectedCluster data model. + /// Represents a connected cluster. + /// + public partial class ConnectedClusterData : 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. + /// The identity of the connected cluster. Current supported identity types: None, SystemAssigned. + /// Base64 encoded public certificate used by the agent to do the initial handshake to the backend services in Azure. + /// or is null. + public ConnectedClusterData(AzureLocation location, ManagedServiceIdentity identity, string agentPublicKeyCertificate) : base(location) + { + Argument.AssertNotNull(identity, nameof(identity)); + Argument.AssertNotNull(agentPublicKeyCertificate, nameof(agentPublicKeyCertificate)); + + Identity = identity; + AgentPublicKeyCertificate = agentPublicKeyCertificate; + ArcAgentryConfigurations = new ChangeTrackingList(); + MiscellaneousProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The identity of the connected cluster. Current supported identity types: None, SystemAssigned. + /// The kind of connected cluster. + /// Base64 encoded public certificate used by the agent to do the initial handshake to the backend services in Azure. + /// The Kubernetes version of the connected cluster resource. + /// Number of nodes present in the connected cluster resource. + /// Number of CPU cores present in the connected cluster resource. + /// Version of the agent running on the connected cluster resource. + /// Provisioning state of the connected cluster resource. + /// The Kubernetes distribution running on this connected cluster. + /// The Kubernetes distribution version on this connected cluster. + /// The infrastructure on which the Kubernetes cluster represented by this connected cluster is running on. + /// Connected cluster offering. + /// Expiration time of the managed identity certificate. + /// Time representing the last instance when heart beat was received from the cluster. + /// Represents the connectivity status of the connected cluster. + /// Property which describes the state of private link on a connected cluster resource. + /// This is populated only if privateLinkState is enabled. The resource id of the private link scope this connected cluster is assigned to, if any. + /// Indicates whether Azure Hybrid Benefit is opted in. + /// AAD profile for the connected cluster. + /// Arc agentry configuration for the provisioned cluster. + /// Security profile for the connected cluster. + /// Open ID Connect (OIDC) Issuer Profile for the connected cluster. + /// Details of the gateway used by the Arc router for connectivity. + /// Configuration settings for customizing the behavior of the connected cluster. + /// More properties related to the Connected Cluster. + /// Keeps track of any properties unknown to the library. + internal ConnectedClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, ConnectedClusterKind? kind, string agentPublicKeyCertificate, string kubernetesVersion, int? totalNodeCount, int? totalCoreCount, string agentVersion, ProvisioningState? provisioningState, string distribution, string distributionVersion, string infrastructure, string offering, DateTimeOffset? managedIdentityCertificateExpirationOn, DateTimeOffset? lastConnectivityOn, ConnectivityStatus? connectivityStatus, PrivateLinkState? privateLinkState, string privateLinkScopeResourceId, AzureHybridBenefit? azureHybridBenefit, AadProfile aadProfile, ArcAgentProfile arcAgentProfile, SecurityProfile securityProfile, OidcIssuerProfile oidcIssuerProfile, Gateway gateway, IList arcAgentryConfigurations, IReadOnlyDictionary miscellaneousProperties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Identity = identity; + Kind = kind; + AgentPublicKeyCertificate = agentPublicKeyCertificate; + KubernetesVersion = kubernetesVersion; + TotalNodeCount = totalNodeCount; + TotalCoreCount = totalCoreCount; + AgentVersion = agentVersion; + ProvisioningState = provisioningState; + Distribution = distribution; + DistributionVersion = distributionVersion; + Infrastructure = infrastructure; + Offering = offering; + ManagedIdentityCertificateExpirationOn = managedIdentityCertificateExpirationOn; + LastConnectivityOn = lastConnectivityOn; + ConnectivityStatus = connectivityStatus; + PrivateLinkState = privateLinkState; + PrivateLinkScopeResourceId = privateLinkScopeResourceId; + AzureHybridBenefit = azureHybridBenefit; + AadProfile = aadProfile; + ArcAgentProfile = arcAgentProfile; + SecurityProfile = securityProfile; + OidcIssuerProfile = oidcIssuerProfile; + Gateway = gateway; + ArcAgentryConfigurations = arcAgentryConfigurations; + MiscellaneousProperties = miscellaneousProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConnectedClusterData() + { + } + + /// The identity of the connected cluster. Current supported identity types: None, SystemAssigned. + public ManagedServiceIdentity Identity { get; set; } + /// The kind of connected cluster. + public ConnectedClusterKind? Kind { get; set; } + /// Base64 encoded public certificate used by the agent to do the initial handshake to the backend services in Azure. + public string AgentPublicKeyCertificate { get; set; } + /// The Kubernetes version of the connected cluster resource. + public string KubernetesVersion { get; } + /// Number of nodes present in the connected cluster resource. + public int? TotalNodeCount { get; } + /// Number of CPU cores present in the connected cluster resource. + public int? TotalCoreCount { get; } + /// Version of the agent running on the connected cluster resource. + public string AgentVersion { get; } + /// Provisioning state of the connected cluster resource. + public ProvisioningState? ProvisioningState { get; set; } + /// The Kubernetes distribution running on this connected cluster. + public string Distribution { get; set; } + /// The Kubernetes distribution version on this connected cluster. + public string DistributionVersion { get; set; } + /// The infrastructure on which the Kubernetes cluster represented by this connected cluster is running on. + public string Infrastructure { get; set; } + /// Connected cluster offering. + public string Offering { get; } + /// Expiration time of the managed identity certificate. + public DateTimeOffset? ManagedIdentityCertificateExpirationOn { get; } + /// Time representing the last instance when heart beat was received from the cluster. + public DateTimeOffset? LastConnectivityOn { get; } + /// Represents the connectivity status of the connected cluster. + public ConnectivityStatus? ConnectivityStatus { get; } + /// Property which describes the state of private link on a connected cluster resource. + public PrivateLinkState? PrivateLinkState { get; set; } + /// This is populated only if privateLinkState is enabled. The resource id of the private link scope this connected cluster is assigned to, if any. + public string PrivateLinkScopeResourceId { get; set; } + /// Indicates whether Azure Hybrid Benefit is opted in. + public AzureHybridBenefit? AzureHybridBenefit { get; set; } + /// AAD profile for the connected cluster. + public AadProfile AadProfile { get; set; } + /// Arc agentry configuration for the provisioned cluster. + public ArcAgentProfile ArcAgentProfile { get; set; } + /// Security profile for the connected cluster. + internal SecurityProfile SecurityProfile { get; set; } + /// Whether to enable or disable the workload identity Webhook. + public bool? WorkloadIdentityEnabled + { + get => SecurityProfile is null ? default : SecurityProfile.WorkloadIdentityEnabled; + set + { + if (SecurityProfile is null) + SecurityProfile = new SecurityProfile(); + SecurityProfile.WorkloadIdentityEnabled = value; + } + } + + /// Open ID Connect (OIDC) Issuer Profile for the connected cluster. + public OidcIssuerProfile OidcIssuerProfile { get; set; } + /// Details of the gateway used by the Arc router for connectivity. + public Gateway Gateway { get; set; } + /// Configuration settings for customizing the behavior of the connected cluster. + public IList ArcAgentryConfigurations { get; set; } + /// More properties related to the Connected Cluster. + public IReadOnlyDictionary MiscellaneousProperties { get; } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/ConnectedClusterResource.Serialization.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/ConnectedClusterResource.Serialization.cs new file mode 100644 index 000000000000..9df13b9c85ff --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/ConnectedClusterResource.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.Hybridkubernetes +{ + public partial class ConnectedClusterResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ConnectedClusterData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerHybridkubernetesContext.Default); + + ConnectedClusterData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerHybridkubernetesContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/ConnectedClusterResource.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/ConnectedClusterResource.cs new file mode 100644 index 000000000000..7c967cb41a77 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/ConnectedClusterResource.cs @@ -0,0 +1,783 @@ +// 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.Hybridkubernetes.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Hybridkubernetes +{ + /// + /// A Class representing a ConnectedCluster along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetConnectedClusterResource method. + /// Otherwise you can get one from its parent resource using the GetConnectedCluster method. + /// + public partial class ConnectedClusterResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The clusterName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string clusterName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _connectedClusterClientDiagnostics; + private readonly ConnectedClustersRestOperations _connectedClusterRestClient; + private readonly ConnectedClusterData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Kubernetes/connectedClusters"; + + /// Initializes a new instance of the class for mocking. + protected ConnectedClusterResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ConnectedClusterResource(ArmClient client, ConnectedClusterData 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 ConnectedClusterResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _connectedClusterClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Hybridkubernetes", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string connectedClusterApiVersion); + _connectedClusterRestClient = new ConnectedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, connectedClusterApiVersion); +#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 ConnectedClusterData 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)); + } + + /// + /// Returns the properties of the specified connected cluster, including name, identity, properties, and additional cluster details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_Get + /// + /// + /// Default Api Version + /// 2024-12-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _connectedClusterClientDiagnostics.CreateScope("ConnectedClusterResource.Get"); + scope.Start(); + try + { + var response = await _connectedClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns the properties of the specified connected cluster, including name, identity, properties, and additional cluster details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_Get + /// + /// + /// Default Api Version + /// 2024-12-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _connectedClusterClientDiagnostics.CreateScope("ConnectedClusterResource.Get"); + scope.Start(); + try + { + var response = _connectedClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ConnectedClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_Delete + /// + /// + /// Default Api Version + /// 2024-12-01-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 = _connectedClusterClientDiagnostics.CreateScope("ConnectedClusterResource.Delete"); + scope.Start(); + try + { + var response = await _connectedClusterRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new HybridkubernetesArmOperation(_connectedClusterClientDiagnostics, Pipeline, _connectedClusterRestClient.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; + } + } + + /// + /// Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_Delete + /// + /// + /// Default Api Version + /// 2024-12-01-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 = _connectedClusterClientDiagnostics.CreateScope("ConnectedClusterResource.Delete"); + scope.Start(); + try + { + var response = _connectedClusterRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new HybridkubernetesArmOperation(_connectedClusterClientDiagnostics, Pipeline, _connectedClusterRestClient.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; + } + } + + /// + /// API to update certain properties of the connected cluster resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_Update + /// + /// + /// Default Api Version + /// 2024-12-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Parameters supplied to update Connected Cluster. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(ConnectedClusterPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _connectedClusterClientDiagnostics.CreateScope("ConnectedClusterResource.Update"); + scope.Start(); + try + { + var response = await _connectedClusterRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ConnectedClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// API to update certain properties of the connected cluster resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_Update + /// + /// + /// Default Api Version + /// 2024-12-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Parameters supplied to update Connected Cluster. + /// The cancellation token to use. + /// is null. + public virtual Response Update(ConnectedClusterPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _connectedClusterClientDiagnostics.CreateScope("ConnectedClusterResource.Update"); + scope.Start(); + try + { + var response = _connectedClusterRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + return Response.FromValue(new ConnectedClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets cluster user credentials of the connected cluster with a specified resource group and name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}/listClusterUserCredential + /// + /// + /// Operation Id + /// ConnectedClusters_ListClusterUserCredential + /// + /// + /// Default Api Version + /// 2024-12-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ListClusterUserCredential properties. + /// The cancellation token to use. + /// is null. + public virtual async Task> GetClusterUserCredentialAsync(ListClusterUserCredentialProperties properties, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(properties, nameof(properties)); + + using var scope = _connectedClusterClientDiagnostics.CreateScope("ConnectedClusterResource.GetClusterUserCredential"); + scope.Start(); + try + { + var response = await _connectedClusterRestClient.ListClusterUserCredentialAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, properties, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets cluster user credentials of the connected cluster with a specified resource group and name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}/listClusterUserCredential + /// + /// + /// Operation Id + /// ConnectedClusters_ListClusterUserCredential + /// + /// + /// Default Api Version + /// 2024-12-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// ListClusterUserCredential properties. + /// The cancellation token to use. + /// is null. + public virtual Response GetClusterUserCredential(ListClusterUserCredentialProperties properties, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(properties, nameof(properties)); + + using var scope = _connectedClusterClientDiagnostics.CreateScope("ConnectedClusterResource.GetClusterUserCredential"); + scope.Start(); + try + { + var response = _connectedClusterRestClient.ListClusterUserCredential(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, properties, 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.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_Get + /// + /// + /// Default Api Version + /// 2024-12-01-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 = _connectedClusterClientDiagnostics.CreateScope("ConnectedClusterResource.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 _connectedClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ConnectedClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ConnectedClusterPatch(); + 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.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_Get + /// + /// + /// Default Api Version + /// 2024-12-01-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 = _connectedClusterClientDiagnostics.CreateScope("ConnectedClusterResource.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 = _connectedClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ConnectedClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ConnectedClusterPatch(); + 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.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_Get + /// + /// + /// Default Api Version + /// 2024-12-01-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 = _connectedClusterClientDiagnostics.CreateScope("ConnectedClusterResource.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 _connectedClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ConnectedClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ConnectedClusterPatch(); + 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.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_Get + /// + /// + /// Default Api Version + /// 2024-12-01-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 = _connectedClusterClientDiagnostics.CreateScope("ConnectedClusterResource.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 = _connectedClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ConnectedClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ConnectedClusterPatch(); + 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.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_Get + /// + /// + /// Default Api Version + /// 2024-12-01-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 = _connectedClusterClientDiagnostics.CreateScope("ConnectedClusterResource.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 _connectedClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ConnectedClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ConnectedClusterPatch(); + 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.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_Get + /// + /// + /// Default Api Version + /// 2024-12-01-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 = _connectedClusterClientDiagnostics.CreateScope("ConnectedClusterResource.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 = _connectedClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ConnectedClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ConnectedClusterPatch(); + 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/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Extensions/HybridkubernetesExtensions.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Extensions/HybridkubernetesExtensions.cs new file mode 100644 index 000000000000..dbfd9c9553d7 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Extensions/HybridkubernetesExtensions.cs @@ -0,0 +1,219 @@ +// 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.Hybridkubernetes.Mocking; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Hybridkubernetes +{ + /// A class to add extension methods to Azure.ResourceManager.Hybridkubernetes. + public static partial class HybridkubernetesExtensions + { + private static MockableHybridkubernetesArmClient GetMockableHybridkubernetesArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableHybridkubernetesArmClient(client0)); + } + + private static MockableHybridkubernetesResourceGroupResource GetMockableHybridkubernetesResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableHybridkubernetesResourceGroupResource(client, resource.Id)); + } + + private static MockableHybridkubernetesSubscriptionResource GetMockableHybridkubernetesSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableHybridkubernetesSubscriptionResource(client, resource.Id)); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ConnectedClusterResource GetConnectedClusterResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableHybridkubernetesArmClient(client).GetConnectedClusterResource(id); + } + + /// + /// Gets a collection of ConnectedClusterResources 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 ConnectedClusterResources and their operations over a ConnectedClusterResource. + public static ConnectedClusterCollection GetConnectedClusters(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableHybridkubernetesResourceGroupResource(resourceGroupResource).GetConnectedClusters(); + } + + /// + /// Returns the properties of the specified connected cluster, including name, identity, properties, and additional cluster details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_Get + /// + /// + /// Default Api Version + /// 2024-12-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Kubernetes cluster on which get is called. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetConnectedClusterAsync(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableHybridkubernetesResourceGroupResource(resourceGroupResource).GetConnectedClusterAsync(clusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns the properties of the specified connected cluster, including name, identity, properties, and additional cluster details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_Get + /// + /// + /// Default Api Version + /// 2024-12-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Kubernetes cluster on which get is called. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetConnectedCluster(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableHybridkubernetesResourceGroupResource(resourceGroupResource).GetConnectedCluster(clusterName, cancellationToken); + } + + /// + /// API to enumerate registered connected K8s clusters under a Subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Kubernetes/connectedClusters + /// + /// + /// Operation Id + /// ConnectedCluster_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-12-01-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 GetConnectedClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableHybridkubernetesSubscriptionResource(subscriptionResource).GetConnectedClustersAsync(cancellationToken); + } + + /// + /// API to enumerate registered connected K8s clusters under a Subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Kubernetes/connectedClusters + /// + /// + /// Operation Id + /// ConnectedCluster_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-12-01-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 GetConnectedClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableHybridkubernetesSubscriptionResource(subscriptionResource).GetConnectedClusters(cancellationToken); + } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Extensions/MockableHybridkubernetesArmClient.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Extensions/MockableHybridkubernetesArmClient.cs new file mode 100644 index 000000000000..a1d3b773bfcd --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Extensions/MockableHybridkubernetesArmClient.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.Hybridkubernetes.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableHybridkubernetesArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableHybridkubernetesArmClient() + { + } + + /// 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 MockableHybridkubernetesArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableHybridkubernetesArmClient(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ConnectedClusterResource GetConnectedClusterResource(ResourceIdentifier id) + { + ConnectedClusterResource.ValidateResourceId(id); + return new ConnectedClusterResource(Client, id); + } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Extensions/MockableHybridkubernetesResourceGroupResource.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Extensions/MockableHybridkubernetesResourceGroupResource.cs new file mode 100644 index 000000000000..442609053cd3 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Extensions/MockableHybridkubernetesResourceGroupResource.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Hybridkubernetes.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableHybridkubernetesResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableHybridkubernetesResourceGroupResource() + { + } + + /// 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 MockableHybridkubernetesResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ConnectedClusterResources in the ResourceGroupResource. + /// An object representing collection of ConnectedClusterResources and their operations over a ConnectedClusterResource. + public virtual ConnectedClusterCollection GetConnectedClusters() + { + return GetCachedClient(client => new ConnectedClusterCollection(client, Id)); + } + + /// + /// Returns the properties of the specified connected cluster, including name, identity, properties, and additional cluster details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_Get + /// + /// + /// Default Api Version + /// 2024-12-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Kubernetes cluster on which get is called. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetConnectedClusterAsync(string clusterName, CancellationToken cancellationToken = default) + { + return await GetConnectedClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns the properties of the specified connected cluster, including name, identity, properties, and additional cluster details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_Get + /// + /// + /// Default Api Version + /// 2024-12-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Kubernetes cluster on which get is called. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetConnectedCluster(string clusterName, CancellationToken cancellationToken = default) + { + return GetConnectedClusters().Get(clusterName, cancellationToken); + } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Extensions/MockableHybridkubernetesSubscriptionResource.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Extensions/MockableHybridkubernetesSubscriptionResource.cs new file mode 100644 index 000000000000..fe84510710b1 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Extensions/MockableHybridkubernetesSubscriptionResource.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Hybridkubernetes.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableHybridkubernetesSubscriptionResource : ArmResource + { + private ClientDiagnostics _connectedClusterClientDiagnostics; + private ConnectedClustersRestOperations _connectedClusterRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableHybridkubernetesSubscriptionResource() + { + } + + /// 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 MockableHybridkubernetesSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics ConnectedClusterClientDiagnostics => _connectedClusterClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Hybridkubernetes", ConnectedClusterResource.ResourceType.Namespace, Diagnostics); + private ConnectedClustersRestOperations ConnectedClusterRestClient => _connectedClusterRestClient ??= new ConnectedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ConnectedClusterResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// API to enumerate registered connected K8s clusters under a Subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Kubernetes/connectedClusters + /// + /// + /// Operation Id + /// ConnectedCluster_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-12-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetConnectedClustersAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ConnectedClusterRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ConnectedClusterRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ConnectedClusterResource(Client, ConnectedClusterData.DeserializeConnectedClusterData(e)), ConnectedClusterClientDiagnostics, Pipeline, "MockableHybridkubernetesSubscriptionResource.GetConnectedClusters", "value", "nextLink", cancellationToken); + } + + /// + /// API to enumerate registered connected K8s clusters under a Subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Kubernetes/connectedClusters + /// + /// + /// Operation Id + /// ConnectedCluster_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-12-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetConnectedClusters(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ConnectedClusterRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ConnectedClusterRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ConnectedClusterResource(Client, ConnectedClusterData.DeserializeConnectedClusterData(e)), ConnectedClusterClientDiagnostics, Pipeline, "MockableHybridkubernetesSubscriptionResource.GetConnectedClusters", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Internal/Argument.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..c048339dbca0 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/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.Hybridkubernetes +{ + 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/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..af5ecb499f67 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/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.Hybridkubernetes +{ + 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/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Internal/ChangeTrackingList.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..c2d3f4340a46 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/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.Hybridkubernetes +{ + 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/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..e7170698f8f7 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,407 @@ +// 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.Hybridkubernetes +{ + internal static class ModelSerializationExtensions + { + internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions { MaxDepth = 256 }; + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + internal static readonly BinaryData SentinelValue = BinaryData.FromBytes("\"__EMPTY__\""u8.ToArray()); + + 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 bool IsSentinelValue(BinaryData value) + { + ReadOnlySpan sentinelSpan = SentinelValue.ToMemory().Span; + ReadOnlySpan valueSpan = value.ToMemory().Span; + return sentinelSpan.SequenceEqual(valueSpan); + } + + 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/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Internal/Optional.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..4b59ab3851c6 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/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.Hybridkubernetes +{ + 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/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..59d2009c7245 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/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.Hybridkubernetes +{ + 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/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/LongRunningOperation/ConnectedClusterOperationSource.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/LongRunningOperation/ConnectedClusterOperationSource.cs new file mode 100644 index 000000000000..0f113d81f686 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/LongRunningOperation/ConnectedClusterOperationSource.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.Hybridkubernetes +{ + internal class ConnectedClusterOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ConnectedClusterOperationSource(ArmClient client) + { + _client = client; + } + + ConnectedClusterResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerHybridkubernetesContext.Default); + return new ConnectedClusterResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerHybridkubernetesContext.Default); + return await Task.FromResult(new ConnectedClusterResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/LongRunningOperation/HybridkubernetesArmOperation.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/LongRunningOperation/HybridkubernetesArmOperation.cs new file mode 100644 index 000000000000..5775cd613c17 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/LongRunningOperation/HybridkubernetesArmOperation.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.Hybridkubernetes +{ +#pragma warning disable SA1649 // File name should match first type name + internal class HybridkubernetesArmOperation : 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 HybridkubernetesArmOperation for mocking. + protected HybridkubernetesArmOperation() + { + } + + internal HybridkubernetesArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal HybridkubernetesArmOperation(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, "HybridkubernetesArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json, AzureResourceManagerHybridkubernetesContext.Default).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/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/LongRunningOperation/HybridkubernetesArmOperationOfT.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/LongRunningOperation/HybridkubernetesArmOperationOfT.cs new file mode 100644 index 000000000000..15ee1090102e --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/LongRunningOperation/HybridkubernetesArmOperationOfT.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.Hybridkubernetes +{ +#pragma warning disable SA1649 // File name should match first type name + internal class HybridkubernetesArmOperation : 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 HybridkubernetesArmOperation for mocking. + protected HybridkubernetesArmOperation() + { + } + + internal HybridkubernetesArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal HybridkubernetesArmOperation(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, "HybridkubernetesArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json, AzureResourceManagerHybridkubernetesContext.Default).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/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/AadProfile.Serialization.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/AadProfile.Serialization.cs new file mode 100644 index 000000000000..0989bccdd963 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/AadProfile.Serialization.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Hybridkubernetes.Models +{ + public partial class AadProfile : 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(AadProfile)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(EnableAzureRBAC)) + { + writer.WritePropertyName("enableAzureRBAC"u8); + writer.WriteBooleanValue(EnableAzureRBAC.Value); + } + if (Optional.IsCollectionDefined(AdminGroupObjectIds)) + { + writer.WritePropertyName("adminGroupObjectIDs"u8); + writer.WriteStartArray(); + foreach (var item in AdminGroupObjectIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(TenantId)) + { + writer.WritePropertyName("tenantID"u8); + writer.WriteStringValue(TenantId); + } + 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 + } + } + } + + AadProfile 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(AadProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAadProfile(document.RootElement, options); + } + + internal static AadProfile DeserializeAadProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enableAzureRBAC = default; + IList adminGroupObjectIds = default; + string tenantId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enableAzureRBAC"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableAzureRBAC = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("adminGroupObjectIDs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + adminGroupObjectIds = array; + continue; + } + if (property.NameEquals("tenantID"u8)) + { + tenantId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AadProfile(enableAzureRBAC, adminGroupObjectIds ?? new ChangeTrackingList(), tenantId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerHybridkubernetesContext.Default); + default: + throw new FormatException($"The model {nameof(AadProfile)} does not support writing '{options.Format}' format."); + } + } + + AadProfile 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 DeserializeAadProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AadProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/AadProfile.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/AadProfile.cs new file mode 100644 index 000000000000..cc80d714f61f --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/AadProfile.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.Hybridkubernetes.Models +{ + /// AAD Profile specifies attributes for Azure Active Directory integration. + public partial class AadProfile + { + /// + /// 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 AadProfile() + { + AdminGroupObjectIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Whether to enable Azure RBAC for Kubernetes authorization. + /// The list of AAD group object IDs that will have admin role of the cluster. + /// The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. + /// Keeps track of any properties unknown to the library. + internal AadProfile(bool? enableAzureRBAC, IList adminGroupObjectIds, string tenantId, IDictionary serializedAdditionalRawData) + { + EnableAzureRBAC = enableAzureRBAC; + AdminGroupObjectIds = adminGroupObjectIds; + TenantId = tenantId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Whether to enable Azure RBAC for Kubernetes authorization. + public bool? EnableAzureRBAC { get; set; } + /// The list of AAD group object IDs that will have admin role of the cluster. + public IList AdminGroupObjectIds { get; } + /// The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. + public string TenantId { get; set; } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/AgentError.Serialization.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/AgentError.Serialization.cs new file mode 100644 index 000000000000..64e20341567d --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/AgentError.Serialization.cs @@ -0,0 +1,166 @@ +// 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.Hybridkubernetes.Models +{ + public partial class AgentError : 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(AgentError)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (options.Format != "W" && Optional.IsDefined(Severity)) + { + writer.WritePropertyName("severity"u8); + writer.WriteStringValue(Severity); + } + if (options.Format != "W" && Optional.IsDefined(Component)) + { + writer.WritePropertyName("component"u8); + writer.WriteStringValue(Component); + } + if (options.Format != "W" && Optional.IsDefined(Time)) + { + writer.WritePropertyName("time"u8); + writer.WriteStringValue(Time.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 + } + } + } + + AgentError 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(AgentError)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAgentError(document.RootElement, options); + } + + internal static AgentError DeserializeAgentError(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string message = default; + string severity = default; + string component = default; + DateTimeOffset? time = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("severity"u8)) + { + severity = property.Value.GetString(); + continue; + } + if (property.NameEquals("component"u8)) + { + component = property.Value.GetString(); + continue; + } + if (property.NameEquals("time"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + time = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AgentError(message, severity, component, time, 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, AzureResourceManagerHybridkubernetesContext.Default); + default: + throw new FormatException($"The model {nameof(AgentError)} does not support writing '{options.Format}' format."); + } + } + + AgentError 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 DeserializeAgentError(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AgentError)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/AgentError.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/AgentError.cs new file mode 100644 index 000000000000..709ad6e9c8bf --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/AgentError.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.Hybridkubernetes.Models +{ + /// Agent Errors if any during agent or system component upgrade. + public partial class AgentError + { + /// + /// 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 AgentError() + { + } + + /// Initializes a new instance of . + /// Agent error message. + /// Severity of the error message. + /// Agent component where error message occured. + /// The timestamp of error occured (UTC). + /// Keeps track of any properties unknown to the library. + internal AgentError(string message, string severity, string component, DateTimeOffset? time, IDictionary serializedAdditionalRawData) + { + Message = message; + Severity = severity; + Component = component; + Time = time; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Agent error message. + public string Message { get; } + /// Severity of the error message. + public string Severity { get; } + /// Agent component where error message occured. + public string Component { get; } + /// The timestamp of error occured (UTC). + public DateTimeOffset? Time { get; } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ArcAgentProfile.Serialization.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ArcAgentProfile.Serialization.cs new file mode 100644 index 000000000000..e2e42decc500 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ArcAgentProfile.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.Hybridkubernetes.Models +{ + public partial class ArcAgentProfile : 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(ArcAgentProfile)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DesiredAgentVersion)) + { + writer.WritePropertyName("desiredAgentVersion"u8); + writer.WriteStringValue(DesiredAgentVersion); + } + if (Optional.IsDefined(AgentAutoUpgrade)) + { + writer.WritePropertyName("agentAutoUpgrade"u8); + writer.WriteStringValue(AgentAutoUpgrade.Value.ToString()); + } + if (Optional.IsCollectionDefined(SystemComponents)) + { + writer.WritePropertyName("systemComponents"u8); + writer.WriteStartArray(); + foreach (var item in SystemComponents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(AgentErrors)) + { + writer.WritePropertyName("agentErrors"u8); + writer.WriteStartArray(); + foreach (var item in AgentErrors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(AgentState)) + { + writer.WritePropertyName("agentState"u8); + writer.WriteStringValue(AgentState); + } + 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 + } + } + } + + ArcAgentProfile 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(ArcAgentProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeArcAgentProfile(document.RootElement, options); + } + + internal static ArcAgentProfile DeserializeArcAgentProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string desiredAgentVersion = default; + AutoUpgradeOption? agentAutoUpgrade = default; + IList systemComponents = default; + IList agentErrors = default; + string agentState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("desiredAgentVersion"u8)) + { + desiredAgentVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("agentAutoUpgrade"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + agentAutoUpgrade = new AutoUpgradeOption(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemComponents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SystemComponent.DeserializeSystemComponent(item, options)); + } + systemComponents = array; + continue; + } + if (property.NameEquals("agentErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AgentError.DeserializeAgentError(item, options)); + } + agentErrors = array; + continue; + } + if (property.NameEquals("agentState"u8)) + { + agentState = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ArcAgentProfile( + desiredAgentVersion, + agentAutoUpgrade, + systemComponents ?? new ChangeTrackingList(), + agentErrors ?? new ChangeTrackingList(), + agentState, + 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, AzureResourceManagerHybridkubernetesContext.Default); + default: + throw new FormatException($"The model {nameof(ArcAgentProfile)} does not support writing '{options.Format}' format."); + } + } + + ArcAgentProfile 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 DeserializeArcAgentProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ArcAgentProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ArcAgentProfile.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ArcAgentProfile.cs new file mode 100644 index 000000000000..fadcdcf3a36a --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ArcAgentProfile.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; + +namespace Azure.ResourceManager.Hybridkubernetes.Models +{ + /// Defines the Arc Agent properties for the clusters. + public partial class ArcAgentProfile + { + /// + /// 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 ArcAgentProfile() + { + SystemComponents = new ChangeTrackingList(); + AgentErrors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Version of the Arc agents to be installed on the cluster resource. + /// Indicates whether the Arc agents on the be upgraded automatically to the latest version. Defaults to Enabled. + /// List of system extensions that are installed on the cluster resource. + /// List of arc agentry and system components errors on the cluster resource. + /// Represents the current state of the Arc agentry and its dependent components. + /// Keeps track of any properties unknown to the library. + internal ArcAgentProfile(string desiredAgentVersion, AutoUpgradeOption? agentAutoUpgrade, IList systemComponents, IList agentErrors, string agentState, IDictionary serializedAdditionalRawData) + { + DesiredAgentVersion = desiredAgentVersion; + AgentAutoUpgrade = agentAutoUpgrade; + SystemComponents = systemComponents; + AgentErrors = agentErrors; + AgentState = agentState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Version of the Arc agents to be installed on the cluster resource. + public string DesiredAgentVersion { get; set; } + /// Indicates whether the Arc agents on the be upgraded automatically to the latest version. Defaults to Enabled. + public AutoUpgradeOption? AgentAutoUpgrade { get; set; } + /// List of system extensions that are installed on the cluster resource. + public IList SystemComponents { get; } + /// List of arc agentry and system components errors on the cluster resource. + public IList AgentErrors { get; } + /// Represents the current state of the Arc agentry and its dependent components. + public string AgentState { get; } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ArcAgentryConfigurations.Serialization.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ArcAgentryConfigurations.Serialization.cs new file mode 100644 index 000000000000..023c02093d13 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ArcAgentryConfigurations.Serialization.cs @@ -0,0 +1,195 @@ +// 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.Hybridkubernetes.Models +{ + public partial class ArcAgentryConfigurations : 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(ArcAgentryConfigurations)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Feature)) + { + writer.WritePropertyName("feature"u8); + writer.WriteStringValue(Feature); + } + if (Optional.IsCollectionDefined(Settings)) + { + if (Settings != null) + { + writer.WritePropertyName("settings"u8); + writer.WriteStartObject(); + foreach (var item in Settings) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + else + { + writer.WriteNull("settings"); + } + } + if (Optional.IsCollectionDefined(ProtectedSettings)) + { + if (ProtectedSettings != null) + { + writer.WritePropertyName("protectedSettings"u8); + writer.WriteStartObject(); + foreach (var item in ProtectedSettings) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + else + { + writer.WriteNull("protectedSettings"); + } + } + 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 + } + } + } + + ArcAgentryConfigurations 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(ArcAgentryConfigurations)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeArcAgentryConfigurations(document.RootElement, options); + } + + internal static ArcAgentryConfigurations DeserializeArcAgentryConfigurations(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string feature = default; + IDictionary settings = default; + IDictionary protectedSettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("feature"u8)) + { + feature = property.Value.GetString(); + continue; + } + if (property.NameEquals("settings"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()); + } + settings = dictionary; + continue; + } + if (property.NameEquals("protectedSettings"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()); + } + protectedSettings = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ArcAgentryConfigurations(feature, settings ?? new ChangeTrackingDictionary(), protectedSettings ?? 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, AzureResourceManagerHybridkubernetesContext.Default); + default: + throw new FormatException($"The model {nameof(ArcAgentryConfigurations)} does not support writing '{options.Format}' format."); + } + } + + ArcAgentryConfigurations 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 DeserializeArcAgentryConfigurations(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ArcAgentryConfigurations)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ArcAgentryConfigurations.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ArcAgentryConfigurations.cs new file mode 100644 index 000000000000..b2e1c5c0dbba --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ArcAgentryConfigurations.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Hybridkubernetes.Models +{ + /// The ArcAgentryConfigurations. + public partial class ArcAgentryConfigurations + { + /// + /// 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 ArcAgentryConfigurations() + { + Settings = new ChangeTrackingDictionary(); + ProtectedSettings = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Specifies the name of the feature for the configuration setting. + /// The configuration settings for the feature that do not contain any sensitive or secret information. + /// The configuration settings for the feature that contain any sensitive or secret information. + /// Keeps track of any properties unknown to the library. + internal ArcAgentryConfigurations(string feature, IDictionary settings, IDictionary protectedSettings, IDictionary serializedAdditionalRawData) + { + Feature = feature; + Settings = settings; + ProtectedSettings = protectedSettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies the name of the feature for the configuration setting. + public string Feature { get; set; } + /// The configuration settings for the feature that do not contain any sensitive or secret information. + public IDictionary Settings { get; set; } + /// The configuration settings for the feature that contain any sensitive or secret information. + public IDictionary ProtectedSettings { get; set; } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/AuthenticationMethod.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/AuthenticationMethod.cs new file mode 100644 index 000000000000..2e4c8c3f3479 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/AuthenticationMethod.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.Hybridkubernetes.Models +{ + /// The mode of client authentication. + public readonly partial struct AuthenticationMethod : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AuthenticationMethod(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TokenValue = "Token"; + private const string AADValue = "AAD"; + + /// Token. + public static AuthenticationMethod Token { get; } = new AuthenticationMethod(TokenValue); + /// AAD. + public static AuthenticationMethod AAD { get; } = new AuthenticationMethod(AADValue); + /// Determines if two values are the same. + public static bool operator ==(AuthenticationMethod left, AuthenticationMethod right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AuthenticationMethod left, AuthenticationMethod right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AuthenticationMethod(string value) => new AuthenticationMethod(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AuthenticationMethod other && Equals(other); + /// + public bool Equals(AuthenticationMethod 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/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/AutoUpgradeOption.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/AutoUpgradeOption.cs new file mode 100644 index 000000000000..0ce283b9f4aa --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/AutoUpgradeOption.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.Hybridkubernetes.Models +{ + /// Indicates whether the Arc agents on the be upgraded automatically to the latest version. Defaults to Enabled. + public readonly partial struct AutoUpgradeOption : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AutoUpgradeOption(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Enabled. + public static AutoUpgradeOption Enabled { get; } = new AutoUpgradeOption(EnabledValue); + /// Disabled. + public static AutoUpgradeOption Disabled { get; } = new AutoUpgradeOption(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(AutoUpgradeOption left, AutoUpgradeOption right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AutoUpgradeOption left, AutoUpgradeOption right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AutoUpgradeOption(string value) => new AutoUpgradeOption(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AutoUpgradeOption other && Equals(other); + /// + public bool Equals(AutoUpgradeOption 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/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/AzureHybridBenefit.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/AzureHybridBenefit.cs new file mode 100644 index 000000000000..d8de134b710d --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/AzureHybridBenefit.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.Hybridkubernetes.Models +{ + /// Indicates whether Azure Hybrid Benefit is opted in. + public readonly partial struct AzureHybridBenefit : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureHybridBenefit(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TrueValue = "True"; + private const string FalseValue = "False"; + private const string NotApplicableValue = "NotApplicable"; + + /// True. + public static AzureHybridBenefit True { get; } = new AzureHybridBenefit(TrueValue); + /// False. + public static AzureHybridBenefit False { get; } = new AzureHybridBenefit(FalseValue); + /// NotApplicable. + public static AzureHybridBenefit NotApplicable { get; } = new AzureHybridBenefit(NotApplicableValue); + /// Determines if two values are the same. + public static bool operator ==(AzureHybridBenefit left, AzureHybridBenefit right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureHybridBenefit left, AzureHybridBenefit right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureHybridBenefit(string value) => new AzureHybridBenefit(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureHybridBenefit other && Equals(other); + /// + public bool Equals(AzureHybridBenefit 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/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/AzureResourceManagerHybridkubernetesContext.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/AzureResourceManagerHybridkubernetesContext.cs new file mode 100644 index 000000000000..5ee9103f906a --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/AzureResourceManagerHybridkubernetesContext.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Azure.ResourceManager.Hybridkubernetes +{ + /// + /// Context class which will be filled in by the System.ClientModel.SourceGeneration. + /// For more information see 'https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/System.ClientModel/src/docs/ModelReaderWriterContext.md' + /// + public partial class AzureResourceManagerHybridkubernetesContext : ModelReaderWriterContext + { + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ConnectedClusterKind.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ConnectedClusterKind.cs new file mode 100644 index 000000000000..45deac4670cb --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ConnectedClusterKind.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.Hybridkubernetes.Models +{ + /// Indicates the kind of Arc connected cluster based on host infrastructure. + public readonly partial struct ConnectedClusterKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ConnectedClusterKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ProvisionedClusterValue = "ProvisionedCluster"; + private const string AWSValue = "AWS"; + + /// ProvisionedCluster. + public static ConnectedClusterKind ProvisionedCluster { get; } = new ConnectedClusterKind(ProvisionedClusterValue); + /// AWS. + public static ConnectedClusterKind AWS { get; } = new ConnectedClusterKind(AWSValue); + /// Determines if two values are the same. + public static bool operator ==(ConnectedClusterKind left, ConnectedClusterKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ConnectedClusterKind left, ConnectedClusterKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ConnectedClusterKind(string value) => new ConnectedClusterKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ConnectedClusterKind other && Equals(other); + /// + public bool Equals(ConnectedClusterKind 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/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ConnectedClusterList.Serialization.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ConnectedClusterList.Serialization.cs new file mode 100644 index 000000000000..fe3117b589fc --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ConnectedClusterList.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.Hybridkubernetes.Models +{ + internal partial class ConnectedClusterList : 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(ConnectedClusterList)} 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 + } + } + } + + ConnectedClusterList 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(ConnectedClusterList)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedClusterList(document.RootElement, options); + } + + internal static ConnectedClusterList DeserializeConnectedClusterList(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(ConnectedClusterData.DeserializeConnectedClusterData(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 ConnectedClusterList(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, AzureResourceManagerHybridkubernetesContext.Default); + default: + throw new FormatException($"The model {nameof(ConnectedClusterList)} does not support writing '{options.Format}' format."); + } + } + + ConnectedClusterList 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 DeserializeConnectedClusterList(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedClusterList)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ConnectedClusterList.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ConnectedClusterList.cs new file mode 100644 index 000000000000..14f599f0f8df --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ConnectedClusterList.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.Hybridkubernetes.Models +{ + /// The paginated list of connected Clusters. + internal partial class ConnectedClusterList + { + /// + /// 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 ConnectedCluster items on this page. + /// is null. + internal ConnectedClusterList(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The ConnectedCluster items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ConnectedClusterList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConnectedClusterList() + { + } + + /// The ConnectedCluster items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ConnectedClusterPatch.Serialization.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ConnectedClusterPatch.Serialization.cs new file mode 100644 index 000000000000..5d1c7db21b70 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ConnectedClusterPatch.Serialization.cs @@ -0,0 +1,196 @@ +// 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.Hybridkubernetes.Models +{ + public partial class ConnectedClusterPatch : 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(ConnectedClusterPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Distribution)) + { + writer.WritePropertyName("distribution"u8); + writer.WriteStringValue(Distribution); + } + if (Optional.IsDefined(DistributionVersion)) + { + writer.WritePropertyName("distributionVersion"u8); + writer.WriteStringValue(DistributionVersion); + } + if (Optional.IsDefined(AzureHybridBenefit)) + { + writer.WritePropertyName("azureHybridBenefit"u8); + writer.WriteStringValue(AzureHybridBenefit.Value.ToString()); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectedClusterPatch 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(ConnectedClusterPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedClusterPatch(document.RootElement, options); + } + + internal static ConnectedClusterPatch DeserializeConnectedClusterPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + string distribution = default; + string distributionVersion = default; + AzureHybridBenefit? azureHybridBenefit = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("distribution"u8)) + { + distribution = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("distributionVersion"u8)) + { + distributionVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("azureHybridBenefit"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureHybridBenefit = new AzureHybridBenefit(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedClusterPatch(tags ?? new ChangeTrackingDictionary(), distribution, distributionVersion, azureHybridBenefit, 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, AzureResourceManagerHybridkubernetesContext.Default); + default: + throw new FormatException($"The model {nameof(ConnectedClusterPatch)} does not support writing '{options.Format}' format."); + } + } + + ConnectedClusterPatch 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 DeserializeConnectedClusterPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedClusterPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ConnectedClusterPatch.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ConnectedClusterPatch.cs new file mode 100644 index 000000000000..0c76fbb3bcaf --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ConnectedClusterPatch.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Hybridkubernetes.Models +{ + /// Object containing updates for patch operations. + public partial class ConnectedClusterPatch + { + /// + /// 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 ConnectedClusterPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// Represents the distribution of the connected cluster. + /// Represents the Kubernetes distribution version on this connected cluster. + /// Indicates whether Azure Hybrid Benefit is opted in. + /// Keeps track of any properties unknown to the library. + internal ConnectedClusterPatch(IDictionary tags, string distribution, string distributionVersion, AzureHybridBenefit? azureHybridBenefit, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Distribution = distribution; + DistributionVersion = distributionVersion; + AzureHybridBenefit = azureHybridBenefit; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// Represents the distribution of the connected cluster. + public string Distribution { get; set; } + /// Represents the Kubernetes distribution version on this connected cluster. + public string DistributionVersion { get; set; } + /// Indicates whether Azure Hybrid Benefit is opted in. + public AzureHybridBenefit? AzureHybridBenefit { get; set; } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ConnectivityStatus.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ConnectivityStatus.cs new file mode 100644 index 000000000000..8b72dc679420 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ConnectivityStatus.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Hybridkubernetes.Models +{ + /// Represents the connectivity status of the connected cluster. + public readonly partial struct ConnectivityStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ConnectivityStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ConnectingValue = "Connecting"; + private const string ConnectedValue = "Connected"; + private const string OfflineValue = "Offline"; + private const string ExpiredValue = "Expired"; + private const string AgentNotInstalledValue = "AgentNotInstalled"; + + /// Connecting. + public static ConnectivityStatus Connecting { get; } = new ConnectivityStatus(ConnectingValue); + /// Connected. + public static ConnectivityStatus Connected { get; } = new ConnectivityStatus(ConnectedValue); + /// Offline. + public static ConnectivityStatus Offline { get; } = new ConnectivityStatus(OfflineValue); + /// Expired. + public static ConnectivityStatus Expired { get; } = new ConnectivityStatus(ExpiredValue); + /// AgentNotInstalled. + public static ConnectivityStatus AgentNotInstalled { get; } = new ConnectivityStatus(AgentNotInstalledValue); + /// Determines if two values are the same. + public static bool operator ==(ConnectivityStatus left, ConnectivityStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ConnectivityStatus left, ConnectivityStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ConnectivityStatus(string value) => new ConnectivityStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ConnectivityStatus other && Equals(other); + /// + public bool Equals(ConnectivityStatus 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/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/CredentialResult.Serialization.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/CredentialResult.Serialization.cs new file mode 100644 index 000000000000..0a13272d940f --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/CredentialResult.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.Hybridkubernetes.Models +{ + public partial class CredentialResult : 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(CredentialResult)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteBase64StringValue(Value, "D"); + } + 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 + } + } + } + + CredentialResult 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(CredentialResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCredentialResult(document.RootElement, options); + } + + internal static CredentialResult DeserializeCredentialResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + byte[] value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + value = property.Value.GetBytesFromBase64("D"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CredentialResult(name, value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerHybridkubernetesContext.Default); + default: + throw new FormatException($"The model {nameof(CredentialResult)} does not support writing '{options.Format}' format."); + } + } + + CredentialResult 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 DeserializeCredentialResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CredentialResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/CredentialResult.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/CredentialResult.cs new file mode 100644 index 000000000000..9629a863e955 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/CredentialResult.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Hybridkubernetes.Models +{ + /// The credential result response. + public partial class CredentialResult + { + /// + /// 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 CredentialResult() + { + } + + /// Initializes a new instance of . + /// The name of the credential. + /// Base64-encoded Kubernetes configuration file. + /// Keeps track of any properties unknown to the library. + internal CredentialResult(string name, byte[] value, IDictionary serializedAdditionalRawData) + { + Name = name; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the credential. + public string Name { get; } + /// Base64-encoded Kubernetes configuration file. + public byte[] Value { get; } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/CredentialResults.Serialization.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/CredentialResults.Serialization.cs new file mode 100644 index 000000000000..d2fd1f2be2ce --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/CredentialResults.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Hybridkubernetes.Models +{ + public partial class CredentialResults : 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(CredentialResults)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(HybridConnectionConfig)) + { + writer.WritePropertyName("hybridConnectionConfig"u8); + writer.WriteObjectValue(HybridConnectionConfig, options); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Kubeconfigs)) + { + writer.WritePropertyName("kubeconfigs"u8); + writer.WriteStartArray(); + foreach (var item in Kubeconfigs) + { + 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 + } + } + } + + CredentialResults 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(CredentialResults)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCredentialResults(document.RootElement, options); + } + + internal static CredentialResults DeserializeCredentialResults(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + HybridConnectionConfig hybridConnectionConfig = default; + IReadOnlyList kubeconfigs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hybridConnectionConfig"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hybridConnectionConfig = HybridConnectionConfig.DeserializeHybridConnectionConfig(property.Value, options); + continue; + } + if (property.NameEquals("kubeconfigs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CredentialResult.DeserializeCredentialResult(item, options)); + } + kubeconfigs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CredentialResults(hybridConnectionConfig, kubeconfigs ?? 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, AzureResourceManagerHybridkubernetesContext.Default); + default: + throw new FormatException($"The model {nameof(CredentialResults)} does not support writing '{options.Format}' format."); + } + } + + CredentialResults 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 DeserializeCredentialResults(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CredentialResults)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/CredentialResults.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/CredentialResults.cs new file mode 100644 index 000000000000..75ab17022428 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/CredentialResults.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Hybridkubernetes.Models +{ + /// The list of credential result response. + public partial class CredentialResults + { + /// + /// 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 CredentialResults() + { + Kubeconfigs = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Contains the REP (rendezvous endpoint) and “Sender” access token. + /// Base64-encoded Kubernetes configuration file. + /// Keeps track of any properties unknown to the library. + internal CredentialResults(HybridConnectionConfig hybridConnectionConfig, IReadOnlyList kubeconfigs, IDictionary serializedAdditionalRawData) + { + HybridConnectionConfig = hybridConnectionConfig; + Kubeconfigs = kubeconfigs; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Contains the REP (rendezvous endpoint) and “Sender” access token. + public HybridConnectionConfig HybridConnectionConfig { get; } + /// Base64-encoded Kubernetes configuration file. + public IReadOnlyList Kubeconfigs { get; } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/Gateway.Serialization.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/Gateway.Serialization.cs new file mode 100644 index 000000000000..27b9b6419a39 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/Gateway.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Hybridkubernetes.Models +{ + public partial class Gateway : 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(Gateway)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsDefined(ResourceId)) + { + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + } + 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 + } + } + } + + Gateway 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(Gateway)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGateway(document.RootElement, options); + } + + internal static Gateway DeserializeGateway(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enabled = default; + ResourceIdentifier resourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("resourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Gateway(enabled, resourceId, 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, AzureResourceManagerHybridkubernetesContext.Default); + default: + throw new FormatException($"The model {nameof(Gateway)} does not support writing '{options.Format}' format."); + } + } + + Gateway 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 DeserializeGateway(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Gateway)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/Gateway.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/Gateway.cs new file mode 100644 index 000000000000..e99f269e88a4 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/Gateway.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Hybridkubernetes.Models +{ + /// The Gateway. + public partial class Gateway + { + /// + /// 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 Gateway() + { + } + + /// Initializes a new instance of . + /// Indicates whether the gateway for arc router connectivity is enabled. + /// The resource ID of the gateway used for the Arc router feature. + /// Keeps track of any properties unknown to the library. + internal Gateway(bool? enabled, ResourceIdentifier resourceId, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + ResourceId = resourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Indicates whether the gateway for arc router connectivity is enabled. + public bool? Enabled { get; set; } + /// The resource ID of the gateway used for the Arc router feature. + public ResourceIdentifier ResourceId { get; set; } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/HybridConnectionConfig.Serialization.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/HybridConnectionConfig.Serialization.cs new file mode 100644 index 000000000000..2be79e191d35 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/HybridConnectionConfig.Serialization.cs @@ -0,0 +1,195 @@ +// 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.Hybridkubernetes.Models +{ + public partial class HybridConnectionConfig : 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(HybridConnectionConfig)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ExpirationTime)) + { + writer.WritePropertyName("expirationTime"u8); + writer.WriteNumberValue(ExpirationTime.Value); + } + if (options.Format != "W" && Optional.IsDefined(HybridConnectionName)) + { + writer.WritePropertyName("hybridConnectionName"u8); + writer.WriteStringValue(HybridConnectionName); + } + if (options.Format != "W" && Optional.IsDefined(Relay)) + { + writer.WritePropertyName("relay"u8); + writer.WriteStringValue(Relay); + } + if (options.Format != "W" && Optional.IsDefined(Token)) + { + writer.WritePropertyName("token"u8); + writer.WriteStringValue(Token); + } + if (options.Format != "W" && Optional.IsDefined(RelayTid)) + { + writer.WritePropertyName("relayTid"u8); + writer.WriteStringValue(RelayTid); + } + if (options.Format != "W" && Optional.IsDefined(RelayType)) + { + writer.WritePropertyName("relayType"u8); + writer.WriteStringValue(RelayType); + } + 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 + } + } + } + + HybridConnectionConfig 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(HybridConnectionConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHybridConnectionConfig(document.RootElement, options); + } + + internal static HybridConnectionConfig DeserializeHybridConnectionConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long? expirationTime = default; + string hybridConnectionName = default; + string relay = default; + string token = default; + string relayTid = default; + string relayType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("expirationTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationTime = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("hybridConnectionName"u8)) + { + hybridConnectionName = property.Value.GetString(); + continue; + } + if (property.NameEquals("relay"u8)) + { + relay = property.Value.GetString(); + continue; + } + if (property.NameEquals("token"u8)) + { + token = property.Value.GetString(); + continue; + } + if (property.NameEquals("relayTid"u8)) + { + relayTid = property.Value.GetString(); + continue; + } + if (property.NameEquals("relayType"u8)) + { + relayType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HybridConnectionConfig( + expirationTime, + hybridConnectionName, + relay, + token, + relayTid, + relayType, + 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, AzureResourceManagerHybridkubernetesContext.Default); + default: + throw new FormatException($"The model {nameof(HybridConnectionConfig)} does not support writing '{options.Format}' format."); + } + } + + HybridConnectionConfig 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 DeserializeHybridConnectionConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HybridConnectionConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/HybridConnectionConfig.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/HybridConnectionConfig.cs new file mode 100644 index 000000000000..7780d076650c --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/HybridConnectionConfig.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.Hybridkubernetes.Models +{ + /// Contains the REP (rendezvous endpoint) and “Sender” access token. + public partial class HybridConnectionConfig + { + /// + /// 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 HybridConnectionConfig() + { + } + + /// Initializes a new instance of . + /// Timestamp when this token will be expired. + /// Name of the connection. + /// Name of the relay. + /// Sender access token. + /// TenantID of the relay. + /// Type of relay. + /// Keeps track of any properties unknown to the library. + internal HybridConnectionConfig(long? expirationTime, string hybridConnectionName, string relay, string token, string relayTid, string relayType, IDictionary serializedAdditionalRawData) + { + ExpirationTime = expirationTime; + HybridConnectionName = hybridConnectionName; + Relay = relay; + Token = token; + RelayTid = relayTid; + RelayType = relayType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Timestamp when this token will be expired. + public long? ExpirationTime { get; } + /// Name of the connection. + public string HybridConnectionName { get; } + /// Name of the relay. + public string Relay { get; } + /// Sender access token. + public string Token { get; } + /// TenantID of the relay. + public string RelayTid { get; } + /// Type of relay. + public string RelayType { get; } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ListClusterUserCredentialProperties.Serialization.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ListClusterUserCredentialProperties.Serialization.cs new file mode 100644 index 000000000000..a361d046dbae --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ListClusterUserCredentialProperties.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Hybridkubernetes.Models +{ + public partial class ListClusterUserCredentialProperties : 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(ListClusterUserCredentialProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("authenticationMethod"u8); + writer.WriteStringValue(AuthenticationMethod.ToString()); + writer.WritePropertyName("clientProxy"u8); + writer.WriteBooleanValue(ClientProxy); + 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 + } + } + } + + ListClusterUserCredentialProperties 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(ListClusterUserCredentialProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeListClusterUserCredentialProperties(document.RootElement, options); + } + + internal static ListClusterUserCredentialProperties DeserializeListClusterUserCredentialProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AuthenticationMethod authenticationMethod = default; + bool clientProxy = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authenticationMethod"u8)) + { + authenticationMethod = new AuthenticationMethod(property.Value.GetString()); + continue; + } + if (property.NameEquals("clientProxy"u8)) + { + clientProxy = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ListClusterUserCredentialProperties(authenticationMethod, clientProxy, 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, AzureResourceManagerHybridkubernetesContext.Default); + default: + throw new FormatException($"The model {nameof(ListClusterUserCredentialProperties)} does not support writing '{options.Format}' format."); + } + } + + ListClusterUserCredentialProperties 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 DeserializeListClusterUserCredentialProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ListClusterUserCredentialProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ListClusterUserCredentialProperties.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ListClusterUserCredentialProperties.cs new file mode 100644 index 000000000000..9fc41ce5802b --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ListClusterUserCredentialProperties.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Hybridkubernetes.Models +{ + /// The ListClusterUserCredentialProperties. + public partial class ListClusterUserCredentialProperties + { + /// + /// 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 mode of client authentication. + /// Boolean value to indicate whether the request is for client side proxy or not. + public ListClusterUserCredentialProperties(AuthenticationMethod authenticationMethod, bool clientProxy) + { + AuthenticationMethod = authenticationMethod; + ClientProxy = clientProxy; + } + + /// Initializes a new instance of . + /// The mode of client authentication. + /// Boolean value to indicate whether the request is for client side proxy or not. + /// Keeps track of any properties unknown to the library. + internal ListClusterUserCredentialProperties(AuthenticationMethod authenticationMethod, bool clientProxy, IDictionary serializedAdditionalRawData) + { + AuthenticationMethod = authenticationMethod; + ClientProxy = clientProxy; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ListClusterUserCredentialProperties() + { + } + + /// The mode of client authentication. + public AuthenticationMethod AuthenticationMethod { get; } + /// Boolean value to indicate whether the request is for client side proxy or not. + public bool ClientProxy { get; } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/OidcIssuerProfile.Serialization.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/OidcIssuerProfile.Serialization.cs new file mode 100644 index 000000000000..cd9640b1f4e1 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/OidcIssuerProfile.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Hybridkubernetes.Models +{ + public partial class OidcIssuerProfile : 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(OidcIssuerProfile)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled.Value); + } + if (options.Format != "W" && Optional.IsDefined(IssuerUri)) + { + writer.WritePropertyName("issuerUrl"u8); + writer.WriteStringValue(IssuerUri); + } + if (Optional.IsDefined(SelfHostedIssuerUri)) + { + writer.WritePropertyName("selfHostedIssuerUrl"u8); + writer.WriteStringValue(SelfHostedIssuerUri); + } + 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 + } + } + } + + OidcIssuerProfile 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(OidcIssuerProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOidcIssuerProfile(document.RootElement, options); + } + + internal static OidcIssuerProfile DeserializeOidcIssuerProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enabled = default; + string issuerUrl = default; + string selfHostedIssuerUrl = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("issuerUrl"u8)) + { + issuerUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("selfHostedIssuerUrl"u8)) + { + selfHostedIssuerUrl = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OidcIssuerProfile(enabled, issuerUrl, selfHostedIssuerUrl, 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, AzureResourceManagerHybridkubernetesContext.Default); + default: + throw new FormatException($"The model {nameof(OidcIssuerProfile)} does not support writing '{options.Format}' format."); + } + } + + OidcIssuerProfile 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 DeserializeOidcIssuerProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OidcIssuerProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/OidcIssuerProfile.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/OidcIssuerProfile.cs new file mode 100644 index 000000000000..a7d3f82bb3f5 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/OidcIssuerProfile.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Hybridkubernetes.Models +{ + /// OIDC Issuer Profile specifies attributes for workload identity integration. + public partial class OidcIssuerProfile + { + /// + /// 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 OidcIssuerProfile() + { + } + + /// Initializes a new instance of . + /// Whether to enable oidc issuer for workload identity integration. + /// The issuer url for hybrid clusters connected to Arc used for the workload identity feature. + /// The issuer url for public cloud clusters - AKS, EKS, GKE - used for the workload identity feature. + /// Keeps track of any properties unknown to the library. + internal OidcIssuerProfile(bool? enabled, string issuerUri, string selfHostedIssuerUri, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + IssuerUri = issuerUri; + SelfHostedIssuerUri = selfHostedIssuerUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Whether to enable oidc issuer for workload identity integration. + public bool? Enabled { get; set; } + /// The issuer url for hybrid clusters connected to Arc used for the workload identity feature. + public string IssuerUri { get; } + /// The issuer url for public cloud clusters - AKS, EKS, GKE - used for the workload identity feature. + public string SelfHostedIssuerUri { get; set; } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/PrivateLinkState.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/PrivateLinkState.cs new file mode 100644 index 000000000000..a484494d9298 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/PrivateLinkState.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.Hybridkubernetes.Models +{ + /// Property which describes the state of private link on a connected cluster resource. + public readonly partial struct PrivateLinkState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PrivateLinkState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Enabled. + public static PrivateLinkState Enabled { get; } = new PrivateLinkState(EnabledValue); + /// Disabled. + public static PrivateLinkState Disabled { get; } = new PrivateLinkState(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(PrivateLinkState left, PrivateLinkState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PrivateLinkState left, PrivateLinkState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PrivateLinkState(string value) => new PrivateLinkState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PrivateLinkState other && Equals(other); + /// + public bool Equals(PrivateLinkState 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/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ProvisioningState.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 000000000000..0206e02ee369 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/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.Hybridkubernetes.Models +{ + /// The current deployment state of connectedClusters. + public readonly partial struct ProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string ProvisioningValue = "Provisioning"; + private const string UpdatingValue = "Updating"; + private const string DeletingValue = "Deleting"; + private const string AcceptedValue = "Accepted"; + + /// Succeeded. + public static ProvisioningState Succeeded { get; } = new ProvisioningState(SucceededValue); + /// Failed. + public static ProvisioningState Failed { get; } = new ProvisioningState(FailedValue); + /// Canceled. + public static ProvisioningState Canceled { get; } = new ProvisioningState(CanceledValue); + /// Provisioning. + public static ProvisioningState Provisioning { get; } = new ProvisioningState(ProvisioningValue); + /// Updating. + public static ProvisioningState Updating { get; } = new ProvisioningState(UpdatingValue); + /// Deleting. + public static ProvisioningState Deleting { get; } = new ProvisioningState(DeletingValue); + /// Accepted. + public static ProvisioningState Accepted { get; } = new ProvisioningState(AcceptedValue); + /// Determines if two values are the same. + public static bool operator ==(ProvisioningState left, ProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProvisioningState left, ProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ProvisioningState(string value) => new ProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProvisioningState other && Equals(other); + /// + public bool Equals(ProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/SecurityProfile.Serialization.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/SecurityProfile.Serialization.cs new file mode 100644 index 000000000000..882021164db8 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/SecurityProfile.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Hybridkubernetes.Models +{ + internal partial class SecurityProfile : 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(SecurityProfile)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(WorkloadIdentity)) + { + writer.WritePropertyName("workloadIdentity"u8); + writer.WriteObjectValue(WorkloadIdentity, 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 + } + } + } + + SecurityProfile 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(SecurityProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSecurityProfile(document.RootElement, options); + } + + internal static SecurityProfile DeserializeSecurityProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SecurityProfileWorkloadIdentity workloadIdentity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("workloadIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + workloadIdentity = SecurityProfileWorkloadIdentity.DeserializeSecurityProfileWorkloadIdentity(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SecurityProfile(workloadIdentity, 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, AzureResourceManagerHybridkubernetesContext.Default); + default: + throw new FormatException($"The model {nameof(SecurityProfile)} does not support writing '{options.Format}' format."); + } + } + + SecurityProfile 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 DeserializeSecurityProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SecurityProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/SecurityProfile.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/SecurityProfile.cs new file mode 100644 index 000000000000..df9407fd2d4d --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/SecurityProfile.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Hybridkubernetes.Models +{ + /// Security Profile specifies attributes for cluster security features. + internal partial class SecurityProfile + { + /// + /// 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 SecurityProfile() + { + } + + /// Initializes a new instance of . + /// The workload identity feature webhook. + /// Keeps track of any properties unknown to the library. + internal SecurityProfile(SecurityProfileWorkloadIdentity workloadIdentity, IDictionary serializedAdditionalRawData) + { + WorkloadIdentity = workloadIdentity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The workload identity feature webhook. + internal SecurityProfileWorkloadIdentity WorkloadIdentity { get; set; } + /// Whether to enable or disable the workload identity Webhook. + public bool? WorkloadIdentityEnabled + { + get => WorkloadIdentity is null ? default : WorkloadIdentity.Enabled; + set + { + if (WorkloadIdentity is null) + WorkloadIdentity = new SecurityProfileWorkloadIdentity(); + WorkloadIdentity.Enabled = value; + } + } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/SecurityProfileWorkloadIdentity.Serialization.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/SecurityProfileWorkloadIdentity.Serialization.cs new file mode 100644 index 000000000000..2cf6863038c7 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/SecurityProfileWorkloadIdentity.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Hybridkubernetes.Models +{ + internal partial class SecurityProfileWorkloadIdentity : 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(SecurityProfileWorkloadIdentity)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SecurityProfileWorkloadIdentity 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(SecurityProfileWorkloadIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSecurityProfileWorkloadIdentity(document.RootElement, options); + } + + internal static SecurityProfileWorkloadIdentity DeserializeSecurityProfileWorkloadIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SecurityProfileWorkloadIdentity(enabled, 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, AzureResourceManagerHybridkubernetesContext.Default); + default: + throw new FormatException($"The model {nameof(SecurityProfileWorkloadIdentity)} does not support writing '{options.Format}' format."); + } + } + + SecurityProfileWorkloadIdentity 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 DeserializeSecurityProfileWorkloadIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SecurityProfileWorkloadIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/SecurityProfileWorkloadIdentity.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/SecurityProfileWorkloadIdentity.cs new file mode 100644 index 000000000000..221f586bd9a0 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/SecurityProfileWorkloadIdentity.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.Hybridkubernetes.Models +{ + /// The workload identity feature webhook. + internal partial class SecurityProfileWorkloadIdentity + { + /// + /// 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 SecurityProfileWorkloadIdentity() + { + } + + /// Initializes a new instance of . + /// Whether to enable or disable the workload identity Webhook. + /// Keeps track of any properties unknown to the library. + internal SecurityProfileWorkloadIdentity(bool? enabled, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Whether to enable or disable the workload identity Webhook. + public bool? Enabled { get; set; } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/SystemComponent.Serialization.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/SystemComponent.Serialization.cs new file mode 100644 index 000000000000..316e2086c16e --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/SystemComponent.Serialization.cs @@ -0,0 +1,166 @@ +// 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.Hybridkubernetes.Models +{ + public partial class SystemComponent : 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(SystemComponent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (Optional.IsDefined(UserSpecifiedVersion)) + { + writer.WritePropertyName("userSpecifiedVersion"u8); + writer.WriteStringValue(UserSpecifiedVersion); + } + if (Optional.IsDefined(MajorVersion)) + { + writer.WritePropertyName("majorVersion"u8); + writer.WriteNumberValue(MajorVersion.Value); + } + if (options.Format != "W" && Optional.IsDefined(CurrentVersion)) + { + writer.WritePropertyName("currentVersion"u8); + writer.WriteStringValue(CurrentVersion); + } + 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 + } + } + } + + SystemComponent 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(SystemComponent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSystemComponent(document.RootElement, options); + } + + internal static SystemComponent DeserializeSystemComponent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string type = default; + string userSpecifiedVersion = default; + int? majorVersion = default; + string currentVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("userSpecifiedVersion"u8)) + { + userSpecifiedVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("majorVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + majorVersion = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("currentVersion"u8)) + { + currentVersion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SystemComponent(type, userSpecifiedVersion, majorVersion, currentVersion, 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, AzureResourceManagerHybridkubernetesContext.Default); + default: + throw new FormatException($"The model {nameof(SystemComponent)} does not support writing '{options.Format}' format."); + } + } + + SystemComponent 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 DeserializeSystemComponent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SystemComponent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/SystemComponent.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/SystemComponent.cs new file mode 100644 index 000000000000..91f127ac7b06 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/Models/SystemComponent.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.Hybridkubernetes.Models +{ + /// System extensions and its current versions installed on the cluster resource. + public partial class SystemComponent + { + /// + /// 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 SystemComponent() + { + } + + /// Initializes a new instance of . + /// Type of the system extension. + /// Version of the system extension to be installed on the cluster resource. + /// Major Version of the system extension that is currently installed on the cluster resource. + /// Version of the system extension that is currently installed on the cluster resource. + /// Keeps track of any properties unknown to the library. + internal SystemComponent(string type, string userSpecifiedVersion, int? majorVersion, string currentVersion, IDictionary serializedAdditionalRawData) + { + Type = type; + UserSpecifiedVersion = userSpecifiedVersion; + MajorVersion = majorVersion; + CurrentVersion = currentVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Type of the system extension. + public string Type { get; set; } + /// Version of the system extension to be installed on the cluster resource. + public string UserSpecifiedVersion { get; set; } + /// Major Version of the system extension that is currently installed on the cluster resource. + public int? MajorVersion { get; set; } + /// Version of the system extension that is currently installed on the cluster resource. + public string CurrentVersion { get; } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/ProviderConstants.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..dee279748b9e --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/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.Hybridkubernetes +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/RestOperations/ConnectedClustersRestOperations.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/RestOperations/ConnectedClustersRestOperations.cs new file mode 100644 index 000000000000..fe218f10902a --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Generated/RestOperations/ConnectedClustersRestOperations.cs @@ -0,0 +1,835 @@ +// 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.Hybridkubernetes.Models; + +namespace Azure.ResourceManager.Hybridkubernetes +{ + internal partial class ConnectedClustersRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectedClustersRestOperations. + /// 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 ConnectedClustersRestOperations(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-12-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string clusterName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Kubernetes/connectedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string clusterName) + { + 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.Kubernetes/connectedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Returns the properties of the specified connected cluster, including name, identity, properties, and additional cluster details. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster on which get is called. + /// 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 clusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, clusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectedClusterData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ConnectedClusterData.DeserializeConnectedClusterData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ConnectedClusterData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Returns the properties of the specified connected cluster, including name, identity, properties, and additional cluster details. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster on which get is called. + /// 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 clusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, clusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectedClusterData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ConnectedClusterData.DeserializeConnectedClusterData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ConnectedClusterData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrReplaceRequestUri(string subscriptionId, string resourceGroupName, string clusterName, ConnectedClusterData 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.Kubernetes/connectedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrReplaceRequest(string subscriptionId, string resourceGroupName, string clusterName, ConnectedClusterData 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.Kubernetes/connectedClusters/", false); + uri.AppendPath(clusterName, 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; + } + + /// API to register a new Kubernetes cluster and create or replace a connected cluster tracked resource in Azure Resource Manager (ARM). + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster on which get is called. + /// Parameters supplied to Create a Connected Cluster. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrReplaceAsync(string subscriptionId, string resourceGroupName, string clusterName, ConnectedClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrReplaceRequest(subscriptionId, resourceGroupName, clusterName, 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); + } + } + + /// API to register a new Kubernetes cluster and create or replace a connected cluster tracked resource in Azure Resource Manager (ARM). + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster on which get is called. + /// Parameters supplied to Create a Connected Cluster. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrReplace(string subscriptionId, string resourceGroupName, string clusterName, ConnectedClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrReplaceRequest(subscriptionId, resourceGroupName, clusterName, 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 clusterName, ConnectedClusterPatch 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.Kubernetes/connectedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string clusterName, ConnectedClusterPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Kubernetes/connectedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// API to update certain properties of the connected cluster resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster on which get is called. + /// Parameters supplied to update Connected Cluster. + /// 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 clusterName, ConnectedClusterPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, clusterName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectedClusterData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ConnectedClusterData.DeserializeConnectedClusterData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// API to update certain properties of the connected cluster resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster on which get is called. + /// Parameters supplied to update Connected Cluster. + /// 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 clusterName, ConnectedClusterPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, clusterName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectedClusterData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ConnectedClusterData.DeserializeConnectedClusterData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string clusterName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Kubernetes/connectedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string clusterName) + { + 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.Kubernetes/connectedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster on which get is called. + /// 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 clusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, clusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster on which get is called. + /// 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 clusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, clusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + 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.Kubernetes/connectedClusters", 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.Kubernetes/connectedClusters", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// API to enumerate registered connected K8s clusters under a 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: + { + ConnectedClusterList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ConnectedClusterList.DeserializeConnectedClusterList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// API to enumerate registered connected K8s clusters under a 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: + { + ConnectedClusterList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ConnectedClusterList.DeserializeConnectedClusterList(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.Kubernetes/connectedClusters", 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.Kubernetes/connectedClusters", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// API to enumerate registered connected K8s clusters under a 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: + { + ConnectedClusterList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ConnectedClusterList.DeserializeConnectedClusterList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// API to enumerate registered connected K8s clusters under a 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: + { + ConnectedClusterList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ConnectedClusterList.DeserializeConnectedClusterList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListClusterUserCredentialRequestUri(string subscriptionId, string resourceGroupName, string clusterName, ListClusterUserCredentialProperties properties) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Kubernetes/connectedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendPath("/listClusterUserCredential", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListClusterUserCredentialRequest(string subscriptionId, string resourceGroupName, string clusterName, ListClusterUserCredentialProperties properties) + { + 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.Kubernetes/connectedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendPath("/listClusterUserCredential", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(properties, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Gets cluster user credentials of the connected cluster with a specified resource group and name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster on which get is called. + /// ListClusterUserCredential properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListClusterUserCredentialAsync(string subscriptionId, string resourceGroupName, string clusterName, ListClusterUserCredentialProperties properties, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNull(properties, nameof(properties)); + + using var message = CreateListClusterUserCredentialRequest(subscriptionId, resourceGroupName, clusterName, properties); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CredentialResults value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CredentialResults.DeserializeCredentialResults(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets cluster user credentials of the connected cluster with a specified resource group and name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster on which get is called. + /// ListClusterUserCredential properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListClusterUserCredential(string subscriptionId, string resourceGroupName, string clusterName, ListClusterUserCredentialProperties properties, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNull(properties, nameof(properties)); + + using var message = CreateListClusterUserCredentialRequest(subscriptionId, resourceGroupName, clusterName, properties); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CredentialResults value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CredentialResults.DeserializeCredentialResults(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; + } + + /// API to enumerate registered connected K8s clusters under a 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: + { + ConnectedClusterList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ConnectedClusterList.DeserializeConnectedClusterList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// API to enumerate registered connected K8s clusters under a 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: + { + ConnectedClusterList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ConnectedClusterList.DeserializeConnectedClusterList(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; + } + + /// API to enumerate registered connected K8s clusters under a 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: + { + ConnectedClusterList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ConnectedClusterList.DeserializeConnectedClusterList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// API to enumerate registered connected K8s clusters under a 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: + { + ConnectedClusterList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ConnectedClusterList.DeserializeConnectedClusterList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Properties/AssemblyInfo.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..5cc0d41020d2 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/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.Hybridkubernetes.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("Hybridkubernetes")] diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/tests/Azure.ResourceManager.Hybridkubernetes.Tests.csproj b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/tests/Azure.ResourceManager.Hybridkubernetes.Tests.csproj new file mode 100644 index 000000000000..0588181e2fc0 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/tests/Azure.ResourceManager.Hybridkubernetes.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/tests/HybridkubernetesManagementTestBase.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/tests/HybridkubernetesManagementTestBase.cs new file mode 100644 index 000000000000..0d9cbc8b9e9e --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/tests/HybridkubernetesManagementTestBase.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.Hybridkubernetes.Tests +{ + public class HybridkubernetesManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected HybridkubernetesManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected HybridkubernetesManagementTestBase(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/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/tests/HybridkubernetesManagementTestEnvironment.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/tests/HybridkubernetesManagementTestEnvironment.cs new file mode 100644 index 000000000000..a9db00b9c196 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/tests/HybridkubernetesManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.Hybridkubernetes.Tests +{ + public class HybridkubernetesManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/tsp-location.yaml b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/tsp-location.yaml new file mode 100644 index 000000000000..2b6d5bc5db74 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/hybridkubernetes/HybridKubernetes.Management +commit: 88ae2ee3303629a5c3b114661d139ec94700251b +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml index 9ae0a7e75290..9cd3a0048838 100644 --- a/sdk/resourcemanager/ci.mgmt.yml +++ b/sdk/resourcemanager/ci.mgmt.yml @@ -105,6 +105,7 @@ trigger: - sdk/hybridaks/Azure.ResourceManager.HybridContainerService - sdk/hybridcompute/Azure.ResourceManager.HybridCompute - sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity + - sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes - sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes - sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork - sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement @@ -321,6 +322,7 @@ pr: - sdk/hybridaks/Azure.ResourceManager.HybridContainerService - sdk/hybridcompute/Azure.ResourceManager.HybridCompute - sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity + - sdk/hybridkubernetes/Azure.ResourceManager.Hybridkubernetes - sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes - sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork - sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement 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/