From 4917dc3ee951e0ec6f258d0ae8913cee90f28275 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 25 Jan 2024 23:05:21 +0000 Subject: [PATCH] CodeGen from PR 27519 in Azure/azure-rest-api-specs Merge 3f134afb066f6c67b8ce5d68d863d8eaca0cc5f3 into 8fc3dd4d4582aa2c8201af98e6f1143521cb76fc --- .../CHANGELOG.md | 4 +- .../README.md | 10 +- .../SAMPLE.md | 218 ++-- .../pom.xml | 13 +- .../HybridKubernetesManager.java | 87 +- .../fluent/ConnectedClustersClient.java | 150 +-- .../HybridKubernetesManagementClient.java | 18 +- .../fluent/OperationsClient.java | 8 +- .../fluent/models/ConnectedClusterInner.java | 270 +++- .../ConnectedClusterPatchProperties.java | 107 ++ .../models/ConnectedClusterProperties.java | 252 +++- .../fluent/models/CredentialResultsInner.java | 14 +- .../fluent/models/OperationInner.java | 14 +- .../fluent/models/package-info.java | 5 +- .../hybridkubernetes/fluent/package-info.java | 5 +- .../implementation/ConnectedClusterImpl.java | 161 ++- .../ConnectedClustersClientImpl.java | 1129 +++++++---------- .../implementation/ConnectedClustersImpl.java | 127 +- .../implementation/CredentialResultsImpl.java | 3 +- ...bridKubernetesManagementClientBuilder.java | 46 +- .../HybridKubernetesManagementClientImpl.java | 103 +- .../implementation/OperationImpl.java | 4 +- .../implementation/OperationsClientImpl.java | 151 +-- .../implementation/OperationsImpl.java | 7 +- .../{Utils.java => ResourceManagerUtils.java} | 45 +- .../implementation/package-info.java | 5 +- .../hybridkubernetes/models/AadProfile.java | 110 ++ .../hybridkubernetes/models/AgentError.java | 89 ++ .../models/ArcAgentProfile.java | 141 ++ .../models/AuthenticationMethod.java | 18 +- .../models/AutoUpgradeOptions.java | 53 + .../models/AzureHybridBenefit.java | 58 + .../models/ConnectedCluster.java | 393 ++++-- .../models/ConnectedClusterIdentity.java | 29 +- .../models/ConnectedClusterKind.java | 48 + .../models/ConnectedClusterList.java | 18 +- .../models/ConnectedClusterPatch.java | 101 +- .../models/ConnectedClusters.java | 112 +- .../models/ConnectivityStatus.java | 26 +- .../models/CredentialResult.java | 14 +- .../models/CredentialResults.java | 10 +- .../models/HybridConnectionConfig.java | 18 +- .../ListClusterUserCredentialProperties.java | 24 +- .../hybridkubernetes/models/Operation.java | 10 +- .../models/OperationDisplay.java | 26 +- .../models/OperationList.java | 16 +- .../hybridkubernetes/models/Operations.java | 8 +- .../models/PrivateLinkState.java | 53 + .../models/ProvisioningState.java | 38 +- .../models/ResourceIdentityType.java | 18 +- .../models/SystemComponent.java | 121 ++ .../hybridkubernetes/models/package-info.java | 5 +- .../hybridkubernetes/package-info.java | 5 +- .../src/main/java/module-info.java | 8 +- .../proxy-config.json | 1 + .../reflect-config.json | 126 ++ .../ConnectedClusterCreateSamples.java | 86 +- .../ConnectedClusterDeleteSamples.java | 14 +- ...ectedClusterGetByResourceGroupSamples.java | 31 +- ...ctedClusterListByResourceGroupSamples.java | 10 +- ...usterListClusterUserCredentialSamples.java | 84 +- .../ConnectedClusterListSamples.java | 15 +- .../ConnectedClusterUpdateSamples.java | 26 +- .../generated/OperationsGetSamples.java | 10 +- .../ConnectedClusterIdentityTests.java | 28 - .../generated/ConnectedClusterPatchTests.java | 44 - .../ConnectedClustersDeleteMockTests.java | 61 - .../generated/CredentialResultTests.java | 21 - ...tClusterUserCredentialPropertiesTests.java | 33 - .../generated/OperationDisplayTests.java | 39 - .../generated/OperationInnerTests.java | 25 - .../generated/OperationListTests.java | 28 - .../generated/OperationsGetMockTests.java | 64 - 73 files changed, 3189 insertions(+), 2083 deletions(-) create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/ConnectedClusterPatchProperties.java rename sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/{Utils.java => ResourceManagerUtils.java} (80%) create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AadProfile.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AgentError.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ArcAgentProfile.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AutoUpgradeOptions.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AzureHybridBenefit.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterKind.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/PrivateLinkState.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/SystemComponent.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hybridkubernetes/proxy-config.json create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hybridkubernetes/reflect-config.json delete mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterIdentityTests.java delete mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterPatchTests.java delete mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClustersDeleteMockTests.java delete mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/CredentialResultTests.java delete mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ListClusterUserCredentialPropertiesTests.java delete mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationDisplayTests.java delete mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationInnerTests.java delete mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationListTests.java delete mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationsGetMockTests.java diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/CHANGELOG.md b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/CHANGELOG.md index 6f4200041d6a1..9a7ffc141ff7f 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/CHANGELOG.md +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0-beta.1 (2024-01-25) + +- Azure Resource Manager HybridKubernetes client library for Java. This package contains Microsoft Azure SDK for HybridKubernetes Management SDK. Hybrid Kubernetes Client. Package tag package-preview-2024-02-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/README.md b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/README.md index b65a7668e9009..3964197d54f59 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/README.md +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/README.md @@ -2,7 +2,7 @@ Azure Resource Manager HybridKubernetes client library for Java. -This package contains Microsoft Azure SDK for HybridKubernetes Management SDK. Hybrid Kubernetes Client. Package tag package-2021-10-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for HybridKubernetes Management SDK. Hybrid Kubernetes Client. Package tag package-preview-2024-02-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-hybridkubernetes - 1.0.0-beta.3 + 1.0.0-beta.4 ``` [//]: # ({x-version-update-end}) @@ -45,7 +45,7 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. +By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. @@ -94,7 +94,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS [docs]: https://azure.github.io/azure-sdk-for-java/ -[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty @@ -103,3 +103,5 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fhybridkubernetes%2Fazure-resourcemanager-hybridkubernetes%2FREADME.png) diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/SAMPLE.md b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/SAMPLE.md index 8f74e93aaa3b9..23d49292962a5 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/SAMPLE.md +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/SAMPLE.md @@ -17,36 +17,61 @@ ### ConnectedCluster_Create ```java +import com.azure.resourcemanager.hybridkubernetes.models.AadProfile; +import com.azure.resourcemanager.hybridkubernetes.models.ArcAgentProfile; +import com.azure.resourcemanager.hybridkubernetes.models.AutoUpgradeOptions; +import com.azure.resourcemanager.hybridkubernetes.models.AzureHybridBenefit; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterIdentity; +import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterKind; +import com.azure.resourcemanager.hybridkubernetes.models.PrivateLinkState; import com.azure.resourcemanager.hybridkubernetes.models.ResourceIdentityType; +import com.azure.resourcemanager.hybridkubernetes.models.SystemComponent; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; +import java.util.stream.Collectors; -/** Samples for ConnectedCluster Create. */ +/** + * Samples for ConnectedCluster Create. + */ public final class ConnectedClusterCreateSamples { /* - * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/CreateClusterExample.json + * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/CreateCluster_KindExample.json + */ + /** + * Sample code: CreateCluster_KindExample. + * + * @param manager Entry point to HybridKubernetesManager. + */ + public static void createClusterKindExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + manager.connectedClusters().define("testCluster").withRegion("East US").withExistingResourceGroup("k8sc-rg").withIdentity(new ConnectedClusterIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)).withAgentPublicKeyCertificate("").withTags(mapOf()).withKind(ConnectedClusterKind.PROVISIONED_CLUSTER).withDistribution("AKS").withDistributionVersion("1.0").withAzureHybridBenefit(AzureHybridBenefit.NOT_APPLICABLE).withAadProfile(new AadProfile().withEnableAzureRbac(true).withAdminGroupObjectIDs(Arrays.asList("56f988bf-86f1-41af-91ab-2d7cd011db47")).withTenantId("82f988bf-86f1-41af-91ab-2d7cd011db47")).withArcAgentProfile(new ArcAgentProfile().withDesiredAgentVersion("0.1.0").withAgentAutoUpgrade(AutoUpgradeOptions.ENABLED).withSystemComponents(Arrays.asList(new SystemComponent().withType("Strato").withUserSpecifiedVersion("0.1.1").withMajorVersion(0)))).create(); + } + + /* + * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/CreateClusterExample.json */ /** * Sample code: CreateClusterExample. - * + * * @param manager Entry point to HybridKubernetesManager. */ - public static void createClusterExample( - com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { - manager - .connectedClusters() - .define("testCluster") - .withRegion("East US") - .withExistingResourceGroup("k8sc-rg") - .withIdentity(new ConnectedClusterIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withAgentPublicKeyCertificate( - "MIICYzCCAcygAwIBAgIBADANBgkqhkiG9w0BAQUFADAuMQswCQYDVQQGEwJVUzEMMAoGA1UEChMDSUJNMREwDwYDVQQLEwhMb2NhbCBDQTAeFw05OTEyMjIwNTAwMDBaFw0wMDEyMjMwNDU5NTlaMC4xCzAJBgNVBAYTAlVTMQwwCgYDVQQKEwNJQk0xETAPBgNVBAsTCExvY2FsIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD2bZEo7xGaX2/0GHkrNFZvlxBou9v1Jmt/PDiTMPve8r9FeJAQ0QdvFST/0JPQYD20rH0bimdDLgNdNynmyRoS2S/IInfpmf69iyc2G0TPyRvmHIiOZbdCd+YBHQi1adkj17NDcWj6S14tVurFX73zx0sNoMS79q3tuXKrDsxeuwIDAQABo4GQMIGNMEsGCVUdDwGG+EIBDQQ+EzxHZW5lcmF0ZWQgYnkgdGhlIFNlY3VyZVdheSBTZWN1cml0eSBTZXJ2ZXIgZm9yIE9TLzM5MCAoUkFDRikwDgYDVR0PAQH/BAQDAgAGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ3+ocRyCTJw067dLSwr/nalx6YMMA0GCSqGSIb3DQEBBQUAA4GBAMaQzt+zaj1GU77yzlr8iiMBXgdQrwsZZWJo5exnAucJAEYQZmOfyLiM" - + " D6oYq+ZnfvM0n8G/Y79q8nhwvuxpYOnRSAXFp6xSkrIOeZtJMY1h00LKp/JX3Ng1svZ2agE126JHsQ0bhzN5TKsYfbwfTwfjdWAGy6Vf1nYi/rO+ryMO") - .withTags(mapOf()) - .create(); + public static void createClusterExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + manager.connectedClusters().define("testCluster").withRegion("East US").withExistingResourceGroup("k8sc-rg").withIdentity(new ConnectedClusterIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)).withAgentPublicKeyCertificate("MIICYzCCAcygAwIBAgIBADANBgkqhkiG9w0BAQUFADAuMQswCQYDVQQGEwJVUzEMMAoGA1UEChMDSUJNMREwDwYDVQQLEwhMb2NhbCBDQTAeFw05OTEyMjIwNTAwMDBaFw0wMDEyMjMwNDU5NTlaMC4xCzAJBgNVBAYTAlVTMQwwCgYDVQQKEwNJQk0xETAPBgNVBAsTCExvY2FsIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD2bZEo7xGaX2/0GHkrNFZvlxBou9v1Jmt/PDiTMPve8r9FeJAQ0QdvFST/0JPQYD20rH0bimdDLgNdNynmyRoS2S/IInfpmf69iyc2G0TPyRvmHIiOZbdCd+YBHQi1adkj17NDcWj6S14tVurFX73zx0sNoMS79q3tuXKrDsxeuwIDAQABo4GQMIGNMEsGCVUdDwGG+EIBDQQ+EzxHZW5lcmF0ZWQgYnkgdGhlIFNlY3VyZVdheSBTZWN1cml0eSBTZXJ2ZXIgZm9yIE9TLzM5MCAoUkFDRikwDgYDVR0PAQH/BAQDAgAGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ3+ocRyCTJw067dLSwr/nalx6YMMA0GCSqGSIb3DQEBBQUAA4GBAMaQzt+zaj1GU77yzlr8iiMBXgdQrwsZZWJo5exnAucJAEYQZmOfyLiM D6oYq+ZnfvM0n8G/Y79q8nhwvuxpYOnRSAXFp6xSkrIOeZtJMY1h00LKp/JX3Ng1svZ2agE126JHsQ0bhzN5TKsYfbwfTwfjdWAGy6Vf1nYi/rO+ryMO").withTags(mapOf()).withDistribution("AKS").withDistributionVersion("1.0").withAzureHybridBenefit(AzureHybridBenefit.NOT_APPLICABLE).create(); } + /* + * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/CreateClusterPrivateLinkExample.json + */ + /** + * Sample code: CreateClusterPrivateLinkExample. + * + * @param manager Entry point to HybridKubernetesManager. + */ + public static void createClusterPrivateLinkExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + manager.connectedClusters().define("testCluster").withRegion("East US").withExistingResourceGroup("k8sc-rg").withIdentity(new ConnectedClusterIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)).withAgentPublicKeyCertificate("MIICYzCCAcygAwIBAgIBADANBgkqhkiG9w0BAQUFADAuMQswCQYDVQQGEwJVUzEMMAoGA1UEChMDSUJNMREwDwYDVQQLEwhMb2NhbCBDQTAeFw05OTEyMjIwNTAwMDBaFw0wMDEyMjMwNDU5NTlaMC4xCzAJBgNVBAYTAlVTMQwwCgYDVQQKEwNJQk0xETAPBgNVBAsTCExvY2FsIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD2bZEo7xGaX2/0GHkrNFZvlxBou9v1Jmt/PDiTMPve8r9FeJAQ0QdvFST/0JPQYD20rH0bimdDLgNdNynmyRoS2S/IInfpmf69iyc2G0TPyRvmHIiOZbdCd+YBHQi1adkj17NDcWj6S14tVurFX73zx0sNoMS79q3tuXKrDsxeuwIDAQABo4GQMIGNMEsGCVUdDwGG+EIBDQQ+EzxHZW5lcmF0ZWQgYnkgdGhlIFNlY3VyZVdheSBTZWN1cml0eSBTZXJ2ZXIgZm9yIE9TLzM5MCAoUkFDRikwDgYDVR0PAQH/BAQDAgAGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ3+ocRyCTJw067dLSwr/nalx6YMMA0GCSqGSIb3DQEBBQUAA4GBAMaQzt+zaj1GU77yzlr8iiMBXgdQrwsZZWJo5exnAucJAEYQZmOfyLiM D6oYq+ZnfvM0n8G/Y79q8nhwvuxpYOnRSAXFp6xSkrIOeZtJMY1h00LKp/JX3Ng1svZ2agE126JHsQ0bhzN5TKsYfbwfTwfjdWAGy6Vf1nYi/rO+ryMO").withTags(mapOf()).withDistribution("AKS").withDistributionVersion("1.0").withPrivateLinkState(PrivateLinkState.ENABLED).withPrivateLinkScopeResourceId("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName").withAzureHybridBenefit(AzureHybridBenefit.NOT_APPLICABLE).create(); + } + + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -63,18 +88,19 @@ public final class ConnectedClusterCreateSamples { ### ConnectedCluster_Delete ```java -/** Samples for ConnectedCluster Delete. */ +/** + * Samples for ConnectedCluster Delete. + */ public final class ConnectedClusterDeleteSamples { /* - * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/DeleteClusterExample.json + * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/DeleteClusterExample.json */ /** * Sample code: DeleteClusterExample. - * + * * @param manager Entry point to HybridKubernetesManager. */ - public static void deleteClusterExample( - com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + public static void deleteClusterExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { manager.connectedClusters().delete("k8sc-rg", "testCluster", com.azure.core.util.Context.NONE); } } @@ -83,20 +109,32 @@ public final class ConnectedClusterDeleteSamples { ### ConnectedCluster_GetByResourceGroup ```java -/** Samples for ConnectedCluster GetByResourceGroup. */ +/** + * Samples for ConnectedCluster GetByResourceGroup. + */ public final class ConnectedClusterGetByResourceGroupSamples { /* - * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/GetClusterExample.json + * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/GetProvisionedClusterExample.json + */ + /** + * Sample code: GetProvisionedClusterExample. + * + * @param manager Entry point to HybridKubernetesManager. + */ + public static void getProvisionedClusterExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + manager.connectedClusters().getByResourceGroupWithResponse("k8sc-rg", "testCluster", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/GetClusterExample.json */ /** * Sample code: GetClusterExample. - * + * * @param manager Entry point to HybridKubernetesManager. */ public static void getClusterExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { - manager - .connectedClusters() - .getByResourceGroupWithResponse("k8sc-rg", "testCluster", com.azure.core.util.Context.NONE); + manager.connectedClusters().getByResourceGroupWithResponse("k8sc-rg", "testCluster", com.azure.core.util.Context.NONE); } } ``` @@ -104,17 +142,19 @@ public final class ConnectedClusterGetByResourceGroupSamples { ### ConnectedCluster_List ```java -/** Samples for ConnectedCluster List. */ +/** + * Samples for ConnectedCluster List. + */ public final class ConnectedClusterListSamples { /* - * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/GetClustersBySubscriptionExample.json + * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/GetClustersBySubscriptionExample.json */ /** - * Sample code: GetClustersExample. - * + * Sample code: GetClustersBySubscriptionExample. + * * @param manager Entry point to HybridKubernetesManager. */ - public static void getClustersExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + public static void getClustersBySubscriptionExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { manager.connectedClusters().list(com.azure.core.util.Context.NONE); } } @@ -123,14 +163,16 @@ public final class ConnectedClusterListSamples { ### ConnectedCluster_ListByResourceGroup ```java -/** Samples for ConnectedCluster ListByResourceGroup. */ +/** + * Samples for ConnectedCluster ListByResourceGroup. + */ public final class ConnectedClusterListByResourceGroupSamples { /* - * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/GetClustersByResourceGroupExample.json + * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/GetClustersByResourceGroupExample.json */ /** * Sample code: GetClustersExample. - * + * * @param manager Entry point to HybridKubernetesManager. */ public static void getClustersExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { @@ -144,91 +186,58 @@ public final class ConnectedClusterListByResourceGroupSamples { ```java import com.azure.resourcemanager.hybridkubernetes.models.AuthenticationMethod; import com.azure.resourcemanager.hybridkubernetes.models.ListClusterUserCredentialProperties; +import java.util.stream.Collectors; -/** Samples for ConnectedCluster ListClusterUserCredential. */ +/** + * Samples for ConnectedCluster ListClusterUserCredential. + */ public final class ConnectedClusterListClusterUserCredentialSamples { /* - * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/ConnectedClustersListClusterCredentialResultCSPAAD.json + * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/ConnectedClustersListClusterCredentialResultCSPAAD.json */ /** * Sample code: ListClusterUserCredentialExample. - * + * * @param manager Entry point to HybridKubernetesManager. */ - public static void listClusterUserCredentialExample( - com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { - manager - .connectedClusters() - .listClusterUserCredentialWithResponse( - "k8sc-rg", - "testCluster", - new ListClusterUserCredentialProperties() - .withAuthenticationMethod(AuthenticationMethod.AAD) - .withClientProxy(true), - com.azure.core.util.Context.NONE); + public static void listClusterUserCredentialExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + manager.connectedClusters().listClusterUserCredentialWithResponse("k8sc-rg", "testCluster", new ListClusterUserCredentialProperties().withAuthenticationMethod(AuthenticationMethod.AAD).withClientProxy(true), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/ConnectedClustersListClusterCredentialResultHPAAD.json + * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/ConnectedClustersListClusterCredentialResultHPAAD.json */ /** * Sample code: ListClusterUserCredentialCSPExample. - * + * * @param manager Entry point to HybridKubernetesManager. */ - public static void listClusterUserCredentialCSPExample( - com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { - manager - .connectedClusters() - .listClusterUserCredentialWithResponse( - "k8sc-rg", - "testCluster", - new ListClusterUserCredentialProperties() - .withAuthenticationMethod(AuthenticationMethod.AAD) - .withClientProxy(false), - com.azure.core.util.Context.NONE); + public static void listClusterUserCredentialCSPExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + manager.connectedClusters().listClusterUserCredentialWithResponse("k8sc-rg", "testCluster", new ListClusterUserCredentialProperties().withAuthenticationMethod(AuthenticationMethod.AAD).withClientProxy(false), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/ConnectedClustersListClusterCredentialResultCSPToken.json + * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/ConnectedClustersListClusterCredentialResultCSPToken.json */ /** * Sample code: ListClusterUserCredentialNonAadExample. - * + * * @param manager Entry point to HybridKubernetesManager. */ - public static void listClusterUserCredentialNonAadExample( - com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { - manager - .connectedClusters() - .listClusterUserCredentialWithResponse( - "k8sc-rg", - "testCluster", - new ListClusterUserCredentialProperties() - .withAuthenticationMethod(AuthenticationMethod.TOKEN) - .withClientProxy(true), - com.azure.core.util.Context.NONE); + public static void listClusterUserCredentialNonAadExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + manager.connectedClusters().listClusterUserCredentialWithResponse("k8sc-rg", "testCluster", new ListClusterUserCredentialProperties().withAuthenticationMethod(AuthenticationMethod.TOKEN).withClientProxy(true), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/ConnectedClustersListClusterCredentialResultHPToken.json + * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/ConnectedClustersListClusterCredentialResultHPToken.json */ /** * Sample code: ListClusterUserCredentialNonAadCSPExample. - * + * * @param manager Entry point to HybridKubernetesManager. */ - public static void listClusterUserCredentialNonAadCSPExample( - com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { - manager - .connectedClusters() - .listClusterUserCredentialWithResponse( - "k8sc-rg", - "testCluster", - new ListClusterUserCredentialProperties() - .withAuthenticationMethod(AuthenticationMethod.TOKEN) - .withClientProxy(false), - com.azure.core.util.Context.NONE); + public static void listClusterUserCredentialNonAadCSPExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + manager.connectedClusters().listClusterUserCredentialWithResponse("k8sc-rg", "testCluster", new ListClusterUserCredentialProperties().withAuthenticationMethod(AuthenticationMethod.TOKEN).withClientProxy(false), com.azure.core.util.Context.NONE); } } ``` @@ -236,30 +245,30 @@ public final class ConnectedClusterListClusterUserCredentialSamples { ### ConnectedCluster_Update ```java +import com.azure.resourcemanager.hybridkubernetes.models.AzureHybridBenefit; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedCluster; import java.util.HashMap; import java.util.Map; +import java.util.stream.Collectors; -/** Samples for ConnectedCluster Update. */ +/** + * Samples for ConnectedCluster Update. + */ public final class ConnectedClusterUpdateSamples { /* - * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/UpdateClusterExample.json + * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/UpdateClusterExample.json */ /** * Sample code: UpdateClusterExample. - * + * * @param manager Entry point to HybridKubernetesManager. */ - public static void updateClusterExample( - com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { - ConnectedCluster resource = - manager - .connectedClusters() - .getByResourceGroupWithResponse("k8sc-rg", "testCluster", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + public static void updateClusterExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + ConnectedCluster resource = manager.connectedClusters().getByResourceGroupWithResponse("k8sc-rg", "testCluster", com.azure.core.util.Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).withDistribution("AKS").withDistributionVersion("1.0").withAzureHybridBenefit(AzureHybridBenefit.NOT_APPLICABLE).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -276,18 +285,19 @@ public final class ConnectedClusterUpdateSamples { ### Operations_Get ```java -/** Samples for Operations Get. */ +/** + * Samples for Operations Get. + */ public final class OperationsGetSamples { /* - * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/ListConnectedClusterOperationsExample.json + * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/ListConnectedClusterOperationsExample.json */ /** * Sample code: ListConnectedClusterOperationsExample. - * + * * @param manager Entry point to HybridKubernetesManager. */ - public static void listConnectedClusterOperationsExample( - com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + public static void listConnectedClusterOperationsExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { manager.operations().get(com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/pom.xml b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/pom.xml index 577599893ad52..905bfd7ba6378 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/pom.xml +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,7 +18,7 @@ jar Microsoft Azure SDK for HybridKubernetes Management - This package contains Microsoft Azure SDK for HybridKubernetes Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Hybrid Kubernetes Client. Package tag package-2021-10-01. + This package contains Microsoft Azure SDK for HybridKubernetes Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Hybrid Kubernetes Client. Package tag package-preview-2024-02-01. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,9 @@ UTF-8 - true + 0 + 0 + true @@ -81,8 +88,6 @@ 4.11.0 test - - net.bytebuddy byte-buddy diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/HybridKubernetesManager.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/HybridKubernetesManager.java index 0663d12621016..da3ff3fe5b952 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/HybridKubernetesManager.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/HybridKubernetesManager.java @@ -36,7 +36,10 @@ import java.util.Objects; import java.util.stream.Collectors; -/** Entry point to HybridKubernetesManager. Hybrid Kubernetes Client. */ +/** + * Entry point to HybridKubernetesManager. + * Hybrid Kubernetes Client. + */ public final class HybridKubernetesManager { private ConnectedClusters connectedClusters; @@ -47,18 +50,14 @@ public final class HybridKubernetesManager { private HybridKubernetesManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = - new HybridKubernetesManagementClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); + this.clientObject = new HybridKubernetesManagementClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()).subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval).buildClient(); } /** * Creates an instance of HybridKubernetes service API entry point. - * + * * @param credential the credential to use. * @param profile the Azure profile for client. * @return the HybridKubernetes service API instance. @@ -71,7 +70,7 @@ public static HybridKubernetesManager authenticate(TokenCredential credential, A /** * Creates an instance of HybridKubernetes service API entry point. - * + * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. * @return the HybridKubernetes service API instance. @@ -84,14 +83,16 @@ public static HybridKubernetesManager authenticate(HttpPipeline httpPipeline, Az /** * Gets a Configurable instance that can be used to create HybridKubernetesManager with optional configuration. - * + * * @return the Configurable instance allowing configurations. */ public static Configurable configure() { return new HybridKubernetesManager.Configurable(); } - /** The Configurable allowing configurations to be set. */ + /** + * The Configurable allowing configurations to be set. + */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); @@ -163,8 +164,8 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { /** * Sets the retry options for the HTTP pipeline retry policy. - * - *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. * * @param retryOptions the retry options for the HTTP pipeline retry policy. * @return the configurable object itself. @@ -181,8 +182,8 @@ public Configurable withRetryOptions(RetryOptions retryOptions) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = - Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { throw LOGGER .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); @@ -202,21 +203,12 @@ public HybridKubernetesManager authenticate(TokenCredential credential, AzurePro Objects.requireNonNull(profile, "'profile' cannot be null."); StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder - .append("azsdk-java") - .append("-") - .append("com.azure.resourcemanager.hybridkubernetes") - .append("/") - .append("1.0.0-beta.3"); + userAgentBuilder.append("azsdk-java").append("-").append("com.azure.resourcemanager.hybridkubernetes") + .append("/").append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder - .append(" (") - .append(Configuration.getGlobalConfiguration().get("java.version")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.name")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.version")) - .append("; auto-generated)"); + userAgentBuilder.append(" (").append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ").append(Configuration.getGlobalConfiguration().get("os.name")).append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")).append("; auto-generated)"); } else { userAgentBuilder.append(" (auto-generated)"); } @@ -235,38 +227,25 @@ public HybridKubernetesManager authenticate(TokenCredential credential, AzurePro policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY).collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])).build(); return new HybridKubernetesManager(httpPipeline, profile, defaultPollInterval); } } /** * Gets the resource collection API of ConnectedClusters. It manages ConnectedCluster. - * + * * @return Resource collection API of ConnectedClusters. */ public ConnectedClusters connectedClusters() { @@ -278,7 +257,7 @@ public ConnectedClusters connectedClusters() { /** * Gets the resource collection API of Operations. - * + * * @return Resource collection API of Operations. */ public Operations operations() { @@ -289,8 +268,10 @@ public Operations operations() { } /** - * @return Wrapped service client HybridKubernetesManagementClient providing direct access to the underlying - * auto-generated API implementation, based on Azure REST API. + * Gets wrapped service client HybridKubernetesManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + * + * @return Wrapped service client HybridKubernetesManagementClient. */ public HybridKubernetesManagementClient serviceClient() { return this.clientObject; diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/ConnectedClustersClient.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/ConnectedClustersClient.java index cc2d7ad923da7..d9c5c5d06453c 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/ConnectedClustersClient.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/ConnectedClustersClient.java @@ -16,13 +16,15 @@ import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterPatch; import com.azure.resourcemanager.hybridkubernetes.models.ListClusterUserCredentialProperties; -/** An instance of this class provides access to all the operations defined in ConnectedClustersClient. */ +/** + * An instance of this class provides access to all the operations defined in ConnectedClustersClient. + */ public interface ConnectedClustersClient { /** * Register a new Kubernetes cluster with Azure Resource Manager. - * - *

API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). - * + * + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param connectedCluster Parameters supplied to Create a Connected Cluster. @@ -32,14 +34,14 @@ public interface ConnectedClustersClient { * @return the {@link SyncPoller} for polling of represents a connected cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ConnectedClusterInner> beginCreate( - String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster); + SyncPoller, ConnectedClusterInner> beginCreate(String resourceGroupName, + String clusterName, ConnectedClusterInner connectedCluster); /** * Register a new Kubernetes cluster with Azure Resource Manager. - * - *

API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). - * + * + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param connectedCluster Parameters supplied to Create a Connected Cluster. @@ -50,14 +52,14 @@ SyncPoller, ConnectedClusterInner> beginCreate * @return the {@link SyncPoller} for polling of represents a connected cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ConnectedClusterInner> beginCreate( - String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster, Context context); + SyncPoller, ConnectedClusterInner> beginCreate(String resourceGroupName, + String clusterName, ConnectedClusterInner connectedCluster, Context context); /** * Register a new Kubernetes cluster with Azure Resource Manager. - * - *

API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). - * + * + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param connectedCluster Parameters supplied to Create a Connected Cluster. @@ -71,9 +73,9 @@ SyncPoller, ConnectedClusterInner> beginCreate /** * Register a new Kubernetes cluster with Azure Resource Manager. - * - *

API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). - * + * + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param connectedCluster Parameters supplied to Create a Connected Cluster. @@ -84,14 +86,14 @@ SyncPoller, ConnectedClusterInner> beginCreate * @return represents a connected cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - ConnectedClusterInner create( - String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster, Context context); + ConnectedClusterInner create(String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster, + Context context); /** * Updates a connected cluster. - * - *

API to update certain properties of the connected cluster resource. - * + * + * API to update certain properties of the connected cluster resource. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param connectedClusterPatch Parameters supplied to update Connected Cluster. @@ -102,14 +104,14 @@ ConnectedClusterInner create( * @return represents a connected cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch, Context context); + Response updateWithResponse(String resourceGroupName, String clusterName, + ConnectedClusterPatch connectedClusterPatch, Context context); /** * Updates a connected cluster. - * - *

API to update certain properties of the connected cluster resource. - * + * + * API to update certain properties of the connected cluster resource. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param connectedClusterPatch Parameters supplied to update Connected Cluster. @@ -119,15 +121,15 @@ Response updateWithResponse( * @return represents a connected cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - ConnectedClusterInner update( - String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch); + ConnectedClusterInner update(String resourceGroupName, String clusterName, + ConnectedClusterPatch connectedClusterPatch); /** * Get the properties of the specified connected cluster. - * - *

Returns the properties of the specified connected cluster, including name, identity, properties, and - * additional cluster details. - * + * + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param context The context to associate with this operation. @@ -137,15 +139,15 @@ ConnectedClusterInner update( * @return represents a connected cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String clusterName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, + Context context); /** * Get the properties of the specified connected cluster. - * - *

Returns the properties of the specified connected cluster, including name, identity, properties, and - * additional cluster details. - * + * + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -158,9 +160,9 @@ Response getByResourceGroupWithResponse( /** * Delete a connected cluster. - * - *

Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). - * + * + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -173,9 +175,9 @@ Response getByResourceGroupWithResponse( /** * Delete a connected cluster. - * - *

Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). - * + * + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param context The context to associate with this operation. @@ -189,9 +191,9 @@ Response getByResourceGroupWithResponse( /** * Delete a connected cluster. - * - *

Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). - * + * + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -203,9 +205,9 @@ Response getByResourceGroupWithResponse( /** * Delete a connected cluster. - * - *

Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). - * + * + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param context The context to associate with this operation. @@ -218,9 +220,9 @@ Response getByResourceGroupWithResponse( /** * Gets cluster user credentials of a connected cluster - * - *

Gets cluster user credentials of the connected cluster with a specified resource group and name. - * + * + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param properties ListClusterUserCredential properties. @@ -229,17 +231,17 @@ Response getByResourceGroupWithResponse( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cluster user credentials of the connected cluster with a specified resource group and name along with - * {@link Response}. + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listClusterUserCredentialWithResponse( - String resourceGroupName, String clusterName, ListClusterUserCredentialProperties properties, Context context); + Response listClusterUserCredentialWithResponse(String resourceGroupName, String clusterName, + ListClusterUserCredentialProperties properties, Context context); /** * Gets cluster user credentials of a connected cluster - * - *

Gets cluster user credentials of the connected cluster with a specified resource group and name. - * + * + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param properties ListClusterUserCredential properties. @@ -249,14 +251,14 @@ Response listClusterUserCredentialWithResponse( * @return cluster user credentials of the connected cluster with a specified resource group and name. */ @ServiceMethod(returns = ReturnType.SINGLE) - CredentialResultsInner listClusterUserCredential( - String resourceGroupName, String clusterName, ListClusterUserCredentialProperties properties); + CredentialResultsInner listClusterUserCredential(String resourceGroupName, String clusterName, + ListClusterUserCredentialProperties properties); /** * Lists all connected clusters - * - *

API to enumerate registered connected K8s clusters under a Resource Group. - * + * + * API to enumerate registered connected K8s clusters under a Resource Group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -268,9 +270,9 @@ CredentialResultsInner listClusterUserCredential( /** * Lists all connected clusters - * - *

API to enumerate registered connected K8s clusters under a Resource Group. - * + * + * API to enumerate registered connected K8s clusters under a Resource Group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -283,9 +285,9 @@ CredentialResultsInner listClusterUserCredential( /** * Lists all connected clusters - * - *

API to enumerate registered connected K8s clusters under a Subscription. - * + * + * API to enumerate registered connected K8s clusters under a Subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of connected Clusters as paginated response with {@link PagedIterable}. @@ -295,9 +297,9 @@ CredentialResultsInner listClusterUserCredential( /** * Lists all connected clusters - * - *

API to enumerate registered connected K8s clusters under a Subscription. - * + * + * API to enumerate registered connected K8s clusters under a Subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/HybridKubernetesManagementClient.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/HybridKubernetesManagementClient.java index c31dc9e5b5dd7..b36583492c0ec 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/HybridKubernetesManagementClient.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/HybridKubernetesManagementClient.java @@ -7,53 +7,55 @@ import com.azure.core.http.HttpPipeline; import java.time.Duration; -/** The interface for HybridKubernetesManagementClient class. */ +/** + * The interface for HybridKubernetesManagementClient class. + */ public interface HybridKubernetesManagementClient { /** * Gets The ID of the target subscription. - * + * * @return the subscriptionId value. */ String getSubscriptionId(); /** * Gets server parameter. - * + * * @return the endpoint value. */ String getEndpoint(); /** * Gets Api Version. - * + * * @return the apiVersion value. */ String getApiVersion(); /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ HttpPipeline getHttpPipeline(); /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ Duration getDefaultPollInterval(); /** * Gets the ConnectedClustersClient object to access its operations. - * + * * @return the ConnectedClustersClient object. */ ConnectedClustersClient getConnectedClusters(); /** * Gets the OperationsClient object to access its operations. - * + * * @return the OperationsClient object. */ OperationsClient getOperations(); diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/OperationsClient.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/OperationsClient.java index 890ef30fc7473..01a77b14e3889 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/OperationsClient.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/OperationsClient.java @@ -10,11 +10,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.hybridkubernetes.fluent.models.OperationInner; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public interface OperationsClient { /** * Lists all of the available API operations for Connected Cluster resource. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of connected cluster API operations as paginated response with {@link PagedIterable}. @@ -24,7 +26,7 @@ public interface OperationsClient { /** * Lists all of the available API operations for Connected Cluster resource. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/ConnectedClusterInner.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/ConnectedClusterInner.java index f45b9859c59e8..1b4bdf37fcd3c 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/ConnectedClusterInner.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/ConnectedClusterInner.java @@ -8,14 +8,21 @@ import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridkubernetes.models.AadProfile; +import com.azure.resourcemanager.hybridkubernetes.models.ArcAgentProfile; +import com.azure.resourcemanager.hybridkubernetes.models.AzureHybridBenefit; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterIdentity; +import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterKind; import com.azure.resourcemanager.hybridkubernetes.models.ConnectivityStatus; +import com.azure.resourcemanager.hybridkubernetes.models.PrivateLinkState; import com.azure.resourcemanager.hybridkubernetes.models.ProvisioningState; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.Map; -/** Represents a connected cluster. */ +/** + * Represents a connected cluster. + */ @Fluent public final class ConnectedClusterInner extends Resource { /* @@ -24,6 +31,12 @@ public final class ConnectedClusterInner extends Resource { @JsonProperty(value = "identity", required = true) private ConnectedClusterIdentity identity; + /* + * The kind of connected cluster. + */ + @JsonProperty(value = "kind") + private ConnectedClusterKind kind; + /* * Describes the connected cluster resource properties. */ @@ -36,13 +49,15 @@ public final class ConnectedClusterInner extends Resource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of ConnectedClusterInner class. */ + /** + * Creates an instance of ConnectedClusterInner class. + */ public ConnectedClusterInner() { } /** * Get the identity property: The identity of the connected cluster. - * + * * @return the identity value. */ public ConnectedClusterIdentity identity() { @@ -51,7 +66,7 @@ public ConnectedClusterIdentity identity() { /** * Set the identity property: The identity of the connected cluster. - * + * * @param identity the identity value to set. * @return the ConnectedClusterInner object itself. */ @@ -60,9 +75,29 @@ public ConnectedClusterInner withIdentity(ConnectedClusterIdentity identity) { return this; } + /** + * Get the kind property: The kind of connected cluster. + * + * @return the kind value. + */ + public ConnectedClusterKind kind() { + return this.kind; + } + + /** + * Set the kind property: The kind of connected cluster. + * + * @param kind the kind value to set. + * @return the ConnectedClusterInner object itself. + */ + public ConnectedClusterInner withKind(ConnectedClusterKind kind) { + this.kind = kind; + return this; + } + /** * Get the innerProperties property: Describes the connected cluster resource properties. - * + * * @return the innerProperties value. */ private ConnectedClusterProperties innerProperties() { @@ -71,21 +106,25 @@ private ConnectedClusterProperties innerProperties() { /** * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ConnectedClusterInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ConnectedClusterInner withTags(Map tags) { super.withTags(tags); @@ -93,9 +132,9 @@ public ConnectedClusterInner withTags(Map tags) { } /** - * Get the agentPublicKeyCertificate property: Base64 encoded public certificate used by the agent to do the initial - * handshake to the backend services in Azure. - * + * Get the agentPublicKeyCertificate property: Base64 encoded public certificate used by the agent to do the + * initial handshake to the backend services in Azure. + * * @return the agentPublicKeyCertificate value. */ public String agentPublicKeyCertificate() { @@ -103,9 +142,9 @@ public String agentPublicKeyCertificate() { } /** - * Set the agentPublicKeyCertificate property: Base64 encoded public certificate used by the agent to do the initial - * handshake to the backend services in Azure. - * + * Set the agentPublicKeyCertificate property: Base64 encoded public certificate used by the agent to do the + * initial handshake to the backend services in Azure. + * * @param agentPublicKeyCertificate the agentPublicKeyCertificate value to set. * @return the ConnectedClusterInner object itself. */ @@ -119,7 +158,7 @@ public ConnectedClusterInner withAgentPublicKeyCertificate(String agentPublicKey /** * Get the kubernetesVersion property: The Kubernetes version of the connected cluster resource. - * + * * @return the kubernetesVersion value. */ public String kubernetesVersion() { @@ -128,7 +167,7 @@ public String kubernetesVersion() { /** * Get the totalNodeCount property: Number of nodes present in the connected cluster resource. - * + * * @return the totalNodeCount value. */ public Integer totalNodeCount() { @@ -137,7 +176,7 @@ public Integer totalNodeCount() { /** * Get the totalCoreCount property: Number of CPU cores present in the connected cluster resource. - * + * * @return the totalCoreCount value. */ public Integer totalCoreCount() { @@ -146,7 +185,7 @@ public Integer totalCoreCount() { /** * Get the agentVersion property: Version of the agent running on the connected cluster resource. - * + * * @return the agentVersion value. */ public String agentVersion() { @@ -155,7 +194,7 @@ public String agentVersion() { /** * Get the provisioningState property: Provisioning state of the connected cluster resource. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -164,7 +203,7 @@ public ProvisioningState provisioningState() { /** * Set the provisioningState property: Provisioning state of the connected cluster resource. - * + * * @param provisioningState the provisioningState value to set. * @return the ConnectedClusterInner object itself. */ @@ -178,7 +217,7 @@ public ConnectedClusterInner withProvisioningState(ProvisioningState provisionin /** * Get the distribution property: The Kubernetes distribution running on this connected cluster. - * + * * @return the distribution value. */ public String distribution() { @@ -187,7 +226,7 @@ public String distribution() { /** * Set the distribution property: The Kubernetes distribution running on this connected cluster. - * + * * @param distribution the distribution value to set. * @return the ConnectedClusterInner object itself. */ @@ -200,9 +239,32 @@ public ConnectedClusterInner withDistribution(String distribution) { } /** - * Get the infrastructure property: The infrastructure on which the Kubernetes cluster represented by this connected - * cluster is running on. - * + * Get the distributionVersion property: The Kubernetes distribution version on this connected cluster. + * + * @return the distributionVersion value. + */ + public String distributionVersion() { + return this.innerProperties() == null ? null : this.innerProperties().distributionVersion(); + } + + /** + * Set the distributionVersion property: The Kubernetes distribution version on this connected cluster. + * + * @param distributionVersion the distributionVersion value to set. + * @return the ConnectedClusterInner object itself. + */ + public ConnectedClusterInner withDistributionVersion(String distributionVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedClusterProperties(); + } + this.innerProperties().withDistributionVersion(distributionVersion); + return this; + } + + /** + * Get the infrastructure property: The infrastructure on which the Kubernetes cluster represented by this + * connected cluster is running on. + * * @return the infrastructure value. */ public String infrastructure() { @@ -210,9 +272,9 @@ public String infrastructure() { } /** - * Set the infrastructure property: The infrastructure on which the Kubernetes cluster represented by this connected - * cluster is running on. - * + * Set the infrastructure property: The infrastructure on which the Kubernetes cluster represented by this + * connected cluster is running on. + * * @param infrastructure the infrastructure value to set. * @return the ConnectedClusterInner object itself. */ @@ -226,7 +288,7 @@ public ConnectedClusterInner withInfrastructure(String infrastructure) { /** * Get the offering property: Connected cluster offering. - * + * * @return the offering value. */ public String offering() { @@ -235,19 +297,18 @@ public String offering() { /** * Get the managedIdentityCertificateExpirationTime property: Expiration time of the managed identity certificate. - * + * * @return the managedIdentityCertificateExpirationTime value. */ public OffsetDateTime managedIdentityCertificateExpirationTime() { - return this.innerProperties() == null - ? null + return this.innerProperties() == null ? null : this.innerProperties().managedIdentityCertificateExpirationTime(); } /** * Get the lastConnectivityTime property: Time representing the last instance when heart beat was received from the * cluster. - * + * * @return the lastConnectivityTime value. */ public OffsetDateTime lastConnectivityTime() { @@ -256,31 +317,156 @@ public OffsetDateTime lastConnectivityTime() { /** * Get the connectivityStatus property: Represents the connectivity status of the connected cluster. - * + * * @return the connectivityStatus value. */ public ConnectivityStatus connectivityStatus() { return this.innerProperties() == null ? null : this.innerProperties().connectivityStatus(); } + /** + * Get the privateLinkState property: Property which describes the state of private link on a connected cluster + * resource. + * + * @return the privateLinkState value. + */ + public PrivateLinkState privateLinkState() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkState(); + } + + /** + * Set the privateLinkState property: Property which describes the state of private link on a connected cluster + * resource. + * + * @param privateLinkState the privateLinkState value to set. + * @return the ConnectedClusterInner object itself. + */ + public ConnectedClusterInner withPrivateLinkState(PrivateLinkState privateLinkState) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedClusterProperties(); + } + this.innerProperties().withPrivateLinkState(privateLinkState); + return this; + } + + /** + * Get the privateLinkScopeResourceId property: The resource id of the private link scope this connected cluster is + * assigned to, if any. + * + * @return the privateLinkScopeResourceId value. + */ + public String privateLinkScopeResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkScopeResourceId(); + } + + /** + * Set the privateLinkScopeResourceId property: The resource id of the private link scope this connected cluster is + * assigned to, if any. + * + * @param privateLinkScopeResourceId the privateLinkScopeResourceId value to set. + * @return the ConnectedClusterInner object itself. + */ + public ConnectedClusterInner withPrivateLinkScopeResourceId(String privateLinkScopeResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedClusterProperties(); + } + this.innerProperties().withPrivateLinkScopeResourceId(privateLinkScopeResourceId); + return this; + } + + /** + * Get the azureHybridBenefit property: Indicates whether Azure Hybrid Benefit is opted in. + * + * @return the azureHybridBenefit value. + */ + public AzureHybridBenefit azureHybridBenefit() { + return this.innerProperties() == null ? null : this.innerProperties().azureHybridBenefit(); + } + + /** + * Set the azureHybridBenefit property: Indicates whether Azure Hybrid Benefit is opted in. + * + * @param azureHybridBenefit the azureHybridBenefit value to set. + * @return the ConnectedClusterInner object itself. + */ + public ConnectedClusterInner withAzureHybridBenefit(AzureHybridBenefit azureHybridBenefit) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedClusterProperties(); + } + this.innerProperties().withAzureHybridBenefit(azureHybridBenefit); + return this; + } + + /** + * Get the aadProfile property: AAD profile for the connected cluster. + * + * @return the aadProfile value. + */ + public AadProfile aadProfile() { + return this.innerProperties() == null ? null : this.innerProperties().aadProfile(); + } + + /** + * Set the aadProfile property: AAD profile for the connected cluster. + * + * @param aadProfile the aadProfile value to set. + * @return the ConnectedClusterInner object itself. + */ + public ConnectedClusterInner withAadProfile(AadProfile aadProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedClusterProperties(); + } + this.innerProperties().withAadProfile(aadProfile); + return this; + } + + /** + * Get the arcAgentProfile property: Arc agentry configuration for the provisioned cluster. + * + * @return the arcAgentProfile value. + */ + public ArcAgentProfile arcAgentProfile() { + return this.innerProperties() == null ? null : this.innerProperties().arcAgentProfile(); + } + + /** + * Set the arcAgentProfile property: Arc agentry configuration for the provisioned cluster. + * + * @param arcAgentProfile the arcAgentProfile value to set. + * @return the ConnectedClusterInner object itself. + */ + public ConnectedClusterInner withArcAgentProfile(ArcAgentProfile arcAgentProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedClusterProperties(); + } + this.innerProperties().withArcAgentProfile(arcAgentProfile); + return this; + } + + /** + * Get the miscellaneousProperties property: More properties related to the Connected Cluster. + * + * @return the miscellaneousProperties value. + */ + public Map miscellaneousProperties() { + return this.innerProperties() == null ? null : this.innerProperties().miscellaneousProperties(); + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (identity() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property identity in model ConnectedClusterInner")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property identity in model ConnectedClusterInner")); } else { identity().validate(); } if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model ConnectedClusterInner")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property innerProperties in model ConnectedClusterInner")); } else { innerProperties().validate(); } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/ConnectedClusterPatchProperties.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/ConnectedClusterPatchProperties.java new file mode 100644 index 0000000000000..77206a3b29cee --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/ConnectedClusterPatchProperties.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridkubernetes.models.AzureHybridBenefit; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties which can be patched on the connected cluster resource. + */ +@Fluent +public final class ConnectedClusterPatchProperties { + /* + * Represents the distribution of the connected cluster + */ + @JsonProperty(value = "distribution") + private String distribution; + + /* + * Represents the Kubernetes distribution version on this connected cluster. + */ + @JsonProperty(value = "distributionVersion") + private String distributionVersion; + + /* + * Indicates whether Azure Hybrid Benefit is opted in + */ + @JsonProperty(value = "azureHybridBenefit") + private AzureHybridBenefit azureHybridBenefit; + + /** + * Creates an instance of ConnectedClusterPatchProperties class. + */ + public ConnectedClusterPatchProperties() { + } + + /** + * Get the distribution property: Represents the distribution of the connected cluster. + * + * @return the distribution value. + */ + public String distribution() { + return this.distribution; + } + + /** + * Set the distribution property: Represents the distribution of the connected cluster. + * + * @param distribution the distribution value to set. + * @return the ConnectedClusterPatchProperties object itself. + */ + public ConnectedClusterPatchProperties withDistribution(String distribution) { + this.distribution = distribution; + return this; + } + + /** + * Get the distributionVersion property: Represents the Kubernetes distribution version on this connected cluster. + * + * @return the distributionVersion value. + */ + public String distributionVersion() { + return this.distributionVersion; + } + + /** + * Set the distributionVersion property: Represents the Kubernetes distribution version on this connected cluster. + * + * @param distributionVersion the distributionVersion value to set. + * @return the ConnectedClusterPatchProperties object itself. + */ + public ConnectedClusterPatchProperties withDistributionVersion(String distributionVersion) { + this.distributionVersion = distributionVersion; + return this; + } + + /** + * Get the azureHybridBenefit property: Indicates whether Azure Hybrid Benefit is opted in. + * + * @return the azureHybridBenefit value. + */ + public AzureHybridBenefit azureHybridBenefit() { + return this.azureHybridBenefit; + } + + /** + * Set the azureHybridBenefit property: Indicates whether Azure Hybrid Benefit is opted in. + * + * @param azureHybridBenefit the azureHybridBenefit value to set. + * @return the ConnectedClusterPatchProperties object itself. + */ + public ConnectedClusterPatchProperties withAzureHybridBenefit(AzureHybridBenefit azureHybridBenefit) { + this.azureHybridBenefit = azureHybridBenefit; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/ConnectedClusterProperties.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/ConnectedClusterProperties.java index a15ddb0182a67..e8861fa4b7bc4 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/ConnectedClusterProperties.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/ConnectedClusterProperties.java @@ -6,12 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridkubernetes.models.AadProfile; +import com.azure.resourcemanager.hybridkubernetes.models.ArcAgentProfile; +import com.azure.resourcemanager.hybridkubernetes.models.AzureHybridBenefit; import com.azure.resourcemanager.hybridkubernetes.models.ConnectivityStatus; +import com.azure.resourcemanager.hybridkubernetes.models.PrivateLinkState; import com.azure.resourcemanager.hybridkubernetes.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; +import java.util.Map; -/** Properties of the connected cluster. */ +/** + * Properties of the connected cluster. + */ @Fluent public final class ConnectedClusterProperties { /* @@ -57,6 +65,12 @@ public final class ConnectedClusterProperties { @JsonProperty(value = "distribution") private String distribution; + /* + * The Kubernetes distribution version on this connected cluster. + */ + @JsonProperty(value = "distributionVersion") + private String distributionVersion; + /* * The infrastructure on which the Kubernetes cluster represented by this connected cluster is running on. */ @@ -87,14 +101,53 @@ public final class ConnectedClusterProperties { @JsonProperty(value = "connectivityStatus", access = JsonProperty.Access.WRITE_ONLY) private ConnectivityStatus connectivityStatus; - /** Creates an instance of ConnectedClusterProperties class. */ + /* + * Property which describes the state of private link on a connected cluster resource. + */ + @JsonProperty(value = "privateLinkState") + private PrivateLinkState privateLinkState; + + /* + * The resource id of the private link scope this connected cluster is assigned to, if any. + */ + @JsonProperty(value = "privateLinkScopeResourceId") + private String privateLinkScopeResourceId; + + /* + * Indicates whether Azure Hybrid Benefit is opted in + */ + @JsonProperty(value = "azureHybridBenefit") + private AzureHybridBenefit azureHybridBenefit; + + /* + * AAD profile for the connected cluster. + */ + @JsonProperty(value = "aadProfile") + private AadProfile aadProfile; + + /* + * Arc agentry configuration for the provisioned cluster. + */ + @JsonProperty(value = "arcAgentProfile") + private ArcAgentProfile arcAgentProfile; + + /* + * More properties related to the Connected Cluster + */ + @JsonProperty(value = "miscellaneousProperties", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map miscellaneousProperties; + + /** + * Creates an instance of ConnectedClusterProperties class. + */ public ConnectedClusterProperties() { } /** - * Get the agentPublicKeyCertificate property: Base64 encoded public certificate used by the agent to do the initial - * handshake to the backend services in Azure. - * + * Get the agentPublicKeyCertificate property: Base64 encoded public certificate used by the agent to do the + * initial handshake to the backend services in Azure. + * * @return the agentPublicKeyCertificate value. */ public String agentPublicKeyCertificate() { @@ -102,9 +155,9 @@ public String agentPublicKeyCertificate() { } /** - * Set the agentPublicKeyCertificate property: Base64 encoded public certificate used by the agent to do the initial - * handshake to the backend services in Azure. - * + * Set the agentPublicKeyCertificate property: Base64 encoded public certificate used by the agent to do the + * initial handshake to the backend services in Azure. + * * @param agentPublicKeyCertificate the agentPublicKeyCertificate value to set. * @return the ConnectedClusterProperties object itself. */ @@ -115,7 +168,7 @@ public ConnectedClusterProperties withAgentPublicKeyCertificate(String agentPubl /** * Get the kubernetesVersion property: The Kubernetes version of the connected cluster resource. - * + * * @return the kubernetesVersion value. */ public String kubernetesVersion() { @@ -124,7 +177,7 @@ public String kubernetesVersion() { /** * Get the totalNodeCount property: Number of nodes present in the connected cluster resource. - * + * * @return the totalNodeCount value. */ public Integer totalNodeCount() { @@ -133,7 +186,7 @@ public Integer totalNodeCount() { /** * Get the totalCoreCount property: Number of CPU cores present in the connected cluster resource. - * + * * @return the totalCoreCount value. */ public Integer totalCoreCount() { @@ -142,7 +195,7 @@ public Integer totalCoreCount() { /** * Get the agentVersion property: Version of the agent running on the connected cluster resource. - * + * * @return the agentVersion value. */ public String agentVersion() { @@ -151,7 +204,7 @@ public String agentVersion() { /** * Get the provisioningState property: Provisioning state of the connected cluster resource. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -160,7 +213,7 @@ public ProvisioningState provisioningState() { /** * Set the provisioningState property: Provisioning state of the connected cluster resource. - * + * * @param provisioningState the provisioningState value to set. * @return the ConnectedClusterProperties object itself. */ @@ -171,7 +224,7 @@ public ConnectedClusterProperties withProvisioningState(ProvisioningState provis /** * Get the distribution property: The Kubernetes distribution running on this connected cluster. - * + * * @return the distribution value. */ public String distribution() { @@ -180,7 +233,7 @@ public String distribution() { /** * Set the distribution property: The Kubernetes distribution running on this connected cluster. - * + * * @param distribution the distribution value to set. * @return the ConnectedClusterProperties object itself. */ @@ -190,9 +243,29 @@ public ConnectedClusterProperties withDistribution(String distribution) { } /** - * Get the infrastructure property: The infrastructure on which the Kubernetes cluster represented by this connected - * cluster is running on. - * + * Get the distributionVersion property: The Kubernetes distribution version on this connected cluster. + * + * @return the distributionVersion value. + */ + public String distributionVersion() { + return this.distributionVersion; + } + + /** + * Set the distributionVersion property: The Kubernetes distribution version on this connected cluster. + * + * @param distributionVersion the distributionVersion value to set. + * @return the ConnectedClusterProperties object itself. + */ + public ConnectedClusterProperties withDistributionVersion(String distributionVersion) { + this.distributionVersion = distributionVersion; + return this; + } + + /** + * Get the infrastructure property: The infrastructure on which the Kubernetes cluster represented by this + * connected cluster is running on. + * * @return the infrastructure value. */ public String infrastructure() { @@ -200,9 +273,9 @@ public String infrastructure() { } /** - * Set the infrastructure property: The infrastructure on which the Kubernetes cluster represented by this connected - * cluster is running on. - * + * Set the infrastructure property: The infrastructure on which the Kubernetes cluster represented by this + * connected cluster is running on. + * * @param infrastructure the infrastructure value to set. * @return the ConnectedClusterProperties object itself. */ @@ -213,7 +286,7 @@ public ConnectedClusterProperties withInfrastructure(String infrastructure) { /** * Get the offering property: Connected cluster offering. - * + * * @return the offering value. */ public String offering() { @@ -222,7 +295,7 @@ public String offering() { /** * Get the managedIdentityCertificateExpirationTime property: Expiration time of the managed identity certificate. - * + * * @return the managedIdentityCertificateExpirationTime value. */ public OffsetDateTime managedIdentityCertificateExpirationTime() { @@ -232,7 +305,7 @@ public OffsetDateTime managedIdentityCertificateExpirationTime() { /** * Get the lastConnectivityTime property: Time representing the last instance when heart beat was received from the * cluster. - * + * * @return the lastConnectivityTime value. */ public OffsetDateTime lastConnectivityTime() { @@ -241,24 +314,141 @@ public OffsetDateTime lastConnectivityTime() { /** * Get the connectivityStatus property: Represents the connectivity status of the connected cluster. - * + * * @return the connectivityStatus value. */ public ConnectivityStatus connectivityStatus() { return this.connectivityStatus; } + /** + * Get the privateLinkState property: Property which describes the state of private link on a connected cluster + * resource. + * + * @return the privateLinkState value. + */ + public PrivateLinkState privateLinkState() { + return this.privateLinkState; + } + + /** + * Set the privateLinkState property: Property which describes the state of private link on a connected cluster + * resource. + * + * @param privateLinkState the privateLinkState value to set. + * @return the ConnectedClusterProperties object itself. + */ + public ConnectedClusterProperties withPrivateLinkState(PrivateLinkState privateLinkState) { + this.privateLinkState = privateLinkState; + return this; + } + + /** + * Get the privateLinkScopeResourceId property: The resource id of the private link scope this connected cluster is + * assigned to, if any. + * + * @return the privateLinkScopeResourceId value. + */ + public String privateLinkScopeResourceId() { + return this.privateLinkScopeResourceId; + } + + /** + * Set the privateLinkScopeResourceId property: The resource id of the private link scope this connected cluster is + * assigned to, if any. + * + * @param privateLinkScopeResourceId the privateLinkScopeResourceId value to set. + * @return the ConnectedClusterProperties object itself. + */ + public ConnectedClusterProperties withPrivateLinkScopeResourceId(String privateLinkScopeResourceId) { + this.privateLinkScopeResourceId = privateLinkScopeResourceId; + return this; + } + + /** + * Get the azureHybridBenefit property: Indicates whether Azure Hybrid Benefit is opted in. + * + * @return the azureHybridBenefit value. + */ + public AzureHybridBenefit azureHybridBenefit() { + return this.azureHybridBenefit; + } + + /** + * Set the azureHybridBenefit property: Indicates whether Azure Hybrid Benefit is opted in. + * + * @param azureHybridBenefit the azureHybridBenefit value to set. + * @return the ConnectedClusterProperties object itself. + */ + public ConnectedClusterProperties withAzureHybridBenefit(AzureHybridBenefit azureHybridBenefit) { + this.azureHybridBenefit = azureHybridBenefit; + return this; + } + + /** + * Get the aadProfile property: AAD profile for the connected cluster. + * + * @return the aadProfile value. + */ + public AadProfile aadProfile() { + return this.aadProfile; + } + + /** + * Set the aadProfile property: AAD profile for the connected cluster. + * + * @param aadProfile the aadProfile value to set. + * @return the ConnectedClusterProperties object itself. + */ + public ConnectedClusterProperties withAadProfile(AadProfile aadProfile) { + this.aadProfile = aadProfile; + return this; + } + + /** + * Get the arcAgentProfile property: Arc agentry configuration for the provisioned cluster. + * + * @return the arcAgentProfile value. + */ + public ArcAgentProfile arcAgentProfile() { + return this.arcAgentProfile; + } + + /** + * Set the arcAgentProfile property: Arc agentry configuration for the provisioned cluster. + * + * @param arcAgentProfile the arcAgentProfile value to set. + * @return the ConnectedClusterProperties object itself. + */ + public ConnectedClusterProperties withArcAgentProfile(ArcAgentProfile arcAgentProfile) { + this.arcAgentProfile = arcAgentProfile; + return this; + } + + /** + * Get the miscellaneousProperties property: More properties related to the Connected Cluster. + * + * @return the miscellaneousProperties value. + */ + public Map miscellaneousProperties() { + return this.miscellaneousProperties; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (agentPublicKeyCertificate() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property agentPublicKeyCertificate in model ConnectedClusterProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property agentPublicKeyCertificate in model ConnectedClusterProperties")); + } + if (aadProfile() != null) { + aadProfile().validate(); + } + if (arcAgentProfile() != null) { + arcAgentProfile().validate(); } } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/CredentialResultsInner.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/CredentialResultsInner.java index df0b04ef4e372..d091d059a4fdf 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/CredentialResultsInner.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/CredentialResultsInner.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The list of credential result response. */ +/** + * The list of credential result response. + */ @Immutable public final class CredentialResultsInner { /* @@ -25,13 +27,15 @@ public final class CredentialResultsInner { @JsonProperty(value = "kubeconfigs", access = JsonProperty.Access.WRITE_ONLY) private List kubeconfigs; - /** Creates an instance of CredentialResultsInner class. */ + /** + * Creates an instance of CredentialResultsInner class. + */ public CredentialResultsInner() { } /** * Get the hybridConnectionConfig property: Contains the REP (rendezvous endpoint) and “Sender” access token. - * + * * @return the hybridConnectionConfig value. */ public HybridConnectionConfig hybridConnectionConfig() { @@ -40,7 +44,7 @@ public HybridConnectionConfig hybridConnectionConfig() { /** * Get the kubeconfigs property: Base64-encoded Kubernetes configuration file. - * + * * @return the kubeconfigs value. */ public List kubeconfigs() { @@ -49,7 +53,7 @@ public List kubeconfigs() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/OperationInner.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/OperationInner.java index 51a80e949eca0..147d0b226aaa1 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/OperationInner.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/OperationInner.java @@ -8,7 +8,9 @@ import com.azure.resourcemanager.hybridkubernetes.models.OperationDisplay; import com.fasterxml.jackson.annotation.JsonProperty; -/** The Connected cluster API operation. */ +/** + * The Connected cluster API operation. + */ @Immutable public final class OperationInner { /* @@ -23,13 +25,15 @@ public final class OperationInner { @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY) private OperationDisplay display; - /** Creates an instance of OperationInner class. */ + /** + * Creates an instance of OperationInner class. + */ public OperationInner() { } /** * Get the name property: Operation name: {Microsoft.Kubernetes}/{resource}/{operation}. - * + * * @return the name value. */ public String name() { @@ -38,7 +42,7 @@ public String name() { /** * Get the display property: The object that represents the operation. - * + * * @return the display value. */ public OperationDisplay display() { @@ -47,7 +51,7 @@ public OperationDisplay display() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/package-info.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/package-info.java index 92666e60ba3e3..036fc43e4718e 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/package-info.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the inner data models for HybridKubernetesManagementClient. Hybrid Kubernetes Client. */ +/** + * Package containing the inner data models for HybridKubernetesManagementClient. + * Hybrid Kubernetes Client. + */ package com.azure.resourcemanager.hybridkubernetes.fluent.models; diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/package-info.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/package-info.java index a5e760c6f750c..c6a3a99ae34b6 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/package-info.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the service clients for HybridKubernetesManagementClient. Hybrid Kubernetes Client. */ +/** + * Package containing the service clients for HybridKubernetesManagementClient. + * Hybrid Kubernetes Client. + */ package com.azure.resourcemanager.hybridkubernetes.fluent; diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClusterImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClusterImpl.java index 7b5c15d948ead..c64e1f65ecb4f 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClusterImpl.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClusterImpl.java @@ -9,12 +9,17 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.hybridkubernetes.fluent.models.ConnectedClusterInner; +import com.azure.resourcemanager.hybridkubernetes.models.AadProfile; +import com.azure.resourcemanager.hybridkubernetes.models.ArcAgentProfile; +import com.azure.resourcemanager.hybridkubernetes.models.AzureHybridBenefit; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedCluster; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterIdentity; +import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterKind; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterPatch; import com.azure.resourcemanager.hybridkubernetes.models.ConnectivityStatus; import com.azure.resourcemanager.hybridkubernetes.models.CredentialResults; import com.azure.resourcemanager.hybridkubernetes.models.ListClusterUserCredentialProperties; +import com.azure.resourcemanager.hybridkubernetes.models.PrivateLinkState; import com.azure.resourcemanager.hybridkubernetes.models.ProvisioningState; import java.time.OffsetDateTime; import java.util.Collections; @@ -55,6 +60,10 @@ public ConnectedClusterIdentity identity() { return this.innerModel().identity(); } + public ConnectedClusterKind kind() { + return this.innerModel().kind(); + } + public SystemData systemData() { return this.innerModel().systemData(); } @@ -87,6 +96,10 @@ public String distribution() { return this.innerModel().distribution(); } + public String distributionVersion() { + return this.innerModel().distributionVersion(); + } + public String infrastructure() { return this.innerModel().infrastructure(); } @@ -107,6 +120,35 @@ public ConnectivityStatus connectivityStatus() { return this.innerModel().connectivityStatus(); } + public PrivateLinkState privateLinkState() { + return this.innerModel().privateLinkState(); + } + + public String privateLinkScopeResourceId() { + return this.innerModel().privateLinkScopeResourceId(); + } + + public AzureHybridBenefit azureHybridBenefit() { + return this.innerModel().azureHybridBenefit(); + } + + public AadProfile aadProfile() { + return this.innerModel().aadProfile(); + } + + public ArcAgentProfile arcAgentProfile() { + return this.innerModel().arcAgentProfile(); + } + + public Map miscellaneousProperties() { + Map inner = this.innerModel().miscellaneousProperties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + public Region region() { return Region.fromName(this.regionName()); } @@ -139,25 +181,19 @@ public ConnectedClusterImpl withExistingResourceGroup(String resourceGroupName) } public ConnectedCluster create() { - this.innerObject = - serviceManager - .serviceClient() - .getConnectedClusters() - .create(resourceGroupName, clusterName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient().getConnectedClusters().create(resourceGroupName, clusterName, + this.innerModel(), Context.NONE); return this; } public ConnectedCluster create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getConnectedClusters() - .create(resourceGroupName, clusterName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient().getConnectedClusters().create(resourceGroupName, clusterName, + this.innerModel(), context); return this; } - ConnectedClusterImpl( - String name, com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { + ConnectedClusterImpl(String name, + com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { this.innerObject = new ConnectedClusterInner(); this.serviceManager = serviceManager; this.clusterName = name; @@ -169,59 +205,41 @@ public ConnectedClusterImpl update() { } public ConnectedCluster apply() { - this.innerObject = - serviceManager - .serviceClient() - .getConnectedClusters() - .updateWithResponse(resourceGroupName, clusterName, updateConnectedClusterPatch, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getConnectedClusters() + .updateWithResponse(resourceGroupName, clusterName, updateConnectedClusterPatch, Context.NONE).getValue(); return this; } public ConnectedCluster apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getConnectedClusters() - .updateWithResponse(resourceGroupName, clusterName, updateConnectedClusterPatch, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getConnectedClusters() + .updateWithResponse(resourceGroupName, clusterName, updateConnectedClusterPatch, context).getValue(); return this; } - ConnectedClusterImpl( - ConnectedClusterInner innerObject, + ConnectedClusterImpl(ConnectedClusterInner innerObject, com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourcegroups"); - this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "connectedClusters"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourcegroups"); + this.clusterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "connectedClusters"); } public ConnectedCluster refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getConnectedClusters() - .getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getConnectedClusters() + .getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); return this; } public ConnectedCluster refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getConnectedClusters() - .getByResourceGroupWithResponse(resourceGroupName, clusterName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getConnectedClusters() + .getByResourceGroupWithResponse(resourceGroupName, clusterName, context).getValue(); return this; } - public Response listClusterUserCredentialWithResponse( - ListClusterUserCredentialProperties properties, Context context) { - return serviceManager - .connectedClusters() - .listClusterUserCredentialWithResponse(resourceGroupName, clusterName, properties, context); + public Response + listClusterUserCredentialWithResponse(ListClusterUserCredentialProperties properties, Context context) { + return serviceManager.connectedClusters().listClusterUserCredentialWithResponse(resourceGroupName, clusterName, + properties, context); } public CredentialResults listClusterUserCredential(ListClusterUserCredentialProperties properties) { @@ -258,14 +276,34 @@ public ConnectedClusterImpl withTags(Map tags) { } } + public ConnectedClusterImpl withKind(ConnectedClusterKind kind) { + this.innerModel().withKind(kind); + return this; + } + public ConnectedClusterImpl withProvisioningState(ProvisioningState provisioningState) { this.innerModel().withProvisioningState(provisioningState); return this; } public ConnectedClusterImpl withDistribution(String distribution) { - this.innerModel().withDistribution(distribution); - return this; + if (isInCreateMode()) { + this.innerModel().withDistribution(distribution); + return this; + } else { + this.updateConnectedClusterPatch.withDistribution(distribution); + return this; + } + } + + public ConnectedClusterImpl withDistributionVersion(String distributionVersion) { + if (isInCreateMode()) { + this.innerModel().withDistributionVersion(distributionVersion); + return this; + } else { + this.updateConnectedClusterPatch.withDistributionVersion(distributionVersion); + return this; + } } public ConnectedClusterImpl withInfrastructure(String infrastructure) { @@ -273,8 +311,33 @@ public ConnectedClusterImpl withInfrastructure(String infrastructure) { return this; } - public ConnectedClusterImpl withProperties(Object properties) { - this.updateConnectedClusterPatch.withProperties(properties); + public ConnectedClusterImpl withPrivateLinkState(PrivateLinkState privateLinkState) { + this.innerModel().withPrivateLinkState(privateLinkState); + return this; + } + + public ConnectedClusterImpl withPrivateLinkScopeResourceId(String privateLinkScopeResourceId) { + this.innerModel().withPrivateLinkScopeResourceId(privateLinkScopeResourceId); + return this; + } + + public ConnectedClusterImpl withAzureHybridBenefit(AzureHybridBenefit azureHybridBenefit) { + if (isInCreateMode()) { + this.innerModel().withAzureHybridBenefit(azureHybridBenefit); + return this; + } else { + this.updateConnectedClusterPatch.withAzureHybridBenefit(azureHybridBenefit); + return this; + } + } + + public ConnectedClusterImpl withAadProfile(AadProfile aadProfile) { + this.innerModel().withAadProfile(aadProfile); + return this; + } + + public ConnectedClusterImpl withArcAgentProfile(ArcAgentProfile arcAgentProfile) { + this.innerModel().withArcAgentProfile(arcAgentProfile); return this; } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersClientImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersClientImpl.java index 552503335b04e..17ede463b2c11 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersClientImpl.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersClientImpl.java @@ -43,22 +43,28 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ConnectedClustersClient. */ +/** + * An instance of this class provides access to all the operations defined in ConnectedClustersClient. + */ public final class ConnectedClustersClientImpl implements ConnectedClustersClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ConnectedClustersService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final HybridKubernetesManagementClientImpl client; /** * Initializes an instance of ConnectedClustersClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ConnectedClustersClientImpl(HybridKubernetesManagementClientImpl client) { - this.service = - RestProxy.create(ConnectedClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(ConnectedClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -69,135 +75,93 @@ public final class ConnectedClustersClientImpl implements ConnectedClustersClien @Host("{$host}") @ServiceInterface(name = "HybridKubernetesMana") public interface ConnectedClustersService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes" - + "/connectedClusters/{clusterName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, - @BodyParam("application/json") ConnectedClusterInner connectedCluster, - @HeaderParam("Accept") String accept, + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @BodyParam("application/json") ConnectedClusterInner connectedCluster, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes" - + "/connectedClusters/{clusterName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @BodyParam("application/json") ConnectedClusterPatch connectedClusterPatch, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes" - + "/connectedClusters/{clusterName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes" - + "/connectedClusters/{clusterName}") - @ExpectedResponses({200, 202, 204}) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes" - + "/connectedClusters/{clusterName}/listClusterUserCredential") - @ExpectedResponses({200}) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}/listClusterUserCredential") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listClusterUserCredential( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterName") String clusterName, + Mono> listClusterUserCredential(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @BodyParam("application/json") ListClusterUserCredentialProperties properties, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes" - + "/connectedClusters") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @HeaderParam("Accept") String accept, + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Kubernetes/connectedClusters") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Register a new Kubernetes cluster with Azure Resource Manager. - * - *

API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). - * + * + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param connectedCluster Parameters supplied to Create a Connected Cluster. @@ -207,19 +171,15 @@ Mono> listBySubscriptionNext( * @return represents a connected cluster along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster) { + private Mono>> createWithResponseAsync(String resourceGroupName, String clusterName, + ConnectedClusterInner connectedCluster) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -236,26 +196,16 @@ private Mono>> createWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - connectedCluster, - accept, - context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, connectedCluster, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Register a new Kubernetes cluster with Azure Resource Manager. - * - *

API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). - * + * + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param connectedCluster Parameters supplied to Create a Connected Cluster. @@ -266,19 +216,15 @@ private Mono>> createWithResponseAsync( * @return represents a connected cluster along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster, Context context) { + private Mono>> createWithResponseAsync(String resourceGroupName, String clusterName, + ConnectedClusterInner connectedCluster, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -295,23 +241,15 @@ private Mono>> createWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - connectedCluster, - accept, - context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, connectedCluster, accept, context); } /** * Register a new Kubernetes cluster with Azure Resource Manager. - * - *

API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). - * + * + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param connectedCluster Parameters supplied to Create a Connected Cluster. @@ -321,25 +259,20 @@ private Mono>> createWithResponseAsync( * @return the {@link PollerFlux} for polling of represents a connected cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ConnectedClusterInner> beginCreateAsync( - String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster) { - Mono>> mono = - createWithResponseAsync(resourceGroupName, clusterName, connectedCluster); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ConnectedClusterInner.class, - ConnectedClusterInner.class, - this.client.getContext()); + private PollerFlux, ConnectedClusterInner> + beginCreateAsync(String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, clusterName, connectedCluster); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ConnectedClusterInner.class, ConnectedClusterInner.class, + this.client.getContext()); } /** * Register a new Kubernetes cluster with Azure Resource Manager. - * - *

API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). - * + * + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param connectedCluster Parameters supplied to Create a Connected Cluster. @@ -353,19 +286,17 @@ private PollerFlux, ConnectedClusterInner> beg private PollerFlux, ConnectedClusterInner> beginCreateAsync( String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createWithResponseAsync(resourceGroupName, clusterName, connectedCluster, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ConnectedClusterInner.class, ConnectedClusterInner.class, context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, clusterName, connectedCluster, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ConnectedClusterInner.class, ConnectedClusterInner.class, context); } /** * Register a new Kubernetes cluster with Azure Resource Manager. - * - *

API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). - * + * + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param connectedCluster Parameters supplied to Create a Connected Cluster. @@ -375,16 +306,16 @@ private PollerFlux, ConnectedClusterInner> beg * @return the {@link SyncPoller} for polling of represents a connected cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ConnectedClusterInner> beginCreate( - String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster) { + public SyncPoller, ConnectedClusterInner> beginCreate(String resourceGroupName, + String clusterName, ConnectedClusterInner connectedCluster) { return this.beginCreateAsync(resourceGroupName, clusterName, connectedCluster).getSyncPoller(); } /** * Register a new Kubernetes cluster with Azure Resource Manager. - * - *

API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). - * + * + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param connectedCluster Parameters supplied to Create a Connected Cluster. @@ -395,16 +326,16 @@ public SyncPoller, ConnectedClusterInner> begi * @return the {@link SyncPoller} for polling of represents a connected cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ConnectedClusterInner> beginCreate( - String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster, Context context) { + public SyncPoller, ConnectedClusterInner> beginCreate(String resourceGroupName, + String clusterName, ConnectedClusterInner connectedCluster, Context context) { return this.beginCreateAsync(resourceGroupName, clusterName, connectedCluster, context).getSyncPoller(); } /** * Register a new Kubernetes cluster with Azure Resource Manager. - * - *

API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). - * + * + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param connectedCluster Parameters supplied to Create a Connected Cluster. @@ -414,18 +345,17 @@ public SyncPoller, ConnectedClusterInner> begi * @return represents a connected cluster on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster) { - return beginCreateAsync(resourceGroupName, clusterName, connectedCluster) - .last() + private Mono createAsync(String resourceGroupName, String clusterName, + ConnectedClusterInner connectedCluster) { + return beginCreateAsync(resourceGroupName, clusterName, connectedCluster).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Register a new Kubernetes cluster with Azure Resource Manager. - * - *

API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). - * + * + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param connectedCluster Parameters supplied to Create a Connected Cluster. @@ -436,18 +366,17 @@ private Mono createAsync( * @return represents a connected cluster on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster, Context context) { - return beginCreateAsync(resourceGroupName, clusterName, connectedCluster, context) - .last() + private Mono createAsync(String resourceGroupName, String clusterName, + ConnectedClusterInner connectedCluster, Context context) { + return beginCreateAsync(resourceGroupName, clusterName, connectedCluster, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Register a new Kubernetes cluster with Azure Resource Manager. - * - *

API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). - * + * + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param connectedCluster Parameters supplied to Create a Connected Cluster. @@ -457,16 +386,16 @@ private Mono createAsync( * @return represents a connected cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectedClusterInner create( - String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster) { + public ConnectedClusterInner create(String resourceGroupName, String clusterName, + ConnectedClusterInner connectedCluster) { return createAsync(resourceGroupName, clusterName, connectedCluster).block(); } /** * Register a new Kubernetes cluster with Azure Resource Manager. - * - *

API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). - * + * + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param connectedCluster Parameters supplied to Create a Connected Cluster. @@ -477,16 +406,16 @@ public ConnectedClusterInner create( * @return represents a connected cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectedClusterInner create( - String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster, Context context) { + public ConnectedClusterInner create(String resourceGroupName, String clusterName, + ConnectedClusterInner connectedCluster, Context context) { return createAsync(resourceGroupName, clusterName, connectedCluster, context).block(); } /** * Updates a connected cluster. - * - *

API to update certain properties of the connected cluster resource. - * + * + * API to update certain properties of the connected cluster resource. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param connectedClusterPatch Parameters supplied to update Connected Cluster. @@ -496,19 +425,15 @@ public ConnectedClusterInner create( * @return represents a connected cluster along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch) { + private Mono> updateWithResponseAsync(String resourceGroupName, String clusterName, + ConnectedClusterPatch connectedClusterPatch) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -524,27 +449,16 @@ private Mono> updateWithResponseAsync( connectedClusterPatch.validate(); } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - connectedClusterPatch, - accept, - context)) + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, connectedClusterPatch, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Updates a connected cluster. - * - *

API to update certain properties of the connected cluster resource. - * + * + * API to update certain properties of the connected cluster resource. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param connectedClusterPatch Parameters supplied to update Connected Cluster. @@ -555,19 +469,15 @@ private Mono> updateWithResponseAsync( * @return represents a connected cluster along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch, Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, String clusterName, + ConnectedClusterPatch connectedClusterPatch, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -584,23 +494,15 @@ private Mono> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - connectedClusterPatch, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, connectedClusterPatch, accept, context); } /** * Updates a connected cluster. - * - *

API to update certain properties of the connected cluster resource. - * + * + * API to update certain properties of the connected cluster resource. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param connectedClusterPatch Parameters supplied to update Connected Cluster. @@ -610,17 +512,17 @@ private Mono> updateWithResponseAsync( * @return represents a connected cluster on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch) { + private Mono updateAsync(String resourceGroupName, String clusterName, + ConnectedClusterPatch connectedClusterPatch) { return updateWithResponseAsync(resourceGroupName, clusterName, connectedClusterPatch) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Updates a connected cluster. - * - *

API to update certain properties of the connected cluster resource. - * + * + * API to update certain properties of the connected cluster resource. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param connectedClusterPatch Parameters supplied to update Connected Cluster. @@ -631,16 +533,16 @@ private Mono updateAsync( * @return represents a connected cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch, Context context) { + public Response updateWithResponse(String resourceGroupName, String clusterName, + ConnectedClusterPatch connectedClusterPatch, Context context) { return updateWithResponseAsync(resourceGroupName, clusterName, connectedClusterPatch, context).block(); } /** * Updates a connected cluster. - * - *

API to update certain properties of the connected cluster resource. - * + * + * API to update certain properties of the connected cluster resource. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param connectedClusterPatch Parameters supplied to update Connected Cluster. @@ -650,17 +552,17 @@ public Response updateWithResponse( * @return represents a connected cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectedClusterInner update( - String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch) { + public ConnectedClusterInner update(String resourceGroupName, String clusterName, + ConnectedClusterPatch connectedClusterPatch) { return updateWithResponse(resourceGroupName, clusterName, connectedClusterPatch, Context.NONE).getValue(); } /** * Get the properties of the specified connected cluster. - * - *

Returns the properties of the specified connected cluster, including name, identity, properties, and - * additional cluster details. - * + * + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -669,19 +571,15 @@ public ConnectedClusterInner update( * @return represents a connected cluster along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String clusterName) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String clusterName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -692,26 +590,17 @@ private Mono> getByResourceGroupWithResponseAsyn } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - accept, - context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the properties of the specified connected cluster. - * - *

Returns the properties of the specified connected cluster, including name, identity, properties, and - * additional cluster details. - * + * + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param context The context to associate with this operation. @@ -721,19 +610,15 @@ private Mono> getByResourceGroupWithResponseAsyn * @return represents a connected cluster along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String clusterName, Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String clusterName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -744,23 +629,16 @@ private Mono> getByResourceGroupWithResponseAsyn } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - accept, - context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context); } /** * Get the properties of the specified connected cluster. - * - *

Returns the properties of the specified connected cluster, including name, identity, properties, and - * additional cluster details. - * + * + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -776,10 +654,10 @@ private Mono getByResourceGroupAsync(String resourceGroup /** * Get the properties of the specified connected cluster. - * - *

Returns the properties of the specified connected cluster, including name, identity, properties, and - * additional cluster details. - * + * + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param context The context to associate with this operation. @@ -789,17 +667,17 @@ private Mono getByResourceGroupAsync(String resourceGroup * @return represents a connected cluster along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String clusterName, Context context) { + public Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, + Context context) { return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); } /** * Get the properties of the specified connected cluster. - * - *

Returns the properties of the specified connected cluster, including name, identity, properties, and - * additional cluster details. - * + * + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -814,9 +692,9 @@ public ConnectedClusterInner getByResourceGroup(String resourceGroupName, String /** * Delete a connected cluster. - * - *

Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). - * + * + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -827,16 +705,12 @@ public ConnectedClusterInner getByResourceGroup(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -847,25 +721,16 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete a connected cluster. - * - *

Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). - * + * + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param context The context to associate with this operation. @@ -875,19 +740,15 @@ private Mono>> deleteWithResponseAsync(String resource * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String clusterName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -898,22 +759,15 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, accept, context); } /** * Delete a connected cluster. - * - *

Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). - * + * + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -924,17 +778,15 @@ private Mono>> deleteWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Delete a connected cluster. - * - *

Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). - * + * + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param context The context to associate with this operation. @@ -944,20 +796,19 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String clusterName, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, + Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Delete a connected cluster. - * - *

Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). - * + * + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -972,9 +823,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Delete a connected cluster. - * - *

Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). - * + * + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param context The context to associate with this operation. @@ -984,16 +835,16 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String clusterName, Context context) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, + Context context) { return this.beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); } /** * Delete a connected cluster. - * - *

Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). - * + * + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1008,9 +859,9 @@ private Mono deleteAsync(String resourceGroupName, String clusterName) { /** * Delete a connected cluster. - * - *

Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). - * + * + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param context The context to associate with this operation. @@ -1021,16 +872,15 @@ private Mono deleteAsync(String resourceGroupName, String clusterName) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String clusterName, Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, context) - .last() + return beginDeleteAsync(resourceGroupName, clusterName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete a connected cluster. - * - *

Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). - * + * + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1044,9 +894,9 @@ public void delete(String resourceGroupName, String clusterName) { /** * Delete a connected cluster. - * - *

Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). - * + * + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param context The context to associate with this operation. @@ -1061,9 +911,9 @@ public void delete(String resourceGroupName, String clusterName, Context context /** * Gets cluster user credentials of a connected cluster - * - *

Gets cluster user credentials of the connected cluster with a specified resource group and name. - * + * + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param properties ListClusterUserCredential properties. @@ -1071,22 +921,18 @@ public void delete(String resourceGroupName, String clusterName, Context context * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cluster user credentials of the connected cluster with a specified resource group and name along with - * {@link Response} on successful completion of {@link Mono}. + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listClusterUserCredentialWithResponseAsync( - String resourceGroupName, String clusterName, ListClusterUserCredentialProperties properties) { + private Mono> listClusterUserCredentialWithResponseAsync(String resourceGroupName, + String clusterName, ListClusterUserCredentialProperties properties) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1103,25 +949,16 @@ private Mono> listClusterUserCredentialWithResp final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .listClusterUserCredential( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - properties, - accept, - context)) + context -> service.listClusterUserCredential(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, properties, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets cluster user credentials of a connected cluster - * - *

Gets cluster user credentials of the connected cluster with a specified resource group and name. - * + * + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param properties ListClusterUserCredential properties. @@ -1130,22 +967,18 @@ private Mono> listClusterUserCredentialWithResp * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cluster user credentials of the connected cluster with a specified resource group and name along with - * {@link Response} on successful completion of {@link Mono}. + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listClusterUserCredentialWithResponseAsync( - String resourceGroupName, String clusterName, ListClusterUserCredentialProperties properties, Context context) { + private Mono> listClusterUserCredentialWithResponseAsync(String resourceGroupName, + String clusterName, ListClusterUserCredentialProperties properties, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1161,23 +994,15 @@ private Mono> listClusterUserCredentialWithResp } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listClusterUserCredential( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterName, - properties, - accept, - context); + return service.listClusterUserCredential(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, properties, accept, context); } /** * Gets cluster user credentials of a connected cluster - * - *

Gets cluster user credentials of the connected cluster with a specified resource group and name. - * + * + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param properties ListClusterUserCredential properties. @@ -1185,20 +1010,20 @@ private Mono> listClusterUserCredentialWithResp * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cluster user credentials of the connected cluster with a specified resource group and name on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listClusterUserCredentialAsync( - String resourceGroupName, String clusterName, ListClusterUserCredentialProperties properties) { + private Mono listClusterUserCredentialAsync(String resourceGroupName, String clusterName, + ListClusterUserCredentialProperties properties) { return listClusterUserCredentialWithResponseAsync(resourceGroupName, clusterName, properties) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets cluster user credentials of a connected cluster - * - *

Gets cluster user credentials of the connected cluster with a specified resource group and name. - * + * + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param properties ListClusterUserCredential properties. @@ -1207,19 +1032,19 @@ private Mono listClusterUserCredentialAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cluster user credentials of the connected cluster with a specified resource group and name along with - * {@link Response}. + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listClusterUserCredentialWithResponse( - String resourceGroupName, String clusterName, ListClusterUserCredentialProperties properties, Context context) { + public Response listClusterUserCredentialWithResponse(String resourceGroupName, + String clusterName, ListClusterUserCredentialProperties properties, Context context) { return listClusterUserCredentialWithResponseAsync(resourceGroupName, clusterName, properties, context).block(); } /** * Gets cluster user credentials of a connected cluster - * - *

Gets cluster user credentials of the connected cluster with a specified resource group and name. - * + * + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param properties ListClusterUserCredential properties. @@ -1229,37 +1054,33 @@ public Response listClusterUserCredentialWithResponse( * @return cluster user credentials of the connected cluster with a specified resource group and name. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CredentialResultsInner listClusterUserCredential( - String resourceGroupName, String clusterName, ListClusterUserCredentialProperties properties) { + public CredentialResultsInner listClusterUserCredential(String resourceGroupName, String clusterName, + ListClusterUserCredentialProperties properties) { return listClusterUserCredentialWithResponse(resourceGroupName, clusterName, properties, Context.NONE) .getValue(); } /** * Lists all connected clusters - * - *

API to enumerate registered connected K8s clusters under a Resource Group. - * + * + * API to enumerate registered connected K8s clusters under a Resource Group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of connected Clusters along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1267,55 +1088,36 @@ private Mono> listByResourceGroupSinglePage } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists all connected clusters - * - *

API to enumerate registered connected K8s clusters under a Resource Group. - * + * + * API to enumerate registered connected K8s clusters under a Resource Group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of connected Clusters along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1324,29 +1126,17 @@ private Mono> listByResourceGroupSinglePage final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists all connected clusters - * - *

API to enumerate registered connected K8s clusters under a Resource Group. - * + * + * API to enumerate registered connected K8s clusters under a Resource Group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1355,16 +1145,15 @@ private Mono> listByResourceGroupSinglePage */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** * Lists all connected clusters - * - *

API to enumerate registered connected K8s clusters under a Resource Group. - * + * + * API to enumerate registered connected K8s clusters under a Resource Group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1374,16 +1163,15 @@ private PagedFlux listByResourceGroupAsync(String resourc */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** * Lists all connected clusters - * - *

API to enumerate registered connected K8s clusters under a Resource Group. - * + * + * API to enumerate registered connected K8s clusters under a Resource Group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1397,9 +1185,9 @@ public PagedIterable listByResourceGroup(String resourceG /** * Lists all connected clusters - * - *

API to enumerate registered connected K8s clusters under a Resource Group. - * + * + * API to enumerate registered connected K8s clusters under a Resource Group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1414,117 +1202,84 @@ public PagedIterable listByResourceGroup(String resourceG /** * Lists all connected clusters - * - *

API to enumerate registered connected K8s clusters under a Subscription. - * + * + * API to enumerate registered connected K8s clusters under a Subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of connected Clusters along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists all connected clusters - * - *

API to enumerate registered connected K8s clusters under a Subscription. - * + * + * API to enumerate registered connected K8s clusters under a Subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of connected Clusters along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists all connected clusters - * - *

API to enumerate registered connected K8s clusters under a Subscription. - * + * + * API to enumerate registered connected K8s clusters under a Subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of connected Clusters as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * Lists all connected clusters - * - *

API to enumerate registered connected K8s clusters under a Subscription. - * + * + * API to enumerate registered connected K8s clusters under a Subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1533,15 +1288,15 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** * Lists all connected clusters - * - *

API to enumerate registered connected K8s clusters under a Subscription. - * + * + * API to enumerate registered connected K8s clusters under a Subscription. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of connected Clusters as paginated response with {@link PagedIterable}. @@ -1553,9 +1308,9 @@ public PagedIterable list() { /** * Lists all connected clusters - * - *

API to enumerate registered connected K8s clusters under a Subscription. - * + * + * API to enumerate registered connected K8s clusters under a Subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1569,14 +1324,15 @@ public PagedIterable list(Context context) { /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of connected Clusters along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1584,76 +1340,59 @@ private Mono> listByResourceGroupNextSingle return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of connected Clusters along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of connected Clusters along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -1661,63 +1400,45 @@ private Mono> listBySubscriptionNextSingleP return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of connected Clusters along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersImpl.java index b0ed15a0311a1..8856476e70b90 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersImpl.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersImpl.java @@ -24,22 +24,18 @@ public final class ConnectedClustersImpl implements ConnectedClusters { private final com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager; - public ConnectedClustersImpl( - ConnectedClustersClient innerClient, + public ConnectedClustersImpl(ConnectedClustersClient innerClient, com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getByResourceGroupWithResponse( - String resourceGroupName, String clusterName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, clusterName, context); + public Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, clusterName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ConnectedClusterImpl(inner.getValue(), this.manager())); } else { return null; @@ -63,27 +59,22 @@ public void delete(String resourceGroupName, String clusterName, Context context this.serviceClient().delete(resourceGroupName, clusterName, context); } - public Response listClusterUserCredentialWithResponse( - String resourceGroupName, String clusterName, ListClusterUserCredentialProperties properties, Context context) { - Response inner = - this - .serviceClient() - .listClusterUserCredentialWithResponse(resourceGroupName, clusterName, properties, context); + public Response listClusterUserCredentialWithResponse(String resourceGroupName, + String clusterName, ListClusterUserCredentialProperties properties, Context context) { + Response inner = this.serviceClient() + .listClusterUserCredentialWithResponse(resourceGroupName, clusterName, properties, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new CredentialResultsImpl(inner.getValue(), this.manager())); } else { return null; } } - public CredentialResults listClusterUserCredential( - String resourceGroupName, String clusterName, ListClusterUserCredentialProperties properties) { - CredentialResultsInner inner = - this.serviceClient().listClusterUserCredential(resourceGroupName, clusterName, properties); + public CredentialResults listClusterUserCredential(String resourceGroupName, String clusterName, + ListClusterUserCredentialProperties properties) { + CredentialResultsInner inner + = this.serviceClient().listClusterUserCredential(resourceGroupName, clusterName, properties); if (inner != null) { return new CredentialResultsImpl(inner, this.manager()); } else { @@ -93,105 +84,77 @@ public CredentialResults listClusterUserCredential( public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new ConnectedClusterImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectedClusterImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new ConnectedClusterImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectedClusterImpl(inner1, this.manager())); } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ConnectedClusterImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectedClusterImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new ConnectedClusterImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectedClusterImpl(inner1, this.manager())); } public ConnectedCluster getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourcegroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); } - String clusterName = Utils.getValueFromIdByName(id, "connectedClusters"); + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "connectedClusters"); if (clusterName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'connectedClusters'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connectedClusters'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourcegroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); } - String clusterName = Utils.getValueFromIdByName(id, "connectedClusters"); + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "connectedClusters"); if (clusterName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'connectedClusters'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connectedClusters'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourcegroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); } - String clusterName = Utils.getValueFromIdByName(id, "connectedClusters"); + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "connectedClusters"); if (clusterName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'connectedClusters'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connectedClusters'.", id))); } this.delete(resourceGroupName, clusterName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourcegroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); } - String clusterName = Utils.getValueFromIdByName(id, "connectedClusters"); + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "connectedClusters"); if (clusterName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'connectedClusters'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connectedClusters'.", id))); } this.delete(resourceGroupName, clusterName, context); } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/CredentialResultsImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/CredentialResultsImpl.java index 09886a72077d9..007ea1c534d79 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/CredentialResultsImpl.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/CredentialResultsImpl.java @@ -16,8 +16,7 @@ public final class CredentialResultsImpl implements CredentialResults { private final com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager; - CredentialResultsImpl( - CredentialResultsInner innerObject, + CredentialResultsImpl(CredentialResultsInner innerObject, com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientBuilder.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientBuilder.java index 7f1c8626e1db4..f1c40f31687eb 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientBuilder.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientBuilder.java @@ -14,8 +14,10 @@ import com.azure.core.util.serializer.SerializerAdapter; import java.time.Duration; -/** A builder for creating a new instance of the HybridKubernetesManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = {HybridKubernetesManagementClientImpl.class}) +/** + * A builder for creating a new instance of the HybridKubernetesManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { HybridKubernetesManagementClientImpl.class }) public final class HybridKubernetesManagementClientBuilder { /* * The ID of the target subscription. @@ -24,7 +26,7 @@ public final class HybridKubernetesManagementClientBuilder { /** * Sets The ID of the target subscription. - * + * * @param subscriptionId the subscriptionId value. * @return the HybridKubernetesManagementClientBuilder. */ @@ -40,7 +42,7 @@ public HybridKubernetesManagementClientBuilder subscriptionId(String subscriptio /** * Sets server parameter. - * + * * @param endpoint the endpoint value. * @return the HybridKubernetesManagementClientBuilder. */ @@ -56,7 +58,7 @@ public HybridKubernetesManagementClientBuilder endpoint(String endpoint) { /** * Sets The environment to connect to. - * + * * @param environment the environment value. * @return the HybridKubernetesManagementClientBuilder. */ @@ -72,7 +74,7 @@ public HybridKubernetesManagementClientBuilder environment(AzureEnvironment envi /** * Sets The HTTP pipeline to send requests through. - * + * * @param pipeline the pipeline value. * @return the HybridKubernetesManagementClientBuilder. */ @@ -88,7 +90,7 @@ public HybridKubernetesManagementClientBuilder pipeline(HttpPipeline pipeline) { /** * Sets The default poll interval for long-running operation. - * + * * @param defaultPollInterval the defaultPollInterval value. * @return the HybridKubernetesManagementClientBuilder. */ @@ -104,7 +106,7 @@ public HybridKubernetesManagementClientBuilder defaultPollInterval(Duration defa /** * Sets The serializer to serialize an object into a string. - * + * * @param serializerAdapter the serializerAdapter value. * @return the HybridKubernetesManagementClientBuilder. */ @@ -115,30 +117,20 @@ public HybridKubernetesManagementClientBuilder serializerAdapter(SerializerAdapt /** * Builds an instance of HybridKubernetesManagementClientImpl with the provided parameters. - * + * * @return an instance of HybridKubernetesManagementClientImpl. */ public HybridKubernetesManagementClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; - HttpPipeline localPipeline = - (pipeline != null) - ? pipeline - : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - Duration localDefaultPollInterval = - (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); - SerializerAdapter localSerializerAdapter = - (serializerAdapter != null) - ? serializerAdapter - : SerializerFactory.createDefaultManagementSerializerAdapter(); - HybridKubernetesManagementClientImpl client = - new HybridKubernetesManagementClientImpl( - localPipeline, - localSerializerAdapter, - localDefaultPollInterval, - localEnvironment, - subscriptionId, - localEndpoint); + HttpPipeline localPipeline = (pipeline != null) ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + HybridKubernetesManagementClientImpl client = new HybridKubernetesManagementClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); return client; } } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientImpl.java index 2ea0e7282c8aa..a2300df06de1f 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientImpl.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientImpl.java @@ -34,99 +34,117 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** Initializes a new instance of the HybridKubernetesManagementClientImpl type. */ +/** + * Initializes a new instance of the HybridKubernetesManagementClientImpl type. + */ @ServiceClient(builder = HybridKubernetesManagementClientBuilder.class) public final class HybridKubernetesManagementClientImpl implements HybridKubernetesManagementClient { - /** The ID of the target subscription. */ + /** + * The ID of the target subscription. + */ private final String subscriptionId; /** * Gets The ID of the target subscription. - * + * * @return the subscriptionId value. */ public String getSubscriptionId() { return this.subscriptionId; } - /** server parameter. */ + /** + * server parameter. + */ private final String endpoint; /** * Gets server parameter. - * + * * @return the endpoint value. */ public String getEndpoint() { return this.endpoint; } - /** Api Version. */ + /** + * Api Version. + */ private final String apiVersion; /** * Gets Api Version. - * + * * @return the apiVersion value. */ public String getApiVersion() { return this.apiVersion; } - /** The HTTP pipeline to send requests through. */ + /** + * The HTTP pipeline to send requests through. + */ private final HttpPipeline httpPipeline; /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { return this.httpPipeline; } - /** The serializer to serialize an object into a string. */ + /** + * The serializer to serialize an object into a string. + */ private final SerializerAdapter serializerAdapter; /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ SerializerAdapter getSerializerAdapter() { return this.serializerAdapter; } - /** The default poll interval for long-running operation. */ + /** + * The default poll interval for long-running operation. + */ private final Duration defaultPollInterval; /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** The ConnectedClustersClient object to access its operations. */ + /** + * The ConnectedClustersClient object to access its operations. + */ private final ConnectedClustersClient connectedClusters; /** * Gets the ConnectedClustersClient object to access its operations. - * + * * @return the ConnectedClustersClient object. */ public ConnectedClustersClient getConnectedClusters() { return this.connectedClusters; } - /** The OperationsClient object to access its operations. */ + /** + * The OperationsClient object to access its operations. + */ private final OperationsClient operations; /** * Gets the OperationsClient object to access its operations. - * + * * @return the OperationsClient object. */ public OperationsClient getOperations() { @@ -135,7 +153,7 @@ public OperationsClient getOperations() { /** * Initializes an instance of HybridKubernetesManagementClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. @@ -143,26 +161,21 @@ public OperationsClient getOperations() { * @param subscriptionId The ID of the target subscription. * @param endpoint server parameter. */ - HybridKubernetesManagementClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { + HybridKubernetesManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-10-01"; + this.apiVersion = "2024-02-01-preview"; this.connectedClusters = new ConnectedClustersClientImpl(this); this.operations = new OperationsClientImpl(this); } /** * Gets default client context. - * + * * @return the default client context. */ public Context getContext() { @@ -171,7 +184,7 @@ public Context getContext() { /** * Merges default client context with provided context. - * + * * @param context the context to be merged with default client context. * @return the merged context. */ @@ -181,7 +194,7 @@ public Context mergeContext(Context context) { /** * Gets long running operation result. - * + * * @param activationResponse the response of activation operation. * @param httpPipeline the http pipeline. * @param pollResultType type of poll result. @@ -191,26 +204,15 @@ public Context mergeContext(Context context) { * @param type of final result. * @return poller flux for poll result and final result. */ - public PollerFlux, U> getLroResult( - Mono>> activationResponse, - HttpPipeline httpPipeline, - Type pollResultType, - Type finalResultType, - Context context) { - return PollerFactory - .create( - serializerAdapter, - httpPipeline, - pollResultType, - finalResultType, - defaultPollInterval, - activationResponse, - context); + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); } /** * Gets the final result, or an error, based on last async poll response. - * + * * @param response the last async poll response. * @param type of poll result. * @param type of final result. @@ -223,19 +225,16 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, HttpResponse errorResponse = null; PollResult.Error lroError = response.getValue().getError(); if (lroError != null) { - errorResponse = - new HttpResponseImpl( - lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); errorMessage = response.getValue().getError().getMessage(); String errorBody = response.getValue().getError().getResponseBody(); if (errorBody != null) { // try to deserialize error body to ManagementError try { - managementError = - this - .getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + managementError = this.getSerializerAdapter().deserialize(errorBody, ManagementError.class, + SerializerEncoding.JSON); if (managementError.getCode() == null || managementError.getMessage() == null) { managementError = null; } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationImpl.java index 9d768e2e4c78d..d66f1b874eba6 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationImpl.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationImpl.java @@ -13,8 +13,8 @@ public final class OperationImpl implements Operation { private final com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager; - OperationImpl( - OperationInner innerObject, com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { + OperationImpl(OperationInner innerObject, + com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsClientImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsClientImpl.java index 32a57602ee743..a86c6d7e853d2 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsClientImpl.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsClientImpl.java @@ -30,22 +30,28 @@ import com.azure.resourcemanager.hybridkubernetes.models.OperationList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public final class OperationsClientImpl implements OperationsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final OperationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final HybridKubernetesManagementClientImpl client; /** * Initializes an instance of OperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ OperationsClientImpl(HybridKubernetesManagementClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -56,95 +62,70 @@ public final class OperationsClientImpl implements OperationsClient { @Host("{$host}") @ServiceInterface(name = "HybridKubernetesMana") public interface OperationsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Kubernetes/operations") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> getNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Lists all of the available API operations for Connected Cluster resource. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of connected cluster API operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getSinglePageAsync() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists all of the available API operations for Connected Cluster resource. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of connected cluster API operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists all of the available API operations for Connected Cluster resource. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of connected cluster API operations as paginated response with {@link PagedFlux}. @@ -156,7 +137,7 @@ private PagedFlux getAsync() { /** * Lists all of the available API operations for Connected Cluster resource. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -165,13 +146,13 @@ private PagedFlux getAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux getAsync(Context context) { - return new PagedFlux<>( - () -> getSinglePageAsync(context), nextLink -> getNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> getSinglePageAsync(context), + nextLink -> getNextSinglePageAsync(nextLink, context)); } /** * Lists all of the available API operations for Connected Cluster resource. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of connected cluster API operations as paginated response with {@link PagedIterable}. @@ -183,7 +164,7 @@ public PagedIterable get() { /** * Lists all of the available API operations for Connected Cluster resource. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -197,14 +178,15 @@ public PagedIterable get(Context context) { /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of connected cluster API operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getNextSinglePageAsync(String nextLink) { @@ -212,37 +194,28 @@ private Mono> getNextSinglePageAsync(String nextLi return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.getNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of connected cluster API operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getNextSinglePageAsync(String nextLink, Context context) { @@ -250,23 +223,13 @@ private Mono> getNextSinglePageAsync(String nextLi return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.getNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsImpl.java index 21d5229c7c951..90cfd63b32857 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsImpl.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsImpl.java @@ -19,8 +19,7 @@ public final class OperationsImpl implements Operations { private final com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager; - public OperationsImpl( - OperationsClient innerClient, + public OperationsImpl(OperationsClient innerClient, com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -28,12 +27,12 @@ public OperationsImpl( public PagedIterable get() { PagedIterable inner = this.serviceClient().get(); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } public PagedIterable get(Context context) { PagedIterable inner = this.serviceClient().get(context); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } private OperationsClient serviceClient() { diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/Utils.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ResourceManagerUtils.java similarity index 80% rename from sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/Utils.java rename to sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ResourceManagerUtils.java index c21531d2505e1..a1cd3672d50bd 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/Utils.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ResourceManagerUtils.java @@ -19,7 +19,10 @@ import java.util.stream.Stream; import reactor.core.publisher.Flux; -final class Utils { +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + static String getValueFromIdByName(String id, String name) { if (id == null) { return null; @@ -38,6 +41,7 @@ static String getValueFromIdByName(String id, String name) { } } return null; + } static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { @@ -60,7 +64,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri segments.add(idSegment); idItrReverted.forEachRemaining(segments::add); Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { + if (!segments.isEmpty() && segments.get(0).isEmpty()) { segments.remove(0); } return String.join("/", segments); @@ -71,10 +75,11 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } } return null; + } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); + return new PagedIterableImpl<>(pageIterable, mapper); } private static final class PagedIterableImpl extends PagedIterable { @@ -84,26 +89,17 @@ private static final class PagedIterableImpl extends PagedIterable { private final Function, PagedResponse> pageMapper; private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super( - PagedFlux - .create( - () -> - (continuationToken, pageSize) -> - Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); this.pagedIterable = pagedIterable; this.mapper = mapper; this.pageMapper = getPageMapper(mapper); } private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> - new PagedResponseBase( - page.getRequest(), - page.getStatusCode(), - page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), - page.getContinuationToken(), - null); + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); } @Override @@ -133,30 +129,27 @@ public Stream> streamByPage(String continuationToken, int prefe @Override public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); + return new IteratorImpl<>(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } @@ -198,7 +191,7 @@ private IterableImpl(Iterable iterable, Function mapper) { @Override public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); + return new IteratorImpl<>(iterable.iterator(), mapper); } } } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/package-info.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/package-info.java index bfce9423ebd6a..1ee13719d5285 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/package-info.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the implementations for HybridKubernetesManagementClient. Hybrid Kubernetes Client. */ +/** + * Package containing the implementations for HybridKubernetesManagementClient. + * Hybrid Kubernetes Client. + */ package com.azure.resourcemanager.hybridkubernetes.implementation; diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AadProfile.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AadProfile.java new file mode 100644 index 0000000000000..cb815eed198bb --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AadProfile.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * AAD Profile specifies attributes for Azure Active Directory integration. + */ +@Fluent +public final class AadProfile { + /* + * Whether to enable Azure RBAC for Kubernetes authorization. + */ + @JsonProperty(value = "enableAzureRBAC") + private Boolean enableAzureRbac; + + /* + * The list of AAD group object IDs that will have admin role of the cluster. + */ + @JsonProperty(value = "adminGroupObjectIDs") + private List adminGroupObjectIDs; + + /* + * The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment + * subscription. + */ + @JsonProperty(value = "tenantID") + private String tenantId; + + /** + * Creates an instance of AadProfile class. + */ + public AadProfile() { + } + + /** + * Get the enableAzureRbac property: Whether to enable Azure RBAC for Kubernetes authorization. + * + * @return the enableAzureRbac value. + */ + public Boolean enableAzureRbac() { + return this.enableAzureRbac; + } + + /** + * Set the enableAzureRbac property: Whether to enable Azure RBAC for Kubernetes authorization. + * + * @param enableAzureRbac the enableAzureRbac value to set. + * @return the AadProfile object itself. + */ + public AadProfile withEnableAzureRbac(Boolean enableAzureRbac) { + this.enableAzureRbac = enableAzureRbac; + return this; + } + + /** + * Get the adminGroupObjectIDs property: The list of AAD group object IDs that will have admin role of the cluster. + * + * @return the adminGroupObjectIDs value. + */ + public List adminGroupObjectIDs() { + return this.adminGroupObjectIDs; + } + + /** + * Set the adminGroupObjectIDs property: The list of AAD group object IDs that will have admin role of the cluster. + * + * @param adminGroupObjectIDs the adminGroupObjectIDs value to set. + * @return the AadProfile object itself. + */ + public AadProfile withAdminGroupObjectIDs(List adminGroupObjectIDs) { + this.adminGroupObjectIDs = adminGroupObjectIDs; + return this; + } + + /** + * Get the tenantId property: The AAD tenant ID to use for authentication. If not specified, will use the tenant of + * the deployment subscription. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The AAD tenant ID to use for authentication. If not specified, will use the tenant of + * the deployment subscription. + * + * @param tenantId the tenantId value to set. + * @return the AadProfile object itself. + */ + public AadProfile withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AgentError.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AgentError.java new file mode 100644 index 0000000000000..ef9cbd80e7a73 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AgentError.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * Agent Errors if any during agent or system component upgrade. + */ +@Immutable +public final class AgentError { + /* + * Agent error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Severity of the error message. + */ + @JsonProperty(value = "severity", access = JsonProperty.Access.WRITE_ONLY) + private String severity; + + /* + * Agent component where error message occured. + */ + @JsonProperty(value = "component", access = JsonProperty.Access.WRITE_ONLY) + private String component; + + /* + * The timestamp of error occured (UTC). + */ + @JsonProperty(value = "time", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime time; + + /** + * Creates an instance of AgentError class. + */ + public AgentError() { + } + + /** + * Get the message property: Agent error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the severity property: Severity of the error message. + * + * @return the severity value. + */ + public String severity() { + return this.severity; + } + + /** + * Get the component property: Agent component where error message occured. + * + * @return the component value. + */ + public String component() { + return this.component; + } + + /** + * Get the time property: The timestamp of error occured (UTC). + * + * @return the time value. + */ + public OffsetDateTime time() { + return this.time; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ArcAgentProfile.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ArcAgentProfile.java new file mode 100644 index 0000000000000..9cca6ad20f9d0 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ArcAgentProfile.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Defines the Arc Agent properties for the clusters. + */ +@Fluent +public final class ArcAgentProfile { + /* + * Version of the Arc agents to be installed on the cluster resource + */ + @JsonProperty(value = "desiredAgentVersion") + private String desiredAgentVersion; + + /* + * Indicates whether the Arc agents on the be upgraded automatically to the latest version. Defaults to Enabled. + */ + @JsonProperty(value = "agentAutoUpgrade") + private AutoUpgradeOptions agentAutoUpgrade; + + /* + * List of system extensions can be installed on the cluster resource. + */ + @JsonProperty(value = "systemComponents") + private List systemComponents; + + /* + * List of system extensions can be installed on the cluster resource. + */ + @JsonProperty(value = "agentErrors") + private List agentErrors; + + /** + * Creates an instance of ArcAgentProfile class. + */ + public ArcAgentProfile() { + } + + /** + * Get the desiredAgentVersion property: Version of the Arc agents to be installed on the cluster resource. + * + * @return the desiredAgentVersion value. + */ + public String desiredAgentVersion() { + return this.desiredAgentVersion; + } + + /** + * Set the desiredAgentVersion property: Version of the Arc agents to be installed on the cluster resource. + * + * @param desiredAgentVersion the desiredAgentVersion value to set. + * @return the ArcAgentProfile object itself. + */ + public ArcAgentProfile withDesiredAgentVersion(String desiredAgentVersion) { + this.desiredAgentVersion = desiredAgentVersion; + return this; + } + + /** + * Get the agentAutoUpgrade property: Indicates whether the Arc agents on the be upgraded automatically to the + * latest version. Defaults to Enabled. + * + * @return the agentAutoUpgrade value. + */ + public AutoUpgradeOptions agentAutoUpgrade() { + return this.agentAutoUpgrade; + } + + /** + * Set the agentAutoUpgrade property: Indicates whether the Arc agents on the be upgraded automatically to the + * latest version. Defaults to Enabled. + * + * @param agentAutoUpgrade the agentAutoUpgrade value to set. + * @return the ArcAgentProfile object itself. + */ + public ArcAgentProfile withAgentAutoUpgrade(AutoUpgradeOptions agentAutoUpgrade) { + this.agentAutoUpgrade = agentAutoUpgrade; + return this; + } + + /** + * Get the systemComponents property: List of system extensions can be installed on the cluster resource. + * + * @return the systemComponents value. + */ + public List systemComponents() { + return this.systemComponents; + } + + /** + * Set the systemComponents property: List of system extensions can be installed on the cluster resource. + * + * @param systemComponents the systemComponents value to set. + * @return the ArcAgentProfile object itself. + */ + public ArcAgentProfile withSystemComponents(List systemComponents) { + this.systemComponents = systemComponents; + return this; + } + + /** + * Get the agentErrors property: List of system extensions can be installed on the cluster resource. + * + * @return the agentErrors value. + */ + public List agentErrors() { + return this.agentErrors; + } + + /** + * Set the agentErrors property: List of system extensions can be installed on the cluster resource. + * + * @param agentErrors the agentErrors value to set. + * @return the ArcAgentProfile object itself. + */ + public ArcAgentProfile withAgentErrors(List agentErrors) { + this.agentErrors = agentErrors; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (systemComponents() != null) { + systemComponents().forEach(e -> e.validate()); + } + if (agentErrors() != null) { + agentErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AuthenticationMethod.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AuthenticationMethod.java index e7b08f3671dcc..619dbbea9139b 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AuthenticationMethod.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AuthenticationMethod.java @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The mode of client authentication. */ +/** + * The mode of client authentication. + */ public final class AuthenticationMethod extends ExpandableStringEnum { - /** Static value Token for AuthenticationMethod. */ + /** + * Static value Token for AuthenticationMethod. + */ public static final AuthenticationMethod TOKEN = fromString("Token"); - /** Static value AAD for AuthenticationMethod. */ + /** + * Static value AAD for AuthenticationMethod. + */ public static final AuthenticationMethod AAD = fromString("AAD"); /** * Creates a new instance of AuthenticationMethod value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public AuthenticationMethod() { /** * Creates or finds a AuthenticationMethod from its string representation. - * + * * @param name a name to look for. * @return the corresponding AuthenticationMethod. */ @@ -38,7 +44,7 @@ public static AuthenticationMethod fromString(String name) { /** * Gets known AuthenticationMethod values. - * + * * @return known AuthenticationMethod values. */ public static Collection values() { diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AutoUpgradeOptions.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AutoUpgradeOptions.java new file mode 100644 index 0000000000000..fb2184950415a --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AutoUpgradeOptions.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Indicates whether the Arc agents on the be upgraded automatically to the latest version. Defaults to Enabled. + */ +public final class AutoUpgradeOptions extends ExpandableStringEnum { + /** + * Static value Enabled for AutoUpgradeOptions. + */ + public static final AutoUpgradeOptions ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for AutoUpgradeOptions. + */ + public static final AutoUpgradeOptions DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of AutoUpgradeOptions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutoUpgradeOptions() { + } + + /** + * Creates or finds a AutoUpgradeOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutoUpgradeOptions. + */ + @JsonCreator + public static AutoUpgradeOptions fromString(String name) { + return fromString(name, AutoUpgradeOptions.class); + } + + /** + * Gets known AutoUpgradeOptions values. + * + * @return known AutoUpgradeOptions values. + */ + public static Collection values() { + return values(AutoUpgradeOptions.class); + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AzureHybridBenefit.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AzureHybridBenefit.java new file mode 100644 index 0000000000000..3f9d10225c70d --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AzureHybridBenefit.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Indicates whether Azure Hybrid Benefit is opted in. + */ +public final class AzureHybridBenefit extends ExpandableStringEnum { + /** + * Static value True for AzureHybridBenefit. + */ + public static final AzureHybridBenefit TRUE = fromString("True"); + + /** + * Static value False for AzureHybridBenefit. + */ + public static final AzureHybridBenefit FALSE = fromString("False"); + + /** + * Static value NotApplicable for AzureHybridBenefit. + */ + public static final AzureHybridBenefit NOT_APPLICABLE = fromString("NotApplicable"); + + /** + * Creates a new instance of AzureHybridBenefit value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureHybridBenefit() { + } + + /** + * Creates or finds a AzureHybridBenefit from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureHybridBenefit. + */ + @JsonCreator + public static AzureHybridBenefit fromString(String name) { + return fromString(name, AzureHybridBenefit.class); + } + + /** + * Gets known AzureHybridBenefit values. + * + * @return known AzureHybridBenefit values. + */ + public static Collection values() { + return values(AzureHybridBenefit.class); + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedCluster.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedCluster.java index 62d63e1840f76..0c34f6b352c6d 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedCluster.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedCluster.java @@ -12,53 +12,62 @@ import java.time.OffsetDateTime; import java.util.Map; -/** An immutable client-side representation of ConnectedCluster. */ +/** + * An immutable client-side representation of ConnectedCluster. + */ public interface ConnectedCluster { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** * Gets the identity property: The identity of the connected cluster. - * + * * @return the identity value. */ ConnectedClusterIdentity identity(); + /** + * Gets the kind property: The kind of connected cluster. + * + * @return the kind value. + */ + ConnectedClusterKind kind(); + /** * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. - * + * * @return the systemData value. */ SystemData systemData(); @@ -66,71 +75,78 @@ public interface ConnectedCluster { /** * Gets the agentPublicKeyCertificate property: Base64 encoded public certificate used by the agent to do the * initial handshake to the backend services in Azure. - * + * * @return the agentPublicKeyCertificate value. */ String agentPublicKeyCertificate(); /** * Gets the kubernetesVersion property: The Kubernetes version of the connected cluster resource. - * + * * @return the kubernetesVersion value. */ String kubernetesVersion(); /** * Gets the totalNodeCount property: Number of nodes present in the connected cluster resource. - * + * * @return the totalNodeCount value. */ Integer totalNodeCount(); /** * Gets the totalCoreCount property: Number of CPU cores present in the connected cluster resource. - * + * * @return the totalCoreCount value. */ Integer totalCoreCount(); /** * Gets the agentVersion property: Version of the agent running on the connected cluster resource. - * + * * @return the agentVersion value. */ String agentVersion(); /** * Gets the provisioningState property: Provisioning state of the connected cluster resource. - * + * * @return the provisioningState value. */ ProvisioningState provisioningState(); /** * Gets the distribution property: The Kubernetes distribution running on this connected cluster. - * + * * @return the distribution value. */ String distribution(); + /** + * Gets the distributionVersion property: The Kubernetes distribution version on this connected cluster. + * + * @return the distributionVersion value. + */ + String distributionVersion(); + /** * Gets the infrastructure property: The infrastructure on which the Kubernetes cluster represented by this * connected cluster is running on. - * + * * @return the infrastructure value. */ String infrastructure(); /** * Gets the offering property: Connected cluster offering. - * + * * @return the offering value. */ String offering(); /** * Gets the managedIdentityCertificateExpirationTime property: Expiration time of the managed identity certificate. - * + * * @return the managedIdentityCertificateExpirationTime value. */ OffsetDateTime managedIdentityCertificateExpirationTime(); @@ -138,65 +154,115 @@ public interface ConnectedCluster { /** * Gets the lastConnectivityTime property: Time representing the last instance when heart beat was received from the * cluster. - * + * * @return the lastConnectivityTime value. */ OffsetDateTime lastConnectivityTime(); /** * Gets the connectivityStatus property: Represents the connectivity status of the connected cluster. - * + * * @return the connectivityStatus value. */ ConnectivityStatus connectivityStatus(); + /** + * Gets the privateLinkState property: Property which describes the state of private link on a connected cluster + * resource. + * + * @return the privateLinkState value. + */ + PrivateLinkState privateLinkState(); + + /** + * Gets the privateLinkScopeResourceId property: The resource id of the private link scope this connected cluster is + * assigned to, if any. + * + * @return the privateLinkScopeResourceId value. + */ + String privateLinkScopeResourceId(); + + /** + * Gets the azureHybridBenefit property: Indicates whether Azure Hybrid Benefit is opted in. + * + * @return the azureHybridBenefit value. + */ + AzureHybridBenefit azureHybridBenefit(); + + /** + * Gets the aadProfile property: AAD profile for the connected cluster. + * + * @return the aadProfile value. + */ + AadProfile aadProfile(); + + /** + * Gets the arcAgentProfile property: Arc agentry configuration for the provisioned cluster. + * + * @return the arcAgentProfile value. + */ + ArcAgentProfile arcAgentProfile(); + + /** + * Gets the miscellaneousProperties property: More properties related to the Connected Cluster. + * + * @return the miscellaneousProperties value. + */ + Map miscellaneousProperties(); + /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.hybridkubernetes.fluent.models.ConnectedClusterInner object. - * + * * @return the inner object. */ ConnectedClusterInner innerModel(); - /** The entirety of the ConnectedCluster definition. */ + /** + * The entirety of the ConnectedCluster definition. + */ interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithIdentity, - DefinitionStages.WithAgentPublicKeyCertificate, - DefinitionStages.WithCreate { + extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, + DefinitionStages.WithIdentity, DefinitionStages.WithAgentPublicKeyCertificate, DefinitionStages.WithCreate { } - /** The ConnectedCluster definition stages. */ + + /** + * The ConnectedCluster definition stages. + */ interface DefinitionStages { - /** The first stage of the ConnectedCluster definition. */ + /** + * The first stage of the ConnectedCluster definition. + */ interface Blank extends WithLocation { } - /** The stage of the ConnectedCluster definition allowing to specify location. */ + + /** + * The stage of the ConnectedCluster definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -204,170 +270,327 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); } - /** The stage of the ConnectedCluster definition allowing to specify parent resource. */ + + /** + * The stage of the ConnectedCluster definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithIdentity withExistingResourceGroup(String resourceGroupName); } - /** The stage of the ConnectedCluster definition allowing to specify identity. */ + + /** + * The stage of the ConnectedCluster definition allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: The identity of the connected cluster.. - * + * * @param identity The identity of the connected cluster. * @return the next definition stage. */ WithAgentPublicKeyCertificate withIdentity(ConnectedClusterIdentity identity); } - /** The stage of the ConnectedCluster definition allowing to specify agentPublicKeyCertificate. */ + + /** + * The stage of the ConnectedCluster definition allowing to specify agentPublicKeyCertificate. + */ interface WithAgentPublicKeyCertificate { /** * Specifies the agentPublicKeyCertificate property: Base64 encoded public certificate used by the agent to * do the initial handshake to the backend services in Azure.. - * + * * @param agentPublicKeyCertificate Base64 encoded public certificate used by the agent to do the initial - * handshake to the backend services in Azure. + * handshake to the backend services in Azure. * @return the next definition stage. */ WithCreate withAgentPublicKeyCertificate(String agentPublicKeyCertificate); } + /** * The stage of the ConnectedCluster definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. */ interface WithCreate - extends DefinitionStages.WithTags, - DefinitionStages.WithProvisioningState, - DefinitionStages.WithDistribution, - DefinitionStages.WithInfrastructure { + extends DefinitionStages.WithTags, DefinitionStages.WithKind, DefinitionStages.WithProvisioningState, + DefinitionStages.WithDistribution, DefinitionStages.WithDistributionVersion, + DefinitionStages.WithInfrastructure, DefinitionStages.WithPrivateLinkState, + DefinitionStages.WithPrivateLinkScopeResourceId, DefinitionStages.WithAzureHybridBenefit, + DefinitionStages.WithAadProfile, DefinitionStages.WithArcAgentProfile { /** * Executes the create request. - * + * * @return the created resource. */ ConnectedCluster create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ ConnectedCluster create(Context context); } - /** The stage of the ConnectedCluster definition allowing to specify tags. */ + + /** + * The stage of the ConnectedCluster definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the ConnectedCluster definition allowing to specify provisioningState. */ + + /** + * The stage of the ConnectedCluster definition allowing to specify kind. + */ + interface WithKind { + /** + * Specifies the kind property: The kind of connected cluster.. + * + * @param kind The kind of connected cluster. + * @return the next definition stage. + */ + WithCreate withKind(ConnectedClusterKind kind); + } + + /** + * The stage of the ConnectedCluster definition allowing to specify provisioningState. + */ interface WithProvisioningState { /** * Specifies the provisioningState property: Provisioning state of the connected cluster resource.. - * + * * @param provisioningState Provisioning state of the connected cluster resource. * @return the next definition stage. */ WithCreate withProvisioningState(ProvisioningState provisioningState); } - /** The stage of the ConnectedCluster definition allowing to specify distribution. */ + + /** + * The stage of the ConnectedCluster definition allowing to specify distribution. + */ interface WithDistribution { /** * Specifies the distribution property: The Kubernetes distribution running on this connected cluster.. - * + * * @param distribution The Kubernetes distribution running on this connected cluster. * @return the next definition stage. */ WithCreate withDistribution(String distribution); } - /** The stage of the ConnectedCluster definition allowing to specify infrastructure. */ + + /** + * The stage of the ConnectedCluster definition allowing to specify distributionVersion. + */ + interface WithDistributionVersion { + /** + * Specifies the distributionVersion property: The Kubernetes distribution version on this connected + * cluster.. + * + * @param distributionVersion The Kubernetes distribution version on this connected cluster. + * @return the next definition stage. + */ + WithCreate withDistributionVersion(String distributionVersion); + } + + /** + * The stage of the ConnectedCluster definition allowing to specify infrastructure. + */ interface WithInfrastructure { /** * Specifies the infrastructure property: The infrastructure on which the Kubernetes cluster represented by * this connected cluster is running on.. - * + * * @param infrastructure The infrastructure on which the Kubernetes cluster represented by this connected - * cluster is running on. + * cluster is running on. * @return the next definition stage. */ WithCreate withInfrastructure(String infrastructure); } + + /** + * The stage of the ConnectedCluster definition allowing to specify privateLinkState. + */ + interface WithPrivateLinkState { + /** + * Specifies the privateLinkState property: Property which describes the state of private link on a + * connected cluster resource.. + * + * @param privateLinkState Property which describes the state of private link on a connected cluster + * resource. + * @return the next definition stage. + */ + WithCreate withPrivateLinkState(PrivateLinkState privateLinkState); + } + + /** + * The stage of the ConnectedCluster definition allowing to specify privateLinkScopeResourceId. + */ + interface WithPrivateLinkScopeResourceId { + /** + * Specifies the privateLinkScopeResourceId property: The resource id of the private link scope this + * connected cluster is assigned to, if any.. + * + * @param privateLinkScopeResourceId The resource id of the private link scope this connected cluster is + * assigned to, if any. + * @return the next definition stage. + */ + WithCreate withPrivateLinkScopeResourceId(String privateLinkScopeResourceId); + } + + /** + * The stage of the ConnectedCluster definition allowing to specify azureHybridBenefit. + */ + interface WithAzureHybridBenefit { + /** + * Specifies the azureHybridBenefit property: Indicates whether Azure Hybrid Benefit is opted in. + * + * @param azureHybridBenefit Indicates whether Azure Hybrid Benefit is opted in. + * @return the next definition stage. + */ + WithCreate withAzureHybridBenefit(AzureHybridBenefit azureHybridBenefit); + } + + /** + * The stage of the ConnectedCluster definition allowing to specify aadProfile. + */ + interface WithAadProfile { + /** + * Specifies the aadProfile property: AAD profile for the connected cluster.. + * + * @param aadProfile AAD profile for the connected cluster. + * @return the next definition stage. + */ + WithCreate withAadProfile(AadProfile aadProfile); + } + + /** + * The stage of the ConnectedCluster definition allowing to specify arcAgentProfile. + */ + interface WithArcAgentProfile { + /** + * Specifies the arcAgentProfile property: Arc agentry configuration for the provisioned cluster.. + * + * @param arcAgentProfile Arc agentry configuration for the provisioned cluster. + * @return the next definition stage. + */ + WithCreate withArcAgentProfile(ArcAgentProfile arcAgentProfile); + } } + /** * Begins update for the ConnectedCluster resource. - * + * * @return the stage of resource update. */ ConnectedCluster.Update update(); - /** The template for ConnectedCluster update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + /** + * The template for ConnectedCluster update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithDistribution, UpdateStages.WithDistributionVersion, + UpdateStages.WithAzureHybridBenefit { /** * Executes the update request. - * + * * @return the updated resource. */ ConnectedCluster apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ ConnectedCluster apply(Context context); } - /** The ConnectedCluster update stages. */ + + /** + * The ConnectedCluster update stages. + */ interface UpdateStages { - /** The stage of the ConnectedCluster update allowing to specify tags. */ + /** + * The stage of the ConnectedCluster update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the ConnectedCluster update allowing to specify properties. */ - interface WithProperties { + + /** + * The stage of the ConnectedCluster update allowing to specify distribution. + */ + interface WithDistribution { + /** + * Specifies the distribution property: Represents the distribution of the connected cluster. + * + * @param distribution Represents the distribution of the connected cluster. + * @return the next definition stage. + */ + Update withDistribution(String distribution); + } + + /** + * The stage of the ConnectedCluster update allowing to specify distributionVersion. + */ + interface WithDistributionVersion { /** - * Specifies the properties property: Describes the connected cluster resource properties that can be - * updated during PATCH operation.. - * - * @param properties Describes the connected cluster resource properties that can be updated during PATCH - * operation. + * Specifies the distributionVersion property: Represents the Kubernetes distribution version on this + * connected cluster.. + * + * @param distributionVersion Represents the Kubernetes distribution version on this connected cluster. * @return the next definition stage. */ - Update withProperties(Object properties); + Update withDistributionVersion(String distributionVersion); + } + + /** + * The stage of the ConnectedCluster update allowing to specify azureHybridBenefit. + */ + interface WithAzureHybridBenefit { + /** + * Specifies the azureHybridBenefit property: Indicates whether Azure Hybrid Benefit is opted in. + * + * @param azureHybridBenefit Indicates whether Azure Hybrid Benefit is opted in. + * @return the next definition stage. + */ + Update withAzureHybridBenefit(AzureHybridBenefit azureHybridBenefit); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ ConnectedCluster refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -375,25 +598,25 @@ interface WithProperties { /** * Gets cluster user credentials of a connected cluster - * - *

Gets cluster user credentials of the connected cluster with a specified resource group and name. - * + * + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * * @param properties ListClusterUserCredential properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cluster user credentials of the connected cluster with a specified resource group and name along with - * {@link Response}. + * {@link Response}. */ - Response listClusterUserCredentialWithResponse( - ListClusterUserCredentialProperties properties, Context context); + Response listClusterUserCredentialWithResponse(ListClusterUserCredentialProperties properties, + Context context); /** * Gets cluster user credentials of a connected cluster - * - *

Gets cluster user credentials of the connected cluster with a specified resource group and name. - * + * + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * * @param properties ListClusterUserCredential properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterIdentity.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterIdentity.java index 98aa1e85a76ba..c583d36389449 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterIdentity.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterIdentity.java @@ -8,9 +8,11 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Identity for the connected cluster. */ +/** + * Identity for the connected cluster. + */ @Fluent -public class ConnectedClusterIdentity { +public final class ConnectedClusterIdentity { /* * The principal id of connected cluster identity. This property will only be provided for a system assigned * identity. @@ -32,14 +34,16 @@ public class ConnectedClusterIdentity { @JsonProperty(value = "type", required = true) private ResourceIdentityType type; - /** Creates an instance of ConnectedClusterIdentity class. */ + /** + * Creates an instance of ConnectedClusterIdentity class. + */ public ConnectedClusterIdentity() { } /** - * Get the principalId property: The principal id of connected cluster identity. This property will only be provided - * for a system assigned identity. - * + * Get the principalId property: The principal id of connected cluster identity. This property will only be + * provided for a system assigned identity. + * * @return the principalId value. */ public String principalId() { @@ -49,7 +53,7 @@ public String principalId() { /** * Get the tenantId property: The tenant id associated with the connected cluster. This property will only be * provided for a system assigned identity. - * + * * @return the tenantId value. */ public String tenantId() { @@ -59,7 +63,7 @@ public String tenantId() { /** * Get the type property: The type of identity used for the connected cluster. The type 'SystemAssigned, includes a * system created identity. The type 'None' means no identity is assigned to the connected cluster. - * + * * @return the type value. */ public ResourceIdentityType type() { @@ -69,7 +73,7 @@ public ResourceIdentityType type() { /** * Set the type property: The type of identity used for the connected cluster. The type 'SystemAssigned, includes a * system created identity. The type 'None' means no identity is assigned to the connected cluster. - * + * * @param type the type value to set. * @return the ConnectedClusterIdentity object itself. */ @@ -80,14 +84,13 @@ public ConnectedClusterIdentity withType(ResourceIdentityType type) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (type() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property type in model ConnectedClusterIdentity")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property type in model ConnectedClusterIdentity")); } } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterKind.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterKind.java new file mode 100644 index 0000000000000..d1e635b1ee889 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterKind.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Indicates the kind of Arc connected cluster based on host infrastructure. + */ +public final class ConnectedClusterKind extends ExpandableStringEnum { + /** + * Static value ProvisionedCluster for ConnectedClusterKind. + */ + public static final ConnectedClusterKind PROVISIONED_CLUSTER = fromString("ProvisionedCluster"); + + /** + * Creates a new instance of ConnectedClusterKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConnectedClusterKind() { + } + + /** + * Creates or finds a ConnectedClusterKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectedClusterKind. + */ + @JsonCreator + public static ConnectedClusterKind fromString(String name) { + return fromString(name, ConnectedClusterKind.class); + } + + /** + * Gets known ConnectedClusterKind values. + * + * @return known ConnectedClusterKind values. + */ + public static Collection values() { + return values(ConnectedClusterKind.class); + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterList.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterList.java index df7036456eb5e..1868e2823c810 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterList.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterList.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The paginated list of connected Clusters. */ +/** + * The paginated list of connected Clusters. + */ @Fluent public final class ConnectedClusterList { /* @@ -24,13 +26,15 @@ public final class ConnectedClusterList { @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of ConnectedClusterList class. */ + /** + * Creates an instance of ConnectedClusterList class. + */ public ConnectedClusterList() { } /** * Get the value property: The list of connected clusters. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Set the value property: The list of connected clusters. - * + * * @param value the value value to set. * @return the ConnectedClusterList object itself. */ @@ -50,7 +54,7 @@ public ConnectedClusterList withValue(List value) { /** * Get the nextLink property: The link to fetch the next page of connected cluster. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +63,7 @@ public String nextLink() { /** * Set the nextLink property: The link to fetch the next page of connected cluster. - * + * * @param nextLink the nextLink value to set. * @return the ConnectedClusterList object itself. */ @@ -70,7 +74,7 @@ public ConnectedClusterList withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterPatch.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterPatch.java index 20c10d5ce1ce2..a78fa1484d99d 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterPatch.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterPatch.java @@ -5,11 +5,14 @@ package com.azure.resourcemanager.hybridkubernetes.models; import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridkubernetes.fluent.models.ConnectedClusterPatchProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** Object containing updates for patch operations. */ +/** + * Object containing updates for patch operations. + */ @Fluent public final class ConnectedClusterPatch { /* @@ -23,15 +26,17 @@ public final class ConnectedClusterPatch { * Describes the connected cluster resource properties that can be updated during PATCH operation. */ @JsonProperty(value = "properties") - private Object properties; + private ConnectedClusterPatchProperties innerProperties; - /** Creates an instance of ConnectedClusterPatch class. */ + /** + * Creates an instance of ConnectedClusterPatch class. + */ public ConnectedClusterPatch() { } /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -40,7 +45,7 @@ public Map tags() { /** * Set the tags property: Resource tags. - * + * * @param tags the tags value to set. * @return the ConnectedClusterPatch object itself. */ @@ -50,32 +55,92 @@ public ConnectedClusterPatch withTags(Map tags) { } /** - * Get the properties property: Describes the connected cluster resource properties that can be updated during PATCH - * operation. - * - * @return the properties value. + * Get the innerProperties property: Describes the connected cluster resource properties that can be updated during + * PATCH operation. + * + * @return the innerProperties value. + */ + private ConnectedClusterPatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the distribution property: Represents the distribution of the connected cluster. + * + * @return the distribution value. + */ + public String distribution() { + return this.innerProperties() == null ? null : this.innerProperties().distribution(); + } + + /** + * Set the distribution property: Represents the distribution of the connected cluster. + * + * @param distribution the distribution value to set. + * @return the ConnectedClusterPatch object itself. + */ + public ConnectedClusterPatch withDistribution(String distribution) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedClusterPatchProperties(); + } + this.innerProperties().withDistribution(distribution); + return this; + } + + /** + * Get the distributionVersion property: Represents the Kubernetes distribution version on this connected cluster. + * + * @return the distributionVersion value. + */ + public String distributionVersion() { + return this.innerProperties() == null ? null : this.innerProperties().distributionVersion(); + } + + /** + * Set the distributionVersion property: Represents the Kubernetes distribution version on this connected cluster. + * + * @param distributionVersion the distributionVersion value to set. + * @return the ConnectedClusterPatch object itself. + */ + public ConnectedClusterPatch withDistributionVersion(String distributionVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedClusterPatchProperties(); + } + this.innerProperties().withDistributionVersion(distributionVersion); + return this; + } + + /** + * Get the azureHybridBenefit property: Indicates whether Azure Hybrid Benefit is opted in. + * + * @return the azureHybridBenefit value. */ - public Object properties() { - return this.properties; + public AzureHybridBenefit azureHybridBenefit() { + return this.innerProperties() == null ? null : this.innerProperties().azureHybridBenefit(); } /** - * Set the properties property: Describes the connected cluster resource properties that can be updated during PATCH - * operation. - * - * @param properties the properties value to set. + * Set the azureHybridBenefit property: Indicates whether Azure Hybrid Benefit is opted in. + * + * @param azureHybridBenefit the azureHybridBenefit value to set. * @return the ConnectedClusterPatch object itself. */ - public ConnectedClusterPatch withProperties(Object properties) { - this.properties = properties; + public ConnectedClusterPatch withAzureHybridBenefit(AzureHybridBenefit azureHybridBenefit) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedClusterPatchProperties(); + } + this.innerProperties().withAzureHybridBenefit(azureHybridBenefit); return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusters.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusters.java index 9f51fe04cfc05..21598f64eb749 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusters.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusters.java @@ -8,14 +8,16 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of ConnectedClusters. */ +/** + * Resource collection API of ConnectedClusters. + */ public interface ConnectedClusters { /** * Get the properties of the specified connected cluster. - * - *

Returns the properties of the specified connected cluster, including name, identity, properties, and - * additional cluster details. - * + * + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param context The context to associate with this operation. @@ -24,15 +26,15 @@ public interface ConnectedClusters { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a connected cluster along with {@link Response}. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String clusterName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, + Context context); /** * Get the properties of the specified connected cluster. - * - *

Returns the properties of the specified connected cluster, including name, identity, properties, and - * additional cluster details. - * + * + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -44,9 +46,9 @@ Response getByResourceGroupWithResponse( /** * Delete a connected cluster. - * - *

Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). - * + * + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -57,9 +59,9 @@ Response getByResourceGroupWithResponse( /** * Delete a connected cluster. - * - *

Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). - * + * + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param context The context to associate with this operation. @@ -71,9 +73,9 @@ Response getByResourceGroupWithResponse( /** * Gets cluster user credentials of a connected cluster - * - *

Gets cluster user credentials of the connected cluster with a specified resource group and name. - * + * + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param properties ListClusterUserCredential properties. @@ -82,16 +84,16 @@ Response getByResourceGroupWithResponse( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cluster user credentials of the connected cluster with a specified resource group and name along with - * {@link Response}. + * {@link Response}. */ - Response listClusterUserCredentialWithResponse( - String resourceGroupName, String clusterName, ListClusterUserCredentialProperties properties, Context context); + Response listClusterUserCredentialWithResponse(String resourceGroupName, String clusterName, + ListClusterUserCredentialProperties properties, Context context); /** * Gets cluster user credentials of a connected cluster - * - *

Gets cluster user credentials of the connected cluster with a specified resource group and name. - * + * + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Kubernetes cluster on which get is called. * @param properties ListClusterUserCredential properties. @@ -100,14 +102,14 @@ Response listClusterUserCredentialWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return cluster user credentials of the connected cluster with a specified resource group and name. */ - CredentialResults listClusterUserCredential( - String resourceGroupName, String clusterName, ListClusterUserCredentialProperties properties); + CredentialResults listClusterUserCredential(String resourceGroupName, String clusterName, + ListClusterUserCredentialProperties properties); /** * Lists all connected clusters - * - *

API to enumerate registered connected K8s clusters under a Resource Group. - * + * + * API to enumerate registered connected K8s clusters under a Resource Group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -118,9 +120,9 @@ CredentialResults listClusterUserCredential( /** * Lists all connected clusters - * - *

API to enumerate registered connected K8s clusters under a Resource Group. - * + * + * API to enumerate registered connected K8s clusters under a Resource Group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -132,9 +134,9 @@ CredentialResults listClusterUserCredential( /** * Lists all connected clusters - * - *

API to enumerate registered connected K8s clusters under a Subscription. - * + * + * API to enumerate registered connected K8s clusters under a Subscription. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of connected Clusters as paginated response with {@link PagedIterable}. @@ -143,9 +145,9 @@ CredentialResults listClusterUserCredential( /** * Lists all connected clusters - * - *

API to enumerate registered connected K8s clusters under a Subscription. - * + * + * API to enumerate registered connected K8s clusters under a Subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -156,10 +158,10 @@ CredentialResults listClusterUserCredential( /** * Get the properties of the specified connected cluster. - * - *

Returns the properties of the specified connected cluster, including name, identity, properties, and - * additional cluster details. - * + * + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -170,10 +172,10 @@ CredentialResults listClusterUserCredential( /** * Get the properties of the specified connected cluster. - * - *

Returns the properties of the specified connected cluster, including name, identity, properties, and - * additional cluster details. - * + * + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -185,9 +187,9 @@ CredentialResults listClusterUserCredential( /** * Delete a connected cluster. - * - *

Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). - * + * + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -197,9 +199,9 @@ CredentialResults listClusterUserCredential( /** * Delete a connected cluster. - * - *

Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). - * + * + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -210,7 +212,7 @@ CredentialResults listClusterUserCredential( /** * Begins definition for a new ConnectedCluster resource. - * + * * @param name resource name. * @return the first stage of the new ConnectedCluster definition. */ diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectivityStatus.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectivityStatus.java index a2845e2e67d21..de470fb7bb03f 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectivityStatus.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectivityStatus.java @@ -8,23 +8,33 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Represents the connectivity status of the connected cluster. */ +/** + * Represents the connectivity status of the connected cluster. + */ public final class ConnectivityStatus extends ExpandableStringEnum { - /** Static value Connecting for ConnectivityStatus. */ + /** + * Static value Connecting for ConnectivityStatus. + */ public static final ConnectivityStatus CONNECTING = fromString("Connecting"); - /** Static value Connected for ConnectivityStatus. */ + /** + * Static value Connected for ConnectivityStatus. + */ public static final ConnectivityStatus CONNECTED = fromString("Connected"); - /** Static value Offline for ConnectivityStatus. */ + /** + * Static value Offline for ConnectivityStatus. + */ public static final ConnectivityStatus OFFLINE = fromString("Offline"); - /** Static value Expired for ConnectivityStatus. */ + /** + * Static value Expired for ConnectivityStatus. + */ public static final ConnectivityStatus EXPIRED = fromString("Expired"); /** * Creates a new instance of ConnectivityStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,7 +43,7 @@ public ConnectivityStatus() { /** * Creates or finds a ConnectivityStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding ConnectivityStatus. */ @@ -44,7 +54,7 @@ public static ConnectivityStatus fromString(String name) { /** * Gets known ConnectivityStatus values. - * + * * @return known ConnectivityStatus values. */ public static Collection values() { diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResult.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResult.java index 031e34b3530b8..e8d7a4f44b923 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResult.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResult.java @@ -8,7 +8,9 @@ import com.azure.core.util.CoreUtils; import com.fasterxml.jackson.annotation.JsonProperty; -/** The credential result response. */ +/** + * The credential result response. + */ @Immutable public final class CredentialResult { /* @@ -23,13 +25,15 @@ public final class CredentialResult { @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private byte[] value; - /** Creates an instance of CredentialResult class. */ + /** + * Creates an instance of CredentialResult class. + */ public CredentialResult() { } /** * Get the name property: The name of the credential. - * + * * @return the name value. */ public String name() { @@ -38,7 +42,7 @@ public String name() { /** * Get the value property: Base64-encoded Kubernetes configuration file. - * + * * @return the value value. */ public byte[] value() { @@ -47,7 +51,7 @@ public byte[] value() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResults.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResults.java index da6275bfc883b..54cf46ad7abf2 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResults.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResults.java @@ -7,25 +7,27 @@ import com.azure.resourcemanager.hybridkubernetes.fluent.models.CredentialResultsInner; import java.util.List; -/** An immutable client-side representation of CredentialResults. */ +/** + * An immutable client-side representation of CredentialResults. + */ public interface CredentialResults { /** * Gets the hybridConnectionConfig property: Contains the REP (rendezvous endpoint) and “Sender” access token. - * + * * @return the hybridConnectionConfig value. */ HybridConnectionConfig hybridConnectionConfig(); /** * Gets the kubeconfigs property: Base64-encoded Kubernetes configuration file. - * + * * @return the kubeconfigs value. */ List kubeconfigs(); /** * Gets the inner com.azure.resourcemanager.hybridkubernetes.fluent.models.CredentialResultsInner object. - * + * * @return the inner object. */ CredentialResultsInner innerModel(); diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/HybridConnectionConfig.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/HybridConnectionConfig.java index b96a92c14da8e..fe1776e398afb 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/HybridConnectionConfig.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/HybridConnectionConfig.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** Contains the REP (rendezvous endpoint) and “Sender” access token. */ +/** + * Contains the REP (rendezvous endpoint) and “Sender” access token. + */ @Immutable public final class HybridConnectionConfig { /* @@ -34,13 +36,15 @@ public final class HybridConnectionConfig { @JsonProperty(value = "token", access = JsonProperty.Access.WRITE_ONLY) private String token; - /** Creates an instance of HybridConnectionConfig class. */ + /** + * Creates an instance of HybridConnectionConfig class. + */ public HybridConnectionConfig() { } /** * Get the expirationTime property: Timestamp when this token will be expired. - * + * * @return the expirationTime value. */ public Long expirationTime() { @@ -49,7 +53,7 @@ public Long expirationTime() { /** * Get the hybridConnectionName property: Name of the connection. - * + * * @return the hybridConnectionName value. */ public String hybridConnectionName() { @@ -58,7 +62,7 @@ public String hybridConnectionName() { /** * Get the relay property: Name of the relay. - * + * * @return the relay value. */ public String relay() { @@ -67,7 +71,7 @@ public String relay() { /** * Get the token property: Sender access token. - * + * * @return the token value. */ public String token() { @@ -76,7 +80,7 @@ public String token() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ListClusterUserCredentialProperties.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ListClusterUserCredentialProperties.java index 115835b511515..81b7403b2736d 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ListClusterUserCredentialProperties.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ListClusterUserCredentialProperties.java @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** The ListClusterUserCredentialProperties model. */ +/** + * The ListClusterUserCredentialProperties model. + */ @Fluent public final class ListClusterUserCredentialProperties { /* @@ -23,13 +25,15 @@ public final class ListClusterUserCredentialProperties { @JsonProperty(value = "clientProxy", required = true) private boolean clientProxy; - /** Creates an instance of ListClusterUserCredentialProperties class. */ + /** + * Creates an instance of ListClusterUserCredentialProperties class. + */ public ListClusterUserCredentialProperties() { } /** * Get the authenticationMethod property: The mode of client authentication. - * + * * @return the authenticationMethod value. */ public AuthenticationMethod authenticationMethod() { @@ -38,7 +42,7 @@ public AuthenticationMethod authenticationMethod() { /** * Set the authenticationMethod property: The mode of client authentication. - * + * * @param authenticationMethod the authenticationMethod value to set. * @return the ListClusterUserCredentialProperties object itself. */ @@ -49,7 +53,7 @@ public ListClusterUserCredentialProperties withAuthenticationMethod(Authenticati /** * Get the clientProxy property: Boolean value to indicate whether the request is for client side proxy or not. - * + * * @return the clientProxy value. */ public boolean clientProxy() { @@ -58,7 +62,7 @@ public boolean clientProxy() { /** * Set the clientProxy property: Boolean value to indicate whether the request is for client side proxy or not. - * + * * @param clientProxy the clientProxy value to set. * @return the ListClusterUserCredentialProperties object itself. */ @@ -69,15 +73,13 @@ public ListClusterUserCredentialProperties withClientProxy(boolean clientProxy) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (authenticationMethod() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property authenticationMethod in model ListClusterUserCredentialProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property authenticationMethod in model ListClusterUserCredentialProperties")); } } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/Operation.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/Operation.java index b642fea7ef98f..496788b1d9433 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/Operation.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/Operation.java @@ -6,25 +6,27 @@ import com.azure.resourcemanager.hybridkubernetes.fluent.models.OperationInner; -/** An immutable client-side representation of Operation. */ +/** + * An immutable client-side representation of Operation. + */ public interface Operation { /** * Gets the name property: Operation name: {Microsoft.Kubernetes}/{resource}/{operation}. - * + * * @return the name value. */ String name(); /** * Gets the display property: The object that represents the operation. - * + * * @return the display value. */ OperationDisplay display(); /** * Gets the inner com.azure.resourcemanager.hybridkubernetes.fluent.models.OperationInner object. - * + * * @return the inner object. */ OperationInner innerModel(); diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/OperationDisplay.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/OperationDisplay.java index 99d4e10dd355f..a7ab229132267 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/OperationDisplay.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/OperationDisplay.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The object that represents the operation. */ +/** + * The object that represents the operation. + */ @Fluent public final class OperationDisplay { /* @@ -34,13 +36,15 @@ public final class OperationDisplay { @JsonProperty(value = "description") private String description; - /** Creates an instance of OperationDisplay class. */ + /** + * Creates an instance of OperationDisplay class. + */ public OperationDisplay() { } /** * Get the provider property: Service provider: Microsoft.connectedClusters. - * + * * @return the provider value. */ public String provider() { @@ -49,7 +53,7 @@ public String provider() { /** * Set the provider property: Service provider: Microsoft.connectedClusters. - * + * * @param provider the provider value to set. * @return the OperationDisplay object itself. */ @@ -60,7 +64,7 @@ public OperationDisplay withProvider(String provider) { /** * Get the resource property: Connected Cluster Resource on which the operation is performed. - * + * * @return the resource value. */ public String resource() { @@ -69,7 +73,7 @@ public String resource() { /** * Set the resource property: Connected Cluster Resource on which the operation is performed. - * + * * @param resource the resource value to set. * @return the OperationDisplay object itself. */ @@ -80,7 +84,7 @@ public OperationDisplay withResource(String resource) { /** * Get the operation property: Operation type: Read, write, delete, etc. - * + * * @return the operation value. */ public String operation() { @@ -89,7 +93,7 @@ public String operation() { /** * Set the operation property: Operation type: Read, write, delete, etc. - * + * * @param operation the operation value to set. * @return the OperationDisplay object itself. */ @@ -100,7 +104,7 @@ public OperationDisplay withOperation(String operation) { /** * Get the description property: Description of the operation. - * + * * @return the description value. */ public String description() { @@ -109,7 +113,7 @@ public String description() { /** * Set the description property: Description of the operation. - * + * * @param description the description value to set. * @return the OperationDisplay object itself. */ @@ -120,7 +124,7 @@ public OperationDisplay withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/OperationList.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/OperationList.java index 4ccdab3521167..1117f0c0bb9ab 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/OperationList.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/OperationList.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The paginated list of connected cluster API operations. */ +/** + * The paginated list of connected cluster API operations. + */ @Fluent public final class OperationList { /* @@ -24,13 +26,15 @@ public final class OperationList { @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of OperationList class. */ + /** + * Creates an instance of OperationList class. + */ public OperationList() { } /** * Get the value property: The list of connected cluster API operations. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Get the nextLink property: The link to fetch the next page of connected cluster API operations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -48,7 +52,7 @@ public String nextLink() { /** * Set the nextLink property: The link to fetch the next page of connected cluster API operations. - * + * * @param nextLink the nextLink value to set. * @return the OperationList object itself. */ @@ -59,7 +63,7 @@ public OperationList withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/Operations.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/Operations.java index d6878198dad2a..9f82be81e9312 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/Operations.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/Operations.java @@ -7,11 +7,13 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of Operations. */ +/** + * Resource collection API of Operations. + */ public interface Operations { /** * Lists all of the available API operations for Connected Cluster resource. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of connected cluster API operations as paginated response with {@link PagedIterable}. @@ -20,7 +22,7 @@ public interface Operations { /** * Lists all of the available API operations for Connected Cluster resource. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/PrivateLinkState.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/PrivateLinkState.java new file mode 100644 index 0000000000000..b0f6e9c0ad0c6 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/PrivateLinkState.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Property which describes the state of private link on a connected cluster resource. + */ +public final class PrivateLinkState extends ExpandableStringEnum { + /** + * Static value Enabled for PrivateLinkState. + */ + public static final PrivateLinkState ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for PrivateLinkState. + */ + public static final PrivateLinkState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of PrivateLinkState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateLinkState() { + } + + /** + * Creates or finds a PrivateLinkState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateLinkState. + */ + @JsonCreator + public static PrivateLinkState fromString(String name) { + return fromString(name, PrivateLinkState.class); + } + + /** + * Gets known PrivateLinkState values. + * + * @return known PrivateLinkState values. + */ + public static Collection values() { + return values(PrivateLinkState.class); + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ProvisioningState.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ProvisioningState.java index 981061d4cd489..bffc69bb7a541 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ProvisioningState.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ProvisioningState.java @@ -8,32 +8,48 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The current deployment state of connectedClusters. */ +/** + * The current deployment state of connectedClusters. + */ public final class ProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for ProvisioningState. */ + /** + * Static value Succeeded for ProvisioningState. + */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for ProvisioningState. */ + /** + * Static value Failed for ProvisioningState. + */ public static final ProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for ProvisioningState. */ + /** + * Static value Canceled for ProvisioningState. + */ public static final ProvisioningState CANCELED = fromString("Canceled"); - /** Static value Provisioning for ProvisioningState. */ + /** + * Static value Provisioning for ProvisioningState. + */ public static final ProvisioningState PROVISIONING = fromString("Provisioning"); - /** Static value Updating for ProvisioningState. */ + /** + * Static value Updating for ProvisioningState. + */ public static final ProvisioningState UPDATING = fromString("Updating"); - /** Static value Deleting for ProvisioningState. */ + /** + * Static value Deleting for ProvisioningState. + */ public static final ProvisioningState DELETING = fromString("Deleting"); - /** Static value Accepted for ProvisioningState. */ + /** + * Static value Accepted for ProvisioningState. + */ public static final ProvisioningState ACCEPTED = fromString("Accepted"); /** * Creates a new instance of ProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -42,7 +58,7 @@ public ProvisioningState() { /** * Creates or finds a ProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding ProvisioningState. */ @@ -53,7 +69,7 @@ public static ProvisioningState fromString(String name) { /** * Gets known ProvisioningState values. - * + * * @return known ProvisioningState values. */ public static Collection values() { diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ResourceIdentityType.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ResourceIdentityType.java index a1b3200c0c7a5..596750e7e4625 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ResourceIdentityType.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ResourceIdentityType.java @@ -12,13 +12,19 @@ * The type 'None' means no identity is assigned to the connected cluster. */ public enum ResourceIdentityType { - /** Enum value None. */ + /** + * Enum value None. + */ NONE("None"), - /** Enum value SystemAssigned. */ + /** + * Enum value SystemAssigned. + */ SYSTEM_ASSIGNED("SystemAssigned"); - /** The actual serialized value for a ResourceIdentityType instance. */ + /** + * The actual serialized value for a ResourceIdentityType instance. + */ private final String value; ResourceIdentityType(String value) { @@ -27,7 +33,7 @@ public enum ResourceIdentityType { /** * Parses a serialized value to a ResourceIdentityType instance. - * + * * @param value the serialized value to parse. * @return the parsed ResourceIdentityType object, or null if unable to parse. */ @@ -45,7 +51,9 @@ public static ResourceIdentityType fromString(String value) { return null; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @JsonValue @Override public String toString() { diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/SystemComponent.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/SystemComponent.java new file mode 100644 index 0000000000000..2394ce493dc03 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/SystemComponent.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * System Extension and its desired versions to be installed on the cluster resource. + */ +@Fluent +public final class SystemComponent { + /* + * Type of the system extension + */ + @JsonProperty(value = "type") + private String type; + + /* + * Version of the system extension to be installed on the cluster resource. + */ + @JsonProperty(value = "userSpecifiedVersion") + private String userSpecifiedVersion; + + /* + * Major Version of the system extension to be installed on the cluster resource. + */ + @JsonProperty(value = "majorVersion") + private Integer majorVersion; + + /* + * Version of the system extension is currently installed on the cluster resource. + */ + @JsonProperty(value = "currentVersion", access = JsonProperty.Access.WRITE_ONLY) + private String currentVersion; + + /** + * Creates an instance of SystemComponent class. + */ + public SystemComponent() { + } + + /** + * Get the type property: Type of the system extension. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of the system extension. + * + * @param type the type value to set. + * @return the SystemComponent object itself. + */ + public SystemComponent withType(String type) { + this.type = type; + return this; + } + + /** + * Get the userSpecifiedVersion property: Version of the system extension to be installed on the cluster resource. + * + * @return the userSpecifiedVersion value. + */ + public String userSpecifiedVersion() { + return this.userSpecifiedVersion; + } + + /** + * Set the userSpecifiedVersion property: Version of the system extension to be installed on the cluster resource. + * + * @param userSpecifiedVersion the userSpecifiedVersion value to set. + * @return the SystemComponent object itself. + */ + public SystemComponent withUserSpecifiedVersion(String userSpecifiedVersion) { + this.userSpecifiedVersion = userSpecifiedVersion; + return this; + } + + /** + * Get the majorVersion property: Major Version of the system extension to be installed on the cluster resource. + * + * @return the majorVersion value. + */ + public Integer majorVersion() { + return this.majorVersion; + } + + /** + * Set the majorVersion property: Major Version of the system extension to be installed on the cluster resource. + * + * @param majorVersion the majorVersion value to set. + * @return the SystemComponent object itself. + */ + public SystemComponent withMajorVersion(Integer majorVersion) { + this.majorVersion = majorVersion; + return this; + } + + /** + * Get the currentVersion property: Version of the system extension is currently installed on the cluster resource. + * + * @return the currentVersion value. + */ + public String currentVersion() { + return this.currentVersion; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/package-info.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/package-info.java index 3e85170bd735d..18ba51c7c2424 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/package-info.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the data models for HybridKubernetesManagementClient. Hybrid Kubernetes Client. */ +/** + * Package containing the data models for HybridKubernetesManagementClient. + * Hybrid Kubernetes Client. + */ package com.azure.resourcemanager.hybridkubernetes.models; diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/package-info.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/package-info.java index ddf72d636abca..524f2b65cfe31 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/package-info.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the classes for HybridKubernetesManagementClient. Hybrid Kubernetes Client. */ +/** + * Package containing the classes for HybridKubernetesManagementClient. + * Hybrid Kubernetes Client. + */ package com.azure.resourcemanager.hybridkubernetes; diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/module-info.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/module-info.java index 1bfb39198d75b..e69db71e53723 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/module-info.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/module-info.java @@ -10,10 +10,6 @@ exports com.azure.resourcemanager.hybridkubernetes.fluent.models; exports com.azure.resourcemanager.hybridkubernetes.models; - opens com.azure.resourcemanager.hybridkubernetes.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.hybridkubernetes.models to - com.azure.core, - com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.hybridkubernetes.fluent.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.hybridkubernetes.models to com.azure.core, com.fasterxml.jackson.databind; } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hybridkubernetes/proxy-config.json b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hybridkubernetes/proxy-config.json new file mode 100644 index 0000000000000..7ff47ecc31810 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hybridkubernetes/proxy-config.json @@ -0,0 +1 @@ +[ [ "com.azure.resourcemanager.hybridkubernetes.implementation.ConnectedClustersClientImpl$ConnectedClustersService" ], [ "com.azure.resourcemanager.hybridkubernetes.implementation.OperationsClientImpl$OperationsService" ] ] \ No newline at end of file diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hybridkubernetes/reflect-config.json b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hybridkubernetes/reflect-config.json new file mode 100644 index 0000000000000..b014543d9494f --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hybridkubernetes/reflect-config.json @@ -0,0 +1,126 @@ +[ { + "name" : "com.azure.resourcemanager.hybridkubernetes.fluent.models.ConnectedClusterInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterIdentity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridkubernetes.fluent.models.ConnectedClusterProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridkubernetes.models.AadProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridkubernetes.models.ArcAgentProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridkubernetes.models.SystemComponent", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridkubernetes.models.AgentError", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterPatch", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridkubernetes.fluent.models.ConnectedClusterPatchProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridkubernetes.models.ListClusterUserCredentialProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridkubernetes.fluent.models.CredentialResultsInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridkubernetes.models.HybridConnectionConfig", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridkubernetes.models.CredentialResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridkubernetes.models.OperationList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridkubernetes.fluent.models.OperationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridkubernetes.models.OperationDisplay", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridkubernetes.models.ProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridkubernetes.models.ConnectivityStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridkubernetes.models.PrivateLinkState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridkubernetes.models.AzureHybridBenefit", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridkubernetes.models.AutoUpgradeOptions", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridkubernetes.models.AuthenticationMethod", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.hybridkubernetes.models.ResourceIdentityType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +} ] \ No newline at end of file diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterCreateSamples.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterCreateSamples.java index ab06bbfc275fe..8f70c1bb6e6ea 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterCreateSamples.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterCreateSamples.java @@ -4,36 +4,94 @@ package com.azure.resourcemanager.hybridkubernetes.generated; +import com.azure.resourcemanager.hybridkubernetes.models.AadProfile; +import com.azure.resourcemanager.hybridkubernetes.models.ArcAgentProfile; +import com.azure.resourcemanager.hybridkubernetes.models.AutoUpgradeOptions; +import com.azure.resourcemanager.hybridkubernetes.models.AzureHybridBenefit; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterIdentity; +import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterKind; +import com.azure.resourcemanager.hybridkubernetes.models.PrivateLinkState; import com.azure.resourcemanager.hybridkubernetes.models.ResourceIdentityType; +import com.azure.resourcemanager.hybridkubernetes.models.SystemComponent; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for ConnectedCluster Create. */ +/** + * Samples for ConnectedCluster Create. + */ public final class ConnectedClusterCreateSamples { /* - * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/CreateClusterExample.json + * x-ms-original-file: + * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/ + * CreateCluster_KindExample.json + */ + /** + * Sample code: CreateCluster_KindExample. + * + * @param manager Entry point to HybridKubernetesManager. + */ + public static void + createClusterKindExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + manager.connectedClusters().define("testCluster").withRegion("East US").withExistingResourceGroup("k8sc-rg") + .withIdentity(new ConnectedClusterIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withAgentPublicKeyCertificate("").withTags(mapOf()).withKind(ConnectedClusterKind.PROVISIONED_CLUSTER) + .withDistribution("AKS").withDistributionVersion("1.0") + .withAzureHybridBenefit(AzureHybridBenefit.NOT_APPLICABLE) + .withAadProfile(new AadProfile().withEnableAzureRbac(true) + .withAdminGroupObjectIDs(Arrays.asList("56f988bf-86f1-41af-91ab-2d7cd011db47")) + .withTenantId("82f988bf-86f1-41af-91ab-2d7cd011db47")) + .withArcAgentProfile(new ArcAgentProfile().withDesiredAgentVersion("0.1.0") + .withAgentAutoUpgrade(AutoUpgradeOptions.ENABLED) + .withSystemComponents(Arrays.asList( + new SystemComponent().withType("Strato").withUserSpecifiedVersion("0.1.1").withMajorVersion(0)))) + .create(); + } + + /* + * x-ms-original-file: + * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/ + * CreateClusterExample.json */ /** * Sample code: CreateClusterExample. - * + * * @param manager Entry point to HybridKubernetesManager. */ - public static void createClusterExample( - com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { - manager - .connectedClusters() - .define("testCluster") - .withRegion("East US") - .withExistingResourceGroup("k8sc-rg") + public static void + createClusterExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + manager.connectedClusters().define("testCluster").withRegion("East US").withExistingResourceGroup("k8sc-rg") .withIdentity(new ConnectedClusterIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) .withAgentPublicKeyCertificate( - "MIICYzCCAcygAwIBAgIBADANBgkqhkiG9w0BAQUFADAuMQswCQYDVQQGEwJVUzEMMAoGA1UEChMDSUJNMREwDwYDVQQLEwhMb2NhbCBDQTAeFw05OTEyMjIwNTAwMDBaFw0wMDEyMjMwNDU5NTlaMC4xCzAJBgNVBAYTAlVTMQwwCgYDVQQKEwNJQk0xETAPBgNVBAsTCExvY2FsIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD2bZEo7xGaX2/0GHkrNFZvlxBou9v1Jmt/PDiTMPve8r9FeJAQ0QdvFST/0JPQYD20rH0bimdDLgNdNynmyRoS2S/IInfpmf69iyc2G0TPyRvmHIiOZbdCd+YBHQi1adkj17NDcWj6S14tVurFX73zx0sNoMS79q3tuXKrDsxeuwIDAQABo4GQMIGNMEsGCVUdDwGG+EIBDQQ+EzxHZW5lcmF0ZWQgYnkgdGhlIFNlY3VyZVdheSBTZWN1cml0eSBTZXJ2ZXIgZm9yIE9TLzM5MCAoUkFDRikwDgYDVR0PAQH/BAQDAgAGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ3+ocRyCTJw067dLSwr/nalx6YMMA0GCSqGSIb3DQEBBQUAA4GBAMaQzt+zaj1GU77yzlr8iiMBXgdQrwsZZWJo5exnAucJAEYQZmOfyLiM" - + " D6oYq+ZnfvM0n8G/Y79q8nhwvuxpYOnRSAXFp6xSkrIOeZtJMY1h00LKp/JX3Ng1svZ2agE126JHsQ0bhzN5TKsYfbwfTwfjdWAGy6Vf1nYi/rO+ryMO") - .withTags(mapOf()) - .create(); + "MIICYzCCAcygAwIBAgIBADANBgkqhkiG9w0BAQUFADAuMQswCQYDVQQGEwJVUzEMMAoGA1UEChMDSUJNMREwDwYDVQQLEwhMb2NhbCBDQTAeFw05OTEyMjIwNTAwMDBaFw0wMDEyMjMwNDU5NTlaMC4xCzAJBgNVBAYTAlVTMQwwCgYDVQQKEwNJQk0xETAPBgNVBAsTCExvY2FsIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD2bZEo7xGaX2/0GHkrNFZvlxBou9v1Jmt/PDiTMPve8r9FeJAQ0QdvFST/0JPQYD20rH0bimdDLgNdNynmyRoS2S/IInfpmf69iyc2G0TPyRvmHIiOZbdCd+YBHQi1adkj17NDcWj6S14tVurFX73zx0sNoMS79q3tuXKrDsxeuwIDAQABo4GQMIGNMEsGCVUdDwGG+EIBDQQ+EzxHZW5lcmF0ZWQgYnkgdGhlIFNlY3VyZVdheSBTZWN1cml0eSBTZXJ2ZXIgZm9yIE9TLzM5MCAoUkFDRikwDgYDVR0PAQH/BAQDAgAGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ3+ocRyCTJw067dLSwr/nalx6YMMA0GCSqGSIb3DQEBBQUAA4GBAMaQzt+zaj1GU77yzlr8iiMBXgdQrwsZZWJo5exnAucJAEYQZmOfyLiM D6oYq+ZnfvM0n8G/Y79q8nhwvuxpYOnRSAXFp6xSkrIOeZtJMY1h00LKp/JX3Ng1svZ2agE126JHsQ0bhzN5TKsYfbwfTwfjdWAGy6Vf1nYi/rO+ryMO") + .withTags(mapOf()).withDistribution("AKS").withDistributionVersion("1.0") + .withAzureHybridBenefit(AzureHybridBenefit.NOT_APPLICABLE).create(); + } + + /* + * x-ms-original-file: + * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/ + * CreateClusterPrivateLinkExample.json + */ + /** + * Sample code: CreateClusterPrivateLinkExample. + * + * @param manager Entry point to HybridKubernetesManager. + */ + public static void + createClusterPrivateLinkExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + manager.connectedClusters().define("testCluster").withRegion("East US").withExistingResourceGroup("k8sc-rg") + .withIdentity(new ConnectedClusterIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withAgentPublicKeyCertificate( + "MIICYzCCAcygAwIBAgIBADANBgkqhkiG9w0BAQUFADAuMQswCQYDVQQGEwJVUzEMMAoGA1UEChMDSUJNMREwDwYDVQQLEwhMb2NhbCBDQTAeFw05OTEyMjIwNTAwMDBaFw0wMDEyMjMwNDU5NTlaMC4xCzAJBgNVBAYTAlVTMQwwCgYDVQQKEwNJQk0xETAPBgNVBAsTCExvY2FsIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD2bZEo7xGaX2/0GHkrNFZvlxBou9v1Jmt/PDiTMPve8r9FeJAQ0QdvFST/0JPQYD20rH0bimdDLgNdNynmyRoS2S/IInfpmf69iyc2G0TPyRvmHIiOZbdCd+YBHQi1adkj17NDcWj6S14tVurFX73zx0sNoMS79q3tuXKrDsxeuwIDAQABo4GQMIGNMEsGCVUdDwGG+EIBDQQ+EzxHZW5lcmF0ZWQgYnkgdGhlIFNlY3VyZVdheSBTZWN1cml0eSBTZXJ2ZXIgZm9yIE9TLzM5MCAoUkFDRikwDgYDVR0PAQH/BAQDAgAGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ3+ocRyCTJw067dLSwr/nalx6YMMA0GCSqGSIb3DQEBBQUAA4GBAMaQzt+zaj1GU77yzlr8iiMBXgdQrwsZZWJo5exnAucJAEYQZmOfyLiM D6oYq+ZnfvM0n8G/Y79q8nhwvuxpYOnRSAXFp6xSkrIOeZtJMY1h00LKp/JX3Ng1svZ2agE126JHsQ0bhzN5TKsYfbwfTwfjdWAGy6Vf1nYi/rO+ryMO") + .withTags(mapOf()).withDistribution("AKS").withDistributionVersion("1.0") + .withPrivateLinkState(PrivateLinkState.ENABLED) + .withPrivateLinkScopeResourceId( + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName") + .withAzureHybridBenefit(AzureHybridBenefit.NOT_APPLICABLE).create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterDeleteSamples.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterDeleteSamples.java index 65e7e94b0d77c..f125f87ff39af 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterDeleteSamples.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterDeleteSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.hybridkubernetes.generated; -/** Samples for ConnectedCluster Delete. */ +/** + * Samples for ConnectedCluster Delete. + */ public final class ConnectedClusterDeleteSamples { /* - * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/DeleteClusterExample.json + * x-ms-original-file: + * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/ + * DeleteClusterExample.json */ /** * Sample code: DeleteClusterExample. - * + * * @param manager Entry point to HybridKubernetesManager. */ - public static void deleteClusterExample( - com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + public static void + deleteClusterExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { manager.connectedClusters().delete("k8sc-rg", "testCluster", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterGetByResourceGroupSamples.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterGetByResourceGroupSamples.java index 4e8b7e803c804..25b6c8a5595a0 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterGetByResourceGroupSamples.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterGetByResourceGroupSamples.java @@ -4,19 +4,38 @@ package com.azure.resourcemanager.hybridkubernetes.generated; -/** Samples for ConnectedCluster GetByResourceGroup. */ +/** + * Samples for ConnectedCluster GetByResourceGroup. + */ public final class ConnectedClusterGetByResourceGroupSamples { /* - * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/GetClusterExample.json + * x-ms-original-file: + * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/ + * GetProvisionedClusterExample.json + */ + /** + * Sample code: GetProvisionedClusterExample. + * + * @param manager Entry point to HybridKubernetesManager. + */ + public static void + getProvisionedClusterExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + manager.connectedClusters().getByResourceGroupWithResponse("k8sc-rg", "testCluster", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/ + * GetClusterExample.json */ /** * Sample code: GetClusterExample. - * + * * @param manager Entry point to HybridKubernetesManager. */ public static void getClusterExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { - manager - .connectedClusters() - .getByResourceGroupWithResponse("k8sc-rg", "testCluster", com.azure.core.util.Context.NONE); + manager.connectedClusters().getByResourceGroupWithResponse("k8sc-rg", "testCluster", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterListByResourceGroupSamples.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterListByResourceGroupSamples.java index e38499f548b0e..c8c8e30497421 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterListByResourceGroupSamples.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterListByResourceGroupSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.hybridkubernetes.generated; -/** Samples for ConnectedCluster ListByResourceGroup. */ +/** + * Samples for ConnectedCluster ListByResourceGroup. + */ public final class ConnectedClusterListByResourceGroupSamples { /* - * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/GetClustersByResourceGroupExample.json + * x-ms-original-file: + * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/ + * GetClustersByResourceGroupExample.json */ /** * Sample code: GetClustersExample. - * + * * @param manager Entry point to HybridKubernetesManager. */ public static void getClustersExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterListClusterUserCredentialSamples.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterListClusterUserCredentialSamples.java index 7e63e6c71a3eb..da226438a557e 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterListClusterUserCredentialSamples.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterListClusterUserCredentialSamples.java @@ -7,89 +7,79 @@ import com.azure.resourcemanager.hybridkubernetes.models.AuthenticationMethod; import com.azure.resourcemanager.hybridkubernetes.models.ListClusterUserCredentialProperties; -/** Samples for ConnectedCluster ListClusterUserCredential. */ +/** + * Samples for ConnectedCluster ListClusterUserCredential. + */ public final class ConnectedClusterListClusterUserCredentialSamples { /* - * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/ConnectedClustersListClusterCredentialResultCSPAAD.json + * x-ms-original-file: + * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/ + * ConnectedClustersListClusterCredentialResultCSPAAD.json */ /** * Sample code: ListClusterUserCredentialExample. - * + * * @param manager Entry point to HybridKubernetesManager. */ - public static void listClusterUserCredentialExample( - com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { - manager - .connectedClusters() - .listClusterUserCredentialWithResponse( - "k8sc-rg", - "testCluster", - new ListClusterUserCredentialProperties() - .withAuthenticationMethod(AuthenticationMethod.AAD) - .withClientProxy(true), - com.azure.core.util.Context.NONE); + public static void + listClusterUserCredentialExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + manager.connectedClusters().listClusterUserCredentialWithResponse( + "k8sc-rg", "testCluster", new ListClusterUserCredentialProperties() + .withAuthenticationMethod(AuthenticationMethod.AAD).withClientProxy(true), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/ConnectedClustersListClusterCredentialResultHPAAD.json + * x-ms-original-file: + * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/ + * ConnectedClustersListClusterCredentialResultHPAAD.json */ /** * Sample code: ListClusterUserCredentialCSPExample. - * + * * @param manager Entry point to HybridKubernetesManager. */ public static void listClusterUserCredentialCSPExample( com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { - manager - .connectedClusters() - .listClusterUserCredentialWithResponse( - "k8sc-rg", - "testCluster", - new ListClusterUserCredentialProperties() - .withAuthenticationMethod(AuthenticationMethod.AAD) - .withClientProxy(false), - com.azure.core.util.Context.NONE); + manager.connectedClusters().listClusterUserCredentialWithResponse( + "k8sc-rg", "testCluster", new ListClusterUserCredentialProperties() + .withAuthenticationMethod(AuthenticationMethod.AAD).withClientProxy(false), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/ConnectedClustersListClusterCredentialResultCSPToken.json + * x-ms-original-file: + * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/ + * ConnectedClustersListClusterCredentialResultCSPToken.json */ /** * Sample code: ListClusterUserCredentialNonAadExample. - * + * * @param manager Entry point to HybridKubernetesManager. */ public static void listClusterUserCredentialNonAadExample( com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { - manager - .connectedClusters() - .listClusterUserCredentialWithResponse( - "k8sc-rg", - "testCluster", - new ListClusterUserCredentialProperties() - .withAuthenticationMethod(AuthenticationMethod.TOKEN) - .withClientProxy(true), - com.azure.core.util.Context.NONE); + manager.connectedClusters().listClusterUserCredentialWithResponse( + "k8sc-rg", "testCluster", new ListClusterUserCredentialProperties() + .withAuthenticationMethod(AuthenticationMethod.TOKEN).withClientProxy(true), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/ConnectedClustersListClusterCredentialResultHPToken.json + * x-ms-original-file: + * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/ + * ConnectedClustersListClusterCredentialResultHPToken.json */ /** * Sample code: ListClusterUserCredentialNonAadCSPExample. - * + * * @param manager Entry point to HybridKubernetesManager. */ public static void listClusterUserCredentialNonAadCSPExample( com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { - manager - .connectedClusters() - .listClusterUserCredentialWithResponse( - "k8sc-rg", - "testCluster", - new ListClusterUserCredentialProperties() - .withAuthenticationMethod(AuthenticationMethod.TOKEN) - .withClientProxy(false), - com.azure.core.util.Context.NONE); + manager.connectedClusters().listClusterUserCredentialWithResponse( + "k8sc-rg", "testCluster", new ListClusterUserCredentialProperties() + .withAuthenticationMethod(AuthenticationMethod.TOKEN).withClientProxy(false), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterListSamples.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterListSamples.java index cc603b3e99108..7b40323efabe0 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterListSamples.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterListSamples.java @@ -4,17 +4,22 @@ package com.azure.resourcemanager.hybridkubernetes.generated; -/** Samples for ConnectedCluster List. */ +/** + * Samples for ConnectedCluster List. + */ public final class ConnectedClusterListSamples { /* - * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/GetClustersBySubscriptionExample.json + * x-ms-original-file: + * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/ + * GetClustersBySubscriptionExample.json */ /** - * Sample code: GetClustersExample. - * + * Sample code: GetClustersBySubscriptionExample. + * * @param manager Entry point to HybridKubernetesManager. */ - public static void getClustersExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + public static void + getClustersBySubscriptionExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { manager.connectedClusters().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterUpdateSamples.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterUpdateSamples.java index 3d7fbaebd27c7..0d576c84b95a4 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterUpdateSamples.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterUpdateSamples.java @@ -4,30 +4,34 @@ package com.azure.resourcemanager.hybridkubernetes.generated; +import com.azure.resourcemanager.hybridkubernetes.models.AzureHybridBenefit; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedCluster; import java.util.HashMap; import java.util.Map; -/** Samples for ConnectedCluster Update. */ +/** + * Samples for ConnectedCluster Update. + */ public final class ConnectedClusterUpdateSamples { /* - * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/UpdateClusterExample.json + * x-ms-original-file: + * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/ + * UpdateClusterExample.json */ /** * Sample code: UpdateClusterExample. - * + * * @param manager Entry point to HybridKubernetesManager. */ - public static void updateClusterExample( - com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { - ConnectedCluster resource = - manager - .connectedClusters() - .getByResourceGroupWithResponse("k8sc-rg", "testCluster", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + public static void + updateClusterExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + ConnectedCluster resource = manager.connectedClusters() + .getByResourceGroupWithResponse("k8sc-rg", "testCluster", com.azure.core.util.Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).withDistribution("AKS") + .withDistributionVersion("1.0").withAzureHybridBenefit(AzureHybridBenefit.NOT_APPLICABLE).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationsGetSamples.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationsGetSamples.java index d0d039cbb21dd..d27bbda729fd2 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationsGetSamples.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationsGetSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.hybridkubernetes.generated; -/** Samples for Operations Get. */ +/** + * Samples for Operations Get. + */ public final class OperationsGetSamples { /* - * x-ms-original-file: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/ListConnectedClusterOperationsExample.json + * x-ms-original-file: + * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-02-01-preview/examples/ + * ListConnectedClusterOperationsExample.json */ /** * Sample code: ListConnectedClusterOperationsExample. - * + * * @param manager Entry point to HybridKubernetesManager. */ public static void listConnectedClusterOperationsExample( diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterIdentityTests.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterIdentityTests.java deleted file mode 100644 index 1e963cdf22822..0000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterIdentityTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridkubernetes.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterIdentity; -import com.azure.resourcemanager.hybridkubernetes.models.ResourceIdentityType; -import org.junit.jupiter.api.Assertions; - -public final class ConnectedClusterIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectedClusterIdentity model = - BinaryData - .fromString("{\"principalId\":\"sybbejhph\",\"tenantId\":\"cmsxaobhdxbm\",\"type\":\"SystemAssigned\"}") - .toObject(ConnectedClusterIdentity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectedClusterIdentity model = new ConnectedClusterIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED); - model = BinaryData.fromObject(model).toObject(ConnectedClusterIdentity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } -} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterPatchTests.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterPatchTests.java deleted file mode 100644 index 5ccacdfce573f..0000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterPatchTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridkubernetes.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterPatch; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ConnectedClusterPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectedClusterPatch model = - BinaryData - .fromString( - "{\"tags\":{\"ownoizhw\":\"htbmuf\",\"jgkdmbpazlobcu\":\"rxybqsoq\"},\"properties\":\"datadznrbtcqq\"}") - .toObject(ConnectedClusterPatch.class); - Assertions.assertEquals("htbmuf", model.tags().get("ownoizhw")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectedClusterPatch model = - new ConnectedClusterPatch() - .withTags(mapOf("ownoizhw", "htbmuf", "jgkdmbpazlobcu", "rxybqsoq")) - .withProperties("datadznrbtcqq"); - model = BinaryData.fromObject(model).toObject(ConnectedClusterPatch.class); - Assertions.assertEquals("htbmuf", model.tags().get("ownoizhw")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClustersDeleteMockTests.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClustersDeleteMockTests.java deleted file mode 100644 index 5c057d2e08cf3..0000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClustersDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridkubernetes.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConnectedClustersDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridKubernetesManager manager = - HybridKubernetesManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.connectedClusters().delete("mjgr", "fwvuk", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/CredentialResultTests.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/CredentialResultTests.java deleted file mode 100644 index e1890dcb7ea02..0000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/CredentialResultTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridkubernetes.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridkubernetes.models.CredentialResult; - -public final class CredentialResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CredentialResult model = BinaryData.fromString("{\"name\":\"ajpsquc\"}").toObject(CredentialResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CredentialResult model = new CredentialResult(); - model = BinaryData.fromObject(model).toObject(CredentialResult.class); - } -} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ListClusterUserCredentialPropertiesTests.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ListClusterUserCredentialPropertiesTests.java deleted file mode 100644 index 5537c681c9a9e..0000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ListClusterUserCredentialPropertiesTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridkubernetes.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridkubernetes.models.AuthenticationMethod; -import com.azure.resourcemanager.hybridkubernetes.models.ListClusterUserCredentialProperties; -import org.junit.jupiter.api.Assertions; - -public final class ListClusterUserCredentialPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ListClusterUserCredentialProperties model = - BinaryData - .fromString("{\"authenticationMethod\":\"Token\",\"clientProxy\":false}") - .toObject(ListClusterUserCredentialProperties.class); - Assertions.assertEquals(AuthenticationMethod.TOKEN, model.authenticationMethod()); - Assertions.assertEquals(false, model.clientProxy()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ListClusterUserCredentialProperties model = - new ListClusterUserCredentialProperties() - .withAuthenticationMethod(AuthenticationMethod.TOKEN) - .withClientProxy(false); - model = BinaryData.fromObject(model).toObject(ListClusterUserCredentialProperties.class); - Assertions.assertEquals(AuthenticationMethod.TOKEN, model.authenticationMethod()); - Assertions.assertEquals(false, model.clientProxy()); - } -} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationDisplayTests.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationDisplayTests.java deleted file mode 100644 index 206e3e9eb35bb..0000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationDisplayTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridkubernetes.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridkubernetes.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"tijbpzvgnwzsymgl\",\"resource\":\"fcyzkohdbihanufh\",\"operation\":\"bj\",\"description\":\"a\"}") - .toObject(OperationDisplay.class); - Assertions.assertEquals("tijbpzvgnwzsymgl", model.provider()); - Assertions.assertEquals("fcyzkohdbihanufh", model.resource()); - Assertions.assertEquals("bj", model.operation()); - Assertions.assertEquals("a", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = - new OperationDisplay() - .withProvider("tijbpzvgnwzsymgl") - .withResource("fcyzkohdbihanufh") - .withOperation("bj") - .withDescription("a"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("tijbpzvgnwzsymgl", model.provider()); - Assertions.assertEquals("fcyzkohdbihanufh", model.resource()); - Assertions.assertEquals("bj", model.operation()); - Assertions.assertEquals("a", model.description()); - } -} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationInnerTests.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationInnerTests.java deleted file mode 100644 index 81773fe8738e0..0000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridkubernetes.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridkubernetes.fluent.models.OperationInner; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"uxzdxtay\",\"display\":{\"provider\":\"m\",\"resource\":\"fp\",\"operation\":\"qobmtukk\",\"description\":\"yrtih\"}}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner(); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationListTests.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationListTests.java deleted file mode 100644 index 818cd1c65e024..0000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationListTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridkubernetes.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridkubernetes.models.OperationList; -import org.junit.jupiter.api.Assertions; - -public final class OperationListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationList model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"jzyflu\",\"display\":{\"provider\":\"hmofc\",\"resource\":\"smy\",\"operation\":\"kdtmlxhekuk\",\"description\":\"txukcdmp\"}}],\"nextLink\":\"cryuan\"}") - .toObject(OperationList.class); - Assertions.assertEquals("cryuan", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationList model = new OperationList().withNextLink("cryuan"); - model = BinaryData.fromObject(model).toObject(OperationList.class); - Assertions.assertEquals("cryuan", model.nextLink()); - } -} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationsGetMockTests.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationsGetMockTests.java deleted file mode 100644 index 65e8a44f68f74..0000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationsGetMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridkubernetes.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager; -import com.azure.resourcemanager.hybridkubernetes.models.Operation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsGetMockTests { - @Test - public void testGet() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"dosyg\",\"display\":{\"provider\":\"aojakhmsbzjhcrz\",\"resource\":\"dphlxaolt\",\"operation\":\"trg\",\"description\":\"bpf\"}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridKubernetesManager manager = - HybridKubernetesManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().get(com.azure.core.util.Context.NONE); - } -}