From 9fb2a083d894f6863d3b691d6cd53f1fa088eee5 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 13 May 2025 02:13:37 +0000 Subject: [PATCH] CodeGen from PR 34074 in Azure/azure-rest-api-specs Merge 88dd673965de03f570f7c4915c95cb40e3c8d090 into 7fce9fb91eae7c0f6f0ae348bb79119772e89f5f --- .../CHANGELOG.md | 63 +- .../README.md | 10 +- .../SAMPLE.md | 508 +++---- .../pom.xml | 7 +- ...ager.java => HybridkubernetesManager.java} | 80 +- .../fluent/ConnectedClustersClient.java | 156 +- ...ementClient.java => KubernetesClient.java} | 36 +- .../fluent/OperationsClient.java | 10 +- .../fluent/models/ConnectedClusterInner.java | 6 +- .../ConnectedClusterPatchProperties.java | 2 +- .../models/ConnectedClusterProperties.java | 2 +- .../fluent/models/CredentialResultsInner.java | 4 +- .../fluent/models/OperationInner.java | 74 +- .../fluent/models/package-info.java | 6 +- .../hybridkubernetes/fluent/package-info.java | 6 +- .../implementation/ConnectedClusterImpl.java | 12 +- .../ConnectedClustersClientImpl.java | 1280 +++++++++-------- .../implementation/ConnectedClustersImpl.java | 66 +- .../implementation/CredentialResultsImpl.java | 8 +- ...lder.java => KubernetesClientBuilder.java} | 62 +- ...entImpl.java => KubernetesClientImpl.java} | 106 +- .../implementation/OperationImpl.java | 22 +- .../implementation/OperationsClientImpl.java | 167 ++- .../implementation/OperationsImpl.java | 16 +- .../implementation/ResourceManagerUtils.java | 2 +- .../models/ConnectedClusterList.java | 49 +- .../models/OperationList.java | 22 +- .../implementation/package-info.java | 6 +- .../hybridkubernetes/models/AadProfile.java | 46 +- .../hybridkubernetes/models/ActionType.java | 46 + .../hybridkubernetes/models/AgentError.java | 2 +- .../models/ArcAgentProfile.java | 2 +- .../models/ArcAgentryConfigurations.java | 2 +- .../models/AuthenticationMethod.java | 2 +- .../models/AutoUpgradeOptions.java | 2 +- .../models/AzureHybridBenefit.java | 2 +- .../models/ConnectedCluster.java | 12 +- .../models/ConnectedClusterIdentity.java | 2 +- .../models/ConnectedClusterKind.java | 2 +- .../models/ConnectedClusterPatch.java | 2 +- .../models/ConnectedClusters.java | 94 +- .../models/ConnectivityStatus.java | 2 +- .../models/CredentialResult.java | 4 +- .../models/CredentialResults.java | 2 +- .../hybridkubernetes/models/Gateway.java | 2 +- .../models/HybridConnectionConfig.java | 4 +- .../ListClusterUserCredentialProperties.java | 2 +- .../models/OidcIssuerProfile.java | 2 +- .../hybridkubernetes/models/Operation.java | 31 +- .../models/OperationDisplay.java | 81 +- .../hybridkubernetes/models/Operations.java | 10 +- .../hybridkubernetes/models/Origin.java | 57 + .../models/PrivateLinkState.java | 2 +- .../models/ProvisioningState.java | 2 +- .../models/ResourceIdentityType.java | 2 +- .../models/SecurityProfile.java | 2 +- .../SecurityProfileWorkloadIdentity.java | 2 +- .../models/SystemComponent.java | 2 +- .../hybridkubernetes/models/package-info.java | 6 +- .../hybridkubernetes/package-info.java | 6 +- .../src/main/java/module-info.java | 3 +- ...ctedClusterListByResourceGroupSamples.java | 24 - .../ConnectedClusterListSamples.java | 25 - ...nectedClustersCreateOrReplaceSamples.java} | 50 +- ...va => ConnectedClustersDeleteSamples.java} | 14 +- ...tedClustersGetByResourceGroupSamples.java} | 22 +- ...tedClustersListByResourceGroupSamples.java | 22 + ...tersListClusterUserCredentialSamples.java} | 38 +- .../ConnectedClustersListSamples.java | 23 + ...va => ConnectedClustersUpdateSamples.java} | 14 +- .../generated/OperationsGetSamples.java | 25 - .../generated/OperationsListSamples.java | 23 + .../generated/AadProfileTests.java | 33 - .../generated/AgentErrorTests.java | 23 - .../generated/ArcAgentProfileTests.java | 47 - .../ArcAgentryConfigurationsTests.java | 46 - .../ConnectedClusterIdentityTests.java | 27 - .../ConnectedClusterPatchPropertiesTests.java | 34 - .../generated/ConnectedClusterPatchTests.java | 50 - .../ConnectedClustersDeleteMockTests.java | 8 +- .../generated/CredentialResultTests.java | 21 - .../generated/GatewayTests.java | 26 - ...tClusterUserCredentialPropertiesTests.java | 31 - .../generated/OidcIssuerProfileTests.java | 28 - .../generated/OperationDisplayTests.java | 35 - .../generated/OperationInnerTests.java | 23 - .../generated/OperationListTests.java | 26 - ...ests.java => OperationsListMockTests.java} | 14 +- .../generated/SecurityProfileTests.java | 27 - .../SecurityProfileWorkloadIdentityTests.java | 25 - .../generated/SystemComponentTests.java | 31 - .../tsp-location.yaml | 4 + 92 files changed, 1960 insertions(+), 2107 deletions(-) rename sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/{HybridKubernetesManager.java => HybridkubernetesManager.java} (87%) rename sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/{HybridKubernetesManagementClient.java => KubernetesClient.java} (81%) rename sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/{HybridKubernetesManagementClientBuilder.java => KubernetesClientBuilder.java} (62%) rename sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/{HybridKubernetesManagementClientImpl.java => KubernetesClientImpl.java} (83%) rename sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/{ => implementation}/models/ConnectedClusterList.java (71%) rename sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/{ => implementation}/models/OperationList.java (84%) create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ActionType.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/Origin.java delete mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterListByResourceGroupSamples.java delete mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterListSamples.java rename sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/{ConnectedClusterCreateOrReplaceSamples.java => ConnectedClustersCreateOrReplaceSamples.java} (82%) rename sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/{ConnectedClusterDeleteSamples.java => ConnectedClustersDeleteSamples.java} (51%) rename sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/{ConnectedClusterGetByResourceGroupSamples.java => ConnectedClustersGetByResourceGroupSamples.java} (50%) create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClustersListByResourceGroupSamples.java rename sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/{ConnectedClusterListClusterUserCredentialSamples.java => ConnectedClustersListClusterUserCredentialSamples.java} (61%) create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClustersListSamples.java rename sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/{ConnectedClusterUpdateSamples.java => ConnectedClustersUpdateSamples.java} (76%) delete mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationsGetSamples.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationsListSamples.java delete mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/AadProfileTests.java delete mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/AgentErrorTests.java delete mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ArcAgentProfileTests.java delete mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ArcAgentryConfigurationsTests.java 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/ConnectedClusterPatchPropertiesTests.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/CredentialResultTests.java delete mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/GatewayTests.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/OidcIssuerProfileTests.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 rename sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/{OperationsGetMockTests.java => OperationsListMockTests.java} (66%) delete mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/SecurityProfileTests.java delete mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/SecurityProfileWorkloadIdentityTests.java delete mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/SystemComponentTests.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/tsp-location.yaml diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/CHANGELOG.md b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/CHANGELOG.md index a2eb3d3672e5..b3c6284515a3 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/CHANGELOG.md +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/CHANGELOG.md @@ -1,14 +1,69 @@ # Release History -## 1.1.0-beta.2 (Unreleased) +## 1.1.0-beta.2 (2025-05-13) -### Features Added +- Azure Resource Manager Hybridkubernetes client library for Java. This package contains Microsoft Azure SDK for Hybridkubernetes Management SDK. Azure Connected Cluster Resource Provider API for onboarding a Kubernetes Cluster to Azure Arc. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.ConnectedClusterList` was removed -### Other Changes +#### `HybridKubernetesManager$Configurable` was removed + +#### `models.OperationList` was removed + +#### `HybridKubernetesManager` was removed + +#### `models.OperationDisplay` was modified + +* `withResource(java.lang.String)` was removed +* `withDescription(java.lang.String)` was removed +* `withProvider(java.lang.String)` was removed +* `withOperation(java.lang.String)` was removed + +#### `models.Operations` was modified + +* `get()` was removed +* `get(com.azure.core.util.Context)` was removed + +#### `models.AadProfile` was modified + +* `withEnableAzureRbac(java.lang.Boolean)` was removed +* `withTenantId(java.lang.String)` was removed +* `enableAzureRbac()` was removed +* `tenantId()` was removed + +### Features Added + +* `models.ActionType` was added + +* `HybridkubernetesManager` was added + +* `HybridkubernetesManager$Configurable` was added + +* `implementation.models.ConnectedClusterList` was added + +* `implementation.models.OperationList` was added + +* `models.Origin` was added + +#### `models.Operation` was modified + +* `actionType()` was added +* `origin()` was added +* `isDataAction()` was added + +#### `models.Operations` was modified + +* `list(com.azure.core.util.Context)` was added +* `list()` was added + +#### `models.AadProfile` was modified + +* `withTenantID(java.lang.String)` was added +* `tenantID()` was added +* `withEnableAzureRBAC(java.lang.Boolean)` was added +* `enableAzureRBAC()` was added ## 1.1.0-beta.1 (2025-03-25) diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/README.md b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/README.md index 531e83ecbb35..f9f8aaa03c12 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/README.md +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/README.md @@ -1,8 +1,8 @@ -# Azure Resource Manager HybridKubernetes client library for Java +# Azure Resource Manager Hybridkubernetes client library for Java -Azure Resource Manager HybridKubernetes client library for Java. +Azure Resource Manager Hybridkubernetes client library for Java. -This package contains Microsoft Azure SDK for HybridKubernetes Management SDK. Hybrid Kubernetes Client. Package tag package-2024-12-01-preview. 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. Azure Connected Cluster Resource Provider API for onboarding a Kubernetes Cluster to Azure Arc. 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.1.0-beta.1 + 1.1.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -56,7 +56,7 @@ AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); -HybridKubernetesManager manager = HybridKubernetesManager +HybridkubernetesManager manager = HybridkubernetesManager .authenticate(credential, profile); ``` diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/SAMPLE.md b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/SAMPLE.md index 46baf0d40c62..a6d13c98ddfc 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/SAMPLE.md +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/SAMPLE.md @@ -1,20 +1,223 @@ # Code snippets and samples -## ConnectedCluster +## ConnectedClusters -- [CreateOrReplace](#connectedcluster_createorreplace) -- [Delete](#connectedcluster_delete) -- [GetByResourceGroup](#connectedcluster_getbyresourcegroup) -- [List](#connectedcluster_list) -- [ListByResourceGroup](#connectedcluster_listbyresourcegroup) -- [ListClusterUserCredential](#connectedcluster_listclusterusercredential) -- [Update](#connectedcluster_update) +- [CreateOrReplace](#connectedclusters_createorreplace) +- [Delete](#connectedclusters_delete) +- [GetByResourceGroup](#connectedclusters_getbyresourcegroup) +- [List](#connectedclusters_list) +- [ListByResourceGroup](#connectedclusters_listbyresourcegroup) +- [ListClusterUserCredential](#connectedclusters_listclusterusercredential) +- [Update](#connectedclusters_update) ## Operations -- [Get](#operations_get) -### ConnectedCluster_CreateOrReplace +- [List](#operations_list) +### ConnectedClusters_CreateOrReplace + +```java +/** + * Samples for ConnectedClusters Delete. + */ +public final class ConnectedClustersDeleteSamples { + /* + * x-ms-original-file: 2024-12-01-preview/DeleteClusterExample.json + */ + /** + * Sample code: DeleteClusterExample. + * + * @param manager Entry point to HybridkubernetesManager. + */ + public static void + deleteClusterExample(com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager) { + manager.connectedClusters().delete("k8sc-rg", "testCluster", com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectedClusters_Delete + +```java +/** + * Samples for ConnectedClusters List. + */ +public final class ConnectedClustersListSamples { + /* + * x-ms-original-file: 2024-12-01-preview/GetClustersBySubscriptionExample.json + */ + /** + * Sample code: GetClustersBySubscriptionExample. + * + * @param manager Entry point to HybridkubernetesManager. + */ + public static void + getClustersBySubscriptionExample(com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager) { + manager.connectedClusters().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectedClusters_GetByResourceGroup + +```java +/** + * Samples for ConnectedClusters ListByResourceGroup. + */ +public final class ConnectedClustersListByResourceGroupSamples { + /* + * x-ms-original-file: 2024-12-01-preview/GetClustersByResourceGroupExample.json + */ + /** + * Sample code: GetClustersExample. + * + * @param manager Entry point to HybridkubernetesManager. + */ + public static void getClustersExample(com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager) { + manager.connectedClusters().listByResourceGroup("k8sc-rg", com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectedClusters_List + +```java +import com.azure.resourcemanager.hybridkubernetes.models.AuthenticationMethod; +import com.azure.resourcemanager.hybridkubernetes.models.ListClusterUserCredentialProperties; + +/** + * Samples for ConnectedClusters ListClusterUserCredential. + */ +public final class ConnectedClustersListClusterUserCredentialSamples { + /* + * x-ms-original-file: 2024-12-01-preview/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); + } + + /* + * x-ms-original-file: 2024-12-01-preview/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); + } + + /* + * x-ms-original-file: 2024-12-01-preview/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); + } + + /* + * x-ms-original-file: 2024-12-01-preview/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); + } +} +``` + +### ConnectedClusters_ListByResourceGroup + +```java +/** + * Samples for ConnectedClusters GetByResourceGroup. + */ +public final class ConnectedClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: 2024-12-01-preview/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: 2024-12-01-preview/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); + } +} +``` + +### ConnectedClusters_ListClusterUserCredential + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2024-12-01-preview/ListConnectedClusterOperationsExample.json + */ + /** + * Sample code: ListConnectedClusterOperationsExample. + * + * @param manager Entry point to HybridkubernetesManager. + */ + public static void listConnectedClusterOperationsExample( + com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectedClusters_Update ```java import com.azure.resourcemanager.hybridkubernetes.models.AadProfile; @@ -33,21 +236,19 @@ import java.util.HashMap; import java.util.Map; /** - * Samples for ConnectedCluster CreateOrReplace. + * Samples for ConnectedClusters CreateOrReplace. */ -public final class ConnectedClusterCreateOrReplaceSamples { +public final class ConnectedClustersCreateOrReplaceSamples { /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * UpdateClusterByPutExample.json + * x-ms-original-file: 2024-12-01-preview/UpdateClusterByPutExample.json */ /** * Sample code: UpdateClusterByPutExample. * - * @param manager Entry point to HybridKubernetesManager. + * @param manager Entry point to HybridkubernetesManager. */ public static void - updateClusterByPutExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + updateClusterByPutExample(com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager) { manager.connectedClusters() .define("testCluster") .withRegion("East US") @@ -66,17 +267,15 @@ public final class ConnectedClusterCreateOrReplaceSamples { } /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * CreateCluster_KindExample.json + * x-ms-original-file: 2024-12-01-preview/CreateCluster_KindExample.json */ /** * Sample code: CreateCluster_KindExample. * - * @param manager Entry point to HybridKubernetesManager. + * @param manager Entry point to HybridkubernetesManager. */ public static void - createClusterKindExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + createClusterKindExample(com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager) { manager.connectedClusters() .define("testCluster") .withRegion("East US") @@ -88,9 +287,9 @@ public final class ConnectedClusterCreateOrReplaceSamples { .withDistribution("AKS") .withDistributionVersion("1.0") .withAzureHybridBenefit(AzureHybridBenefit.NOT_APPLICABLE) - .withAadProfile(new AadProfile().withEnableAzureRbac(true) + .withAadProfile(new AadProfile().withEnableAzureRBAC(true) .withAdminGroupObjectIDs(Arrays.asList("56f988bf-86f1-41af-91ab-2d7cd011db47")) - .withTenantId("82f988bf-86f1-41af-91ab-2d7cd011db47")) + .withTenantID("82f988bf-86f1-41af-91ab-2d7cd011db47")) .withArcAgentProfile(new ArcAgentProfile().withDesiredAgentVersion("0.1.0") .withAgentAutoUpgrade(AutoUpgradeOptions.ENABLED) .withSystemComponents(Arrays.asList( @@ -100,17 +299,15 @@ public final class ConnectedClusterCreateOrReplaceSamples { } /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * CreateClusterExample.json + * x-ms-original-file: 2024-12-01-preview/CreateClusterExample.json */ /** * Sample code: CreateClusterExample. * - * @param manager Entry point to HybridKubernetesManager. + * @param manager Entry point to HybridkubernetesManager. */ public static void - createClusterExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + createClusterExample(com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager) { manager.connectedClusters() .define("testCluster") .withRegion("East US") @@ -126,17 +323,15 @@ public final class ConnectedClusterCreateOrReplaceSamples { } /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * CreateClusterPrivateLinkExample.json + * x-ms-original-file: 2024-12-01-preview/CreateClusterPrivateLinkExample.json */ /** * Sample code: CreateClusterPrivateLinkExample. * - * @param manager Entry point to HybridKubernetesManager. + * @param manager Entry point to HybridkubernetesManager. */ public static void - createClusterPrivateLinkExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + createClusterPrivateLinkExample(com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager) { manager.connectedClusters() .define("testCluster") .withRegion("East US") @@ -155,17 +350,15 @@ public final class ConnectedClusterCreateOrReplaceSamples { } /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * CreateClusterAgentless_KindAWSExample.json + * x-ms-original-file: 2024-12-01-preview/CreateClusterAgentless_KindAWSExample.json */ /** * Sample code: CreateClusterAgentless_KindAWSExample. * - * @param manager Entry point to HybridKubernetesManager. + * @param manager Entry point to HybridkubernetesManager. */ public static void createClusterAgentlessKindAWSExample( - com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager) { manager.connectedClusters() .define("testCluster") .withRegion("East US") @@ -193,206 +386,7 @@ public final class ConnectedClusterCreateOrReplaceSamples { } ``` -### ConnectedCluster_Delete - -```java -/** - * Samples for ConnectedCluster Delete. - */ -public final class ConnectedClusterDeleteSamples { - /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * DeleteClusterExample.json - */ - /** - * Sample code: DeleteClusterExample. - * - * @param manager Entry point to HybridKubernetesManager. - */ - public static void - deleteClusterExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { - manager.connectedClusters().delete("k8sc-rg", "testCluster", com.azure.core.util.Context.NONE); - } -} -``` - -### ConnectedCluster_GetByResourceGroup - -```java -/** - * Samples for ConnectedCluster GetByResourceGroup. - */ -public final class ConnectedClusterGetByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-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-12-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); - } -} -``` - -### ConnectedCluster_List - -```java -/** - * Samples for ConnectedCluster List. - */ -public final class ConnectedClusterListSamples { - /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * GetClustersBySubscriptionExample.json - */ - /** - * Sample code: GetClustersBySubscriptionExample. - * - * @param manager Entry point to HybridKubernetesManager. - */ - public static void - getClustersBySubscriptionExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { - manager.connectedClusters().list(com.azure.core.util.Context.NONE); - } -} -``` - -### ConnectedCluster_ListByResourceGroup - -```java -/** - * Samples for ConnectedCluster ListByResourceGroup. - */ -public final class ConnectedClusterListByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * GetClustersByResourceGroupExample.json - */ - /** - * Sample code: GetClustersExample. - * - * @param manager Entry point to HybridKubernetesManager. - */ - public static void getClustersExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { - manager.connectedClusters().listByResourceGroup("k8sc-rg", com.azure.core.util.Context.NONE); - } -} -``` - -### ConnectedCluster_ListClusterUserCredential - -```java -import com.azure.resourcemanager.hybridkubernetes.models.AuthenticationMethod; -import com.azure.resourcemanager.hybridkubernetes.models.ListClusterUserCredentialProperties; - -/** - * Samples for ConnectedCluster ListClusterUserCredential. - */ -public final class ConnectedClusterListClusterUserCredentialSamples { - /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-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); - } - - /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-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); - } - - /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-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); - } - - /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-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); - } -} -``` - -### ConnectedCluster_Update +### Operations_List ```java import com.azure.resourcemanager.hybridkubernetes.models.AzureHybridBenefit; @@ -401,21 +395,19 @@ import java.util.HashMap; import java.util.Map; /** - * Samples for ConnectedCluster Update. + * Samples for ConnectedClusters Update. */ -public final class ConnectedClusterUpdateSamples { +public final class ConnectedClustersUpdateSamples { /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * UpdateClusterByPatchExample.json + * x-ms-original-file: 2024-12-01-preview/UpdateClusterByPatchExample.json */ /** * Sample code: UpdateClusterExample. * - * @param manager Entry point to HybridKubernetesManager. + * @param manager Entry point to HybridkubernetesManager. */ public static void - updateClusterExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + updateClusterExample(com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager) { ConnectedCluster resource = manager.connectedClusters() .getByResourceGroupWithResponse("k8sc-rg", "testCluster", com.azure.core.util.Context.NONE) .getValue(); @@ -441,27 +433,3 @@ public final class ConnectedClusterUpdateSamples { } ``` -### Operations_Get - -```java -/** - * Samples for Operations Get. - */ -public final class OperationsGetSamples { - /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * ListConnectedClusterOperationsExample.json - */ - /** - * Sample code: ListConnectedClusterOperationsExample. - * - * @param manager Entry point to HybridKubernetesManager. - */ - 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 057893a7ef67..003ca6742ccd 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/pom.xml +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/pom.xml @@ -1,7 +1,7 @@ 4.0.0 @@ -17,8 +17,8 @@ 1.1.0-beta.2 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-2024-12-01-preview. + 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. Azure Connected Cluster Resource Provider API for onboarding a Kubernetes Cluster to Azure Arc. https://github.com/Azure/azure-sdk-for-java @@ -46,7 +46,6 @@ 0 0 true - false 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 similarity index 87% rename from sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/HybridKubernetesManager.java rename to sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/HybridkubernetesManager.java index aab8020157ad..caed1143ff5c 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes; @@ -24,9 +24,9 @@ import com.azure.core.util.Configuration; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.hybridkubernetes.fluent.HybridKubernetesManagementClient; +import com.azure.resourcemanager.hybridkubernetes.fluent.KubernetesClient; import com.azure.resourcemanager.hybridkubernetes.implementation.ConnectedClustersImpl; -import com.azure.resourcemanager.hybridkubernetes.implementation.HybridKubernetesManagementClientBuilder; +import com.azure.resourcemanager.hybridkubernetes.implementation.KubernetesClientBuilder; import com.azure.resourcemanager.hybridkubernetes.implementation.OperationsImpl; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusters; import com.azure.resourcemanager.hybridkubernetes.models.Operations; @@ -39,20 +39,20 @@ import java.util.stream.Collectors; /** - * Entry point to HybridKubernetesManager. - * Hybrid Kubernetes Client. + * Entry point to HybridkubernetesManager. + * Azure Connected Cluster Resource Provider API for onboarding a Kubernetes Cluster to Azure Arc. */ -public final class HybridKubernetesManager { - private ConnectedClusters connectedClusters; - +public final class HybridkubernetesManager { private Operations operations; - private final HybridKubernetesManagementClient clientObject; + private ConnectedClusters connectedClusters; + + private final KubernetesClient clientObject; - private HybridKubernetesManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + 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) + this.clientObject = new KubernetesClientBuilder().pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) @@ -60,38 +60,38 @@ private HybridKubernetesManager(HttpPipeline httpPipeline, AzureProfile profile, } /** - * Creates an instance of HybridKubernetes service API entry point. + * 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. + * @return the Hybridkubernetes service API instance. */ - public static HybridKubernetesManager authenticate(TokenCredential credential, AzureProfile profile) { + public static HybridkubernetesManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); return configure().authenticate(credential, profile); } /** - * Creates an instance of HybridKubernetes service API entry point. + * 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. + * @return the Hybridkubernetes service API instance. */ - public static HybridKubernetesManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + public static HybridkubernetesManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - return new HybridKubernetesManager(httpPipeline, profile, null); + return new HybridkubernetesManager(httpPipeline, profile, null); } /** - * Gets a Configurable instance that can be used to create HybridKubernetesManager with optional configuration. + * 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(); + return new HybridkubernetesManager.Configurable(); } /** @@ -199,13 +199,13 @@ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { } /** - * Creates an instance of HybridKubernetes service API entry point. + * 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. + * @return the Hybridkubernetes service API instance. */ - public HybridKubernetesManager authenticate(TokenCredential credential, AzureProfile profile) { + public HybridkubernetesManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); @@ -258,20 +258,8 @@ public HybridKubernetesManager authenticate(TokenCredential credential, AzurePro 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() { - if (this.connectedClusters == null) { - this.connectedClusters = new ConnectedClustersImpl(clientObject.getConnectedClusters(), this); + return new HybridkubernetesManager(httpPipeline, profile, defaultPollInterval); } - return connectedClusters; } /** @@ -287,12 +275,24 @@ public Operations operations() { } /** - * Gets wrapped service client HybridKubernetesManagementClient providing direct access to the underlying - * auto-generated API implementation, based on Azure REST API. + * Gets the resource collection API of ConnectedClusters. It manages ConnectedCluster. + * + * @return Resource collection API of ConnectedClusters. + */ + public ConnectedClusters connectedClusters() { + if (this.connectedClusters == null) { + this.connectedClusters = new ConnectedClustersImpl(clientObject.getConnectedClusters(), this); + } + return connectedClusters; + } + + /** + * Gets wrapped service client KubernetesClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. * - * @return Wrapped service client HybridKubernetesManagementClient. + * @return Wrapped service client KubernetesClient. */ - public HybridKubernetesManagementClient serviceClient() { + public KubernetesClient 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 08ab800fa896..7f02bde5dcaf 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.fluent; @@ -20,6 +20,46 @@ * An instance of this class provides access to all the operations defined in ConnectedClustersClient. */ public interface ConnectedClustersClient { + /** + * Get the properties of the specified connected cluster. + * + * 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. + * @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 the properties of the specified connected cluster. + * + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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. + * + * @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. + * @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 properties of the specified connected cluster. + * + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectedClusterInner getByResourceGroup(String resourceGroupName, String clusterName); + /** * Register a new Kubernetes cluster with Azure Resource Manager. * @@ -129,40 +169,6 @@ Response updateWithResponse(String resourceGroupName, Str 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. - * - * @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. - * @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 represents a connected cluster along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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. - * - * @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. - * @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 represents a connected cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectedClusterInner getByResourceGroup(String resourceGroupName, String clusterName); - /** * Delete a connected cluster. * @@ -224,43 +230,7 @@ Response getByResourceGroupWithResponse(String resourceGr 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. - * - * @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. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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. - * - * @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. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CredentialResultsInner listClusterUserCredential(String resourceGroupName, String clusterName, - ListClusterUserCredentialProperties properties); - - /** - * Lists all connected clusters in the given ResourceGroup + * Lists all connected clusters in the given Resource Group * * API to enumerate registered connected K8s clusters under a Resource Group. * @@ -274,7 +244,7 @@ CredentialResultsInner listClusterUserCredential(String resourceGroupName, Strin PagedIterable listByResourceGroup(String resourceGroupName); /** - * Lists all connected clusters in the given ResourceGroup + * Lists all connected clusters in the given Resource Group * * API to enumerate registered connected K8s clusters under a Resource Group. * @@ -313,4 +283,44 @@ CredentialResultsInner listClusterUserCredential(String resourceGroupName, Strin */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(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. + * + * @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. + * @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 a connected cluster + * + * Gets cluster user credentials of the connected cluster with a specified resource group and name along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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. + * + * @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. + * @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 a connected cluster + * + * Gets 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); } 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/KubernetesClient.java similarity index 81% rename from sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/HybridKubernetesManagementClient.java rename to sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/KubernetesClient.java index b36583492c0e..9030b97d9aa0 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/KubernetesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.fluent; @@ -8,30 +8,30 @@ import java.time.Duration; /** - * The interface for HybridKubernetesManagementClient class. + * The interface for KubernetesClient class. */ -public interface HybridKubernetesManagementClient { +public interface KubernetesClient { /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * @@ -47,16 +47,16 @@ public interface HybridKubernetesManagementClient { Duration getDefaultPollInterval(); /** - * Gets the ConnectedClustersClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the ConnectedClustersClient object. + * @return the OperationsClient object. */ - ConnectedClustersClient getConnectedClusters(); + OperationsClient getOperations(); /** - * Gets the OperationsClient object to access its operations. + * Gets the ConnectedClustersClient object to access its operations. * - * @return the OperationsClient object. + * @return the ConnectedClustersClient object. */ - OperationsClient getOperations(); + ConnectedClustersClient getConnectedClusters(); } 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 01a77b14e388..5741fe808fb1 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.fluent; @@ -15,17 +15,17 @@ */ public interface OperationsClient { /** - * Lists all of the available API operations for Connected Cluster resource. + * List the operations for the provider. * * @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}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable get(); + PagedIterable list(); /** - * Lists all of the available API operations for Connected Cluster resource. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -34,5 +34,5 @@ public interface OperationsClient { * @return the paginated list of connected cluster API operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable get(Context context); + PagedIterable list(Context context); } 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 c8ecdc9f0747..5859b3faef1b 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.fluent.models; @@ -49,7 +49,7 @@ public final class ConnectedClusterInner extends Resource { private ConnectedClusterProperties innerProperties = new ConnectedClusterProperties(); /* - * Metadata pertaining to creation and last modification of the resource + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ private SystemData systemData; @@ -124,7 +124,7 @@ private ConnectedClusterProperties innerProperties() { } /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ 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 index e6575233c846..17062c1ff3a9 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.fluent.models; 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 74e637226ace..029bab60c9de 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.fluent.models; 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 549e65effdcb..6518d66be955 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.fluent.models; @@ -32,7 +32,7 @@ public final class CredentialResultsInner implements JsonSerializable { /* - * Operation name: {Microsoft.Kubernetes}/{resource}/{operation} + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ private String name; /* - * The object that represents the operation. + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure + * Resource Manager/control-plane operations. + */ + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. */ private OperationDisplay display; + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + private Origin origin; + + /* + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + private ActionType actionType; + /** * Creates an instance of OperationInner class. */ - public OperationInner() { + private OperationInner() { } /** - * Get the name property: Operation name: {Microsoft.Kubernetes}/{resource}/{operation}. + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". * * @return the name value. */ @@ -43,7 +66,17 @@ public String name() { } /** - * Get the display property: The object that represents the operation. + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. * * @return the display value. */ @@ -51,6 +84,26 @@ public OperationDisplay display() { return this.display; } + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + /** * Validates the instance. * @@ -68,6 +121,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); return jsonWriter.writeEndObject(); } @@ -88,8 +142,14 @@ public static OperationInner fromJson(JsonReader jsonReader) throws IOException if ("name".equals(fieldName)) { deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); } else if ("display".equals(fieldName)) { deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); } else { reader.skipChildren(); } 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 036fc43e4718..cb37ceb12f79 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 @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the inner data models for HybridKubernetesManagementClient. - * Hybrid Kubernetes Client. + * Package containing the inner data models for Hybridkubernetes. + * Azure Connected Cluster Resource Provider API for onboarding a Kubernetes Cluster to Azure Arc. */ 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 c6a3a99ae34b..e9d506a8ef3c 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 @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the service clients for HybridKubernetesManagementClient. - * Hybrid Kubernetes Client. + * Package containing the service clients for Hybridkubernetes. + * Azure Connected Cluster Resource Provider API for onboarding a Kubernetes Cluster to Azure Arc. */ 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 a6d9dda466eb..6c4f4c4437c9 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.implementation; @@ -34,7 +34,7 @@ public final class ConnectedClusterImpl implements ConnectedCluster, ConnectedCluster.Definition, ConnectedCluster.Update { private ConnectedClusterInner innerObject; - private final com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager; + private final com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager serviceManager; public String id() { return this.innerModel().id(); @@ -191,7 +191,7 @@ public ConnectedClusterInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager() { + private com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager() { return this.serviceManager; } @@ -221,7 +221,7 @@ public ConnectedCluster create(Context context) { } ConnectedClusterImpl(String name, - com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { + com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager serviceManager) { this.innerObject = new ConnectedClusterInner(); this.serviceManager = serviceManager; this.clusterName = name; @@ -249,10 +249,10 @@ public ConnectedCluster apply(Context context) { } ConnectedClusterImpl(ConnectedClusterInner innerObject, - com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { + com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourcegroups"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.clusterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "connectedClusters"); } 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 e13d14c6b4c9..bb08ff5d3f6e 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.implementation; @@ -29,14 +29,16 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.hybridkubernetes.fluent.ConnectedClustersClient; import com.azure.resourcemanager.hybridkubernetes.fluent.models.ConnectedClusterInner; import com.azure.resourcemanager.hybridkubernetes.fluent.models.CredentialResultsInner; -import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterList; +import com.azure.resourcemanager.hybridkubernetes.implementation.models.ConnectedClusterList; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterPatch; import com.azure.resourcemanager.hybridkubernetes.models.ListClusterUserCredentialProperties; import java.nio.ByteBuffer; @@ -55,79 +57,112 @@ public final class ConnectedClustersClientImpl implements ConnectedClustersClien /** * The service client containing this operation class. */ - private final HybridKubernetesManagementClientImpl client; + private final KubernetesClientImpl client; /** * Initializes an instance of ConnectedClustersClientImpl. * * @param client the instance of the service client containing this operation class. */ - ConnectedClustersClientImpl(HybridKubernetesManagementClientImpl client) { + ConnectedClustersClientImpl(KubernetesClientImpl client) { this.service = RestProxy.create(ConnectedClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for HybridKubernetesManagementClientConnectedClusters to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for KubernetesClientConnectedClusters to be used by the proxy service to + * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "HybridKubernetesMana") + @Host("{endpoint}") + @ServiceInterface(name = "KubernetesClientConn") public interface ConnectedClustersService { @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}") - @ExpectedResponses({ 200, 201 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrReplace(@HostParam("$host") String endpoint, + Mono> getByResourceGroup(@HostParam("endpoint") 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); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, + Response getByResourceGroupSync(@HostParam("endpoint") 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); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConnectedClusterInner connectedCluster, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrReplaceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConnectedClusterInner connectedCluster, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, + Mono> update(@HostParam("endpoint") 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); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConnectedClusterPatch connectedClusterPatch, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConnectedClusterPatch connectedClusterPatch, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}") + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Mono>> delete(@HostParam("endpoint") 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 }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listClusterUserCredential(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") 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); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") 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" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @@ -136,16 +171,50 @@ Mono> listByResourceGroup(@HostParam("$host") Str @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Kubernetes/connectedClusters") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Kubernetes/connectedClusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}/listClusterUserCredential") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listClusterUserCredential(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ListClusterUserCredentialProperties properties, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}/listClusterUserCredential") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listClusterUserCredentialSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ListClusterUserCredentialProperties properties, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -153,27 +222,37 @@ Mono> listByResourceGroupNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Register a new Kubernetes cluster with Azure Resource Manager. + * Get the properties of the specified connected cluster. * - * API to register a new Kubernetes cluster and create or replace a connected cluster tracked resource in Azure - * Resource Manager (ARM). + * 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 connectedCluster Parameters supplied to Create a Connected Cluster. * @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 represents a connected cluster along with {@link Response} on successful completion of {@link Mono}. + * @return the properties of the specified connected cluster. + * + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, - String clusterName, ConnectedClusterInner connectedCluster) { + 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.")); @@ -189,19 +268,99 @@ private Mono>> createOrReplaceWithResponseAsync(String if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } - if (connectedCluster == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectedCluster is required and cannot be null.")); - } else { - connectedCluster.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, clusterName, connectedCluster, 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. + * + * @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. + * @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 properties of the specified connected cluster. + * + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName) + .flatMap(res -> Mono.justOrEmpty(res.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. + * + * @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. + * @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 properties of the specified connected cluster. + * + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getByResourceGroupSync(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. + * + * @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. + * @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 properties of the specified connected cluster. + * + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectedClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); + } + /** * Register a new Kubernetes cluster with Azure Resource Manager. * @@ -211,7 +370,6 @@ private Mono>> createOrReplaceWithResponseAsync(String * @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. - * @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. @@ -219,7 +377,7 @@ private Mono>> createOrReplaceWithResponseAsync(String */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, - String clusterName, ConnectedClusterInner connectedCluster, Context context) { + String clusterName, ConnectedClusterInner connectedCluster) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -241,10 +399,13 @@ private Mono>> createOrReplaceWithResponseAsync(String } else { connectedCluster.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, clusterName, connectedCluster, accept, context); + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, connectedCluster, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -259,16 +420,40 @@ private Mono>> createOrReplaceWithResponseAsync(String * @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 {@link PollerFlux} for polling of represents a connected cluster. + * @return represents a connected cluster along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ConnectedClusterInner> beginCreateOrReplaceAsync( - String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster) { - Mono>> mono - = createOrReplaceWithResponseAsync(resourceGroupName, clusterName, connectedCluster); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ConnectedClusterInner.class, ConnectedClusterInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrReplaceWithResponse(String resourceGroupName, String clusterName, + ConnectedClusterInner connectedCluster) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (connectedCluster == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectedCluster is required and cannot be null.")); + } else { + connectedCluster.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrReplaceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, connectedCluster, + Context.NONE); } /** @@ -284,16 +469,40 @@ private PollerFlux, ConnectedClusterInner> beg * @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 {@link PollerFlux} for polling of represents a connected cluster. + * @return represents a connected cluster along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ConnectedClusterInner> beginCreateOrReplaceAsync( - String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createOrReplaceWithResponseAsync(resourceGroupName, clusterName, connectedCluster, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ConnectedClusterInner.class, ConnectedClusterInner.class, context); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrReplaceWithResponse(String resourceGroupName, String clusterName, + ConnectedClusterInner connectedCluster, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (connectedCluster == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectedCluster is required and cannot be null.")); + } else { + connectedCluster.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrReplaceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, connectedCluster, + context); } /** @@ -308,12 +517,16 @@ private PollerFlux, ConnectedClusterInner> beg * @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 {@link SyncPoller} for polling of represents a connected cluster. + * @return the {@link PollerFlux} for polling of represents a connected cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ConnectedClusterInner> - beginCreateOrReplace(String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster) { - return this.beginCreateOrReplaceAsync(resourceGroupName, clusterName, connectedCluster).getSyncPoller(); + private PollerFlux, ConnectedClusterInner> beginCreateOrReplaceAsync( + String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster) { + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, clusterName, connectedCluster); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ConnectedClusterInner.class, ConnectedClusterInner.class, + this.client.getContext()); } /** @@ -325,17 +538,17 @@ private PollerFlux, ConnectedClusterInner> beg * @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. - * @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 {@link SyncPoller} for polling of represents a connected cluster. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ConnectedClusterInner> beginCreateOrReplace( - String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster, Context context) { - return this.beginCreateOrReplaceAsync(resourceGroupName, clusterName, connectedCluster, context) - .getSyncPoller(); + public SyncPoller, ConnectedClusterInner> + beginCreateOrReplace(String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster) { + Response response = createOrReplaceWithResponse(resourceGroupName, clusterName, connectedCluster); + return this.client.getLroResult(response, + ConnectedClusterInner.class, ConnectedClusterInner.class, Context.NONE); } /** @@ -347,16 +560,19 @@ public SyncPoller, ConnectedClusterInner> begi * @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. + * @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 represents a connected cluster on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of represents a connected cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrReplaceAsync(String resourceGroupName, String clusterName, - ConnectedClusterInner connectedCluster) { - return beginCreateOrReplaceAsync(resourceGroupName, clusterName, connectedCluster).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectedClusterInner> beginCreateOrReplace( + String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster, Context context) { + Response response + = createOrReplaceWithResponse(resourceGroupName, clusterName, connectedCluster, context); + return this.client.getLroResult(response, + ConnectedClusterInner.class, ConnectedClusterInner.class, context); } /** @@ -368,7 +584,6 @@ private Mono createOrReplaceAsync(String resourceGroupNam * @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. - * @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. @@ -376,8 +591,8 @@ private Mono createOrReplaceAsync(String resourceGroupNam */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrReplaceAsync(String resourceGroupName, String clusterName, - ConnectedClusterInner connectedCluster, Context context) { - return beginCreateOrReplaceAsync(resourceGroupName, clusterName, connectedCluster, context).last() + ConnectedClusterInner connectedCluster) { + return beginCreateOrReplaceAsync(resourceGroupName, clusterName, connectedCluster).last() .flatMap(this.client::getLroFinalResultOrError); } @@ -398,7 +613,7 @@ private Mono createOrReplaceAsync(String resourceGroupNam @ServiceMethod(returns = ReturnType.SINGLE) public ConnectedClusterInner createOrReplace(String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster) { - return createOrReplaceAsync(resourceGroupName, clusterName, connectedCluster).block(); + return beginCreateOrReplace(resourceGroupName, clusterName, connectedCluster).getFinalResult(); } /** @@ -419,7 +634,7 @@ public ConnectedClusterInner createOrReplace(String resourceGroupName, String cl @ServiceMethod(returns = ReturnType.SINGLE) public ConnectedClusterInner createOrReplace(String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster, Context context) { - return createOrReplaceAsync(resourceGroupName, clusterName, connectedCluster, context).block(); + return beginCreateOrReplace(resourceGroupName, clusterName, connectedCluster, context).getFinalResult(); } /** @@ -459,9 +674,12 @@ private Mono> updateWithResponseAsync(String res } else { connectedClusterPatch.validate(); } + final String contentType = "application/json"; 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, contentType, accept, + connectedClusterPatch, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -473,54 +691,10 @@ private Mono> updateWithResponseAsync(String res * @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. - * @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 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) { - if (this.client.getEndpoint() == 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.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (connectedClusterPatch == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectedClusterPatch is required and cannot be null.")); - } else { - connectedClusterPatch.validate(); - } - 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); - } - - /** - * Updates a connected cluster. - * - * 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. - * @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 represents a connected cluster on successful completion of {@link Mono}. + * @return represents a connected cluster on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String clusterName, @@ -546,7 +720,35 @@ private Mono updateAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse(String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch, Context context) { - return updateWithResponseAsync(resourceGroupName, clusterName, connectedClusterPatch, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (connectedClusterPatch == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectedClusterPatch is required and cannot be null.")); + } else { + connectedClusterPatch.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, connectedClusterPatch, + context); } /** @@ -569,21 +771,19 @@ public ConnectedClusterInner update(String resourceGroupName, String clusterName } /** - * Get the properties of the specified connected cluster. + * Delete a connected cluster. * - * Returns the properties of the specified connected cluster, including name, identity, properties, and additional - * cluster details. + * 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. * @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 represents a connected cluster along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String clusterName) { + 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.")); @@ -601,106 +801,11 @@ private Mono> getByResourceGroupWithResponseAsyn } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + .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())); } - /** - * Get the properties of the specified connected cluster. - * - * 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. - * @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 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) { - if (this.client.getEndpoint() == 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.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - 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); - } - - /** - * Get the properties of the specified connected cluster. - * - * 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. - * @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 represents a connected cluster on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName) - .flatMap(res -> Mono.justOrEmpty(res.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. - * - * @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. - * @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 represents a connected cluster along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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. - * - * @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. - * @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 represents a connected cluster. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectedClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { - return getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); - } - /** * Delete a connected cluster. * @@ -711,30 +816,31 @@ public ConnectedClusterInner getByResourceGroup(String resourceGroupName, String * @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 {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName) { + private Response deleteWithResponse(String resourceGroupName, String clusterName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .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())); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, Context.NONE); } /** @@ -748,30 +854,31 @@ private Mono>> deleteWithResponseAsync(String resource * @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 {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, - Context context) { + private Response deleteWithResponse(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } 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.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context); } /** @@ -793,28 +900,6 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup this.client.getContext()); } - /** - * Delete a connected cluster. - * - * 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. - * @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 {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - 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); - } - /** * Delete a connected cluster. * @@ -829,7 +914,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName) { - return this.beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, clusterName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -848,7 +934,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, Context context) { - return this.beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, clusterName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -868,25 +955,6 @@ private Mono deleteAsync(String resourceGroupName, String clusterName) { return beginDeleteAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); } - /** - * Delete a connected cluster. - * - * 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. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName, Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Delete a connected cluster. * @@ -900,7 +968,7 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Con */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String clusterName) { - deleteAsync(resourceGroupName, clusterName).block(); + beginDelete(resourceGroupName, clusterName).getFinalResult(); } /** @@ -917,162 +985,11 @@ public void delete(String resourceGroupName, String clusterName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String clusterName, Context context) { - deleteAsync(resourceGroupName, clusterName, 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. - * - * @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. - * @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 cluster user credentials of the connected cluster with a specified resource group and name along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - 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)) - .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. - * - * @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. - * @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 cluster user credentials of the connected cluster with a specified resource group and name along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - 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); - } - - /** - * Gets cluster user credentials of a connected cluster - * - * 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. - * @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 cluster user credentials of the connected cluster with a specified resource group and name on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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. - * - * @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. - * @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 cluster user credentials of the connected cluster with a specified resource group and name along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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. - * - * @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. - * @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 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) { - return listClusterUserCredentialWithResponse(resourceGroupName, clusterName, properties, Context.NONE) - .getValue(); + beginDelete(resourceGroupName, clusterName, context).getFinalResult(); } /** - * Lists all connected clusters in the given ResourceGroup + * Lists all connected clusters in the given Resource Group * * API to enumerate registered connected K8s clusters under a Resource Group. * @@ -1107,44 +1024,24 @@ private Mono> listByResourceGroupSinglePage } /** - * Lists all connected clusters in the given ResourceGroup + * Lists all connected clusters in the given 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}. + * @return the paginated list of connected Clusters as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - 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)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Lists all connected clusters in the given ResourceGroup + * Lists all connected clusters in the given Resource Group * * API to enumerate registered connected K8s clusters under a Resource Group. * @@ -1152,16 +1049,33 @@ private Mono> listByResourceGroupSinglePage * @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 as paginated response with {@link PagedFlux}. + * @return the paginated list of connected Clusters along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Lists all connected clusters in the given ResourceGroup + * Lists all connected clusters in the given Resource Group * * API to enumerate registered connected K8s clusters under a Resource Group. * @@ -1170,16 +1084,34 @@ private PagedFlux listByResourceGroupAsync(String resourc * @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 as paginated response with {@link PagedFlux}. + * @return the paginated list of connected Clusters along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Lists all connected clusters in the given ResourceGroup + * Lists all connected clusters in the given Resource Group * * API to enumerate registered connected K8s clusters under a Resource Group. * @@ -1191,11 +1123,12 @@ private PagedFlux listByResourceGroupAsync(String resourc */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** - * Lists all connected clusters in the given ResourceGroup + * Lists all connected clusters in the given Resource Group * * API to enumerate registered connected K8s clusters under a Resource Group. * @@ -1208,7 +1141,8 @@ public PagedIterable listByResourceGroup(String resourceG */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** @@ -1233,8 +1167,8 @@ private Mono> listSinglePageAsync() { } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), 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())); @@ -1245,30 +1179,14 @@ private Mono> listSinglePageAsync() { * * 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}. + * @return the paginated list of connected Clusters as paginated response with {@link PagedFlux}. */ - @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.")); - } - if (this.client.getSubscriptionId() == 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, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** @@ -1278,12 +1196,25 @@ private Mono> listSinglePageAsync(Context c * * @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}. + * @return the paginated list of connected Clusters along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1295,12 +1226,25 @@ private PagedFlux listAsync() { * @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 as paginated response with {@link PagedFlux}. + * @return the paginated list of connected Clusters along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1314,7 +1258,7 @@ private PagedFlux listAsync(Context context) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); } /** @@ -1330,10 +1274,156 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + } + + /** + * Gets cluster user credentials of a connected cluster + * + * 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. + * @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 cluster user credentials of a connected cluster + * + * Gets cluster user credentials of the connected cluster with a specified resource group and name along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listClusterUserCredential(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, clusterName, + contentType, accept, properties, 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. + * + * @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. + * @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 cluster user credentials of a connected cluster + * + * Gets cluster user credentials of the connected cluster with a specified resource group and name on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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. + * + * @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. + * @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 cluster user credentials of a connected cluster + * + * Gets cluster user credentials of the connected cluster with a specified resource group and name along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listClusterUserCredentialWithResponse(String resourceGroupName, + String clusterName, ListClusterUserCredentialProperties properties, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (properties == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.listClusterUserCredentialSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, properties, context); + } + + /** + * Gets cluster user credentials of a connected cluster + * + * 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. + * @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 cluster user credentials of a connected cluster + * + * Gets 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) { + return listClusterUserCredentialWithResponse(resourceGroupName, clusterName, properties, Context.NONE) + .getValue(); } /** + * Lists all connected clusters in the given Resource Group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1362,6 +1452,37 @@ private Mono> listByResourceGroupNextSingle } /** + * Lists all connected clusters in the given Resource Group + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all connected clusters in the given Resource Group + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1369,27 +1490,29 @@ private Mono> listByResourceGroupNextSingle * @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}. + * @return the paginated list of connected Clusters along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** + * Lists all connected clusters in the given Subscription + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1418,6 +1541,37 @@ private Mono> listBySubscriptionNextSingleP } /** + * Lists all connected clusters in the given Subscription + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all connected clusters in the given Subscription + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1425,23 +1579,25 @@ private Mono> listBySubscriptionNextSingleP * @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}. + * @return the paginated list of connected Clusters along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectedClustersClientImpl.class); } 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 8856476e70b9..07a72d483b3b 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.implementation; @@ -22,10 +22,10 @@ public final class ConnectedClustersImpl implements ConnectedClusters { private final ConnectedClustersClient innerClient; - private final com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager; + private final com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager serviceManager; public ConnectedClustersImpl(ConnectedClustersClient innerClient, - com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { + com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -59,6 +59,27 @@ public void delete(String resourceGroupName, String clusterName, Context context this.serviceClient().delete(resourceGroupName, clusterName, context); } + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + 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 ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectedClusterImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectedClusterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectedClusterImpl(inner1, this.manager())); + } + public Response listClusterUserCredentialWithResponse(String resourceGroupName, String clusterName, ListClusterUserCredentialProperties properties, Context context) { Response inner = this.serviceClient() @@ -82,32 +103,11 @@ public CredentialResults listClusterUserCredential(String resourceGroupName, Str } } - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - 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 ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectedClusterImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectedClusterImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectedClusterImpl(inner1, this.manager())); - } - public ConnectedCluster getById(String id) { - String resourceGroupName = ResourceManagerUtils.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))); + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "connectedClusters"); if (clusterName == null) { @@ -118,10 +118,10 @@ public ConnectedCluster getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.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))); + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "connectedClusters"); if (clusterName == null) { @@ -132,10 +132,10 @@ public Response getByIdWithResponse(String id, Context context } public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.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))); + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "connectedClusters"); if (clusterName == null) { @@ -146,10 +146,10 @@ public void deleteById(String id) { } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.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))); + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "connectedClusters"); if (clusterName == null) { @@ -163,7 +163,7 @@ private ConnectedClustersClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager() { + private com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager() { return this.serviceManager; } 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 007ea1c534d7..3adfdef2e253 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.implementation; @@ -14,10 +14,10 @@ public final class CredentialResultsImpl implements CredentialResults { private CredentialResultsInner innerObject; - private final com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager; + private final com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager serviceManager; CredentialResultsImpl(CredentialResultsInner innerObject, - com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { + com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -39,7 +39,7 @@ public CredentialResultsInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager() { + private com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager() { return this.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/KubernetesClientBuilder.java similarity index 62% rename from sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientBuilder.java rename to sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/KubernetesClientBuilder.java index 896e18376905..d16ff87cf6e7 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/KubernetesClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.implementation; @@ -15,39 +15,39 @@ import java.time.Duration; /** - * A builder for creating a new instance of the HybridKubernetesManagementClientImpl type. + * A builder for creating a new instance of the KubernetesClientImpl type. */ -@ServiceClientBuilder(serviceClients = { HybridKubernetesManagementClientImpl.class }) -public final class HybridKubernetesManagementClientBuilder { +@ServiceClientBuilder(serviceClients = { KubernetesClientImpl.class }) +public final class KubernetesClientBuilder { /* - * The ID of the target subscription. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The ID of the target subscription. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. - * @return the HybridKubernetesManagementClientBuilder. + * @param endpoint the endpoint value. + * @return the KubernetesClientBuilder. */ - public HybridKubernetesManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public KubernetesClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. - * @return the HybridKubernetesManagementClientBuilder. + * @param subscriptionId the subscriptionId value. + * @return the KubernetesClientBuilder. */ - public HybridKubernetesManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public KubernetesClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -60,9 +60,9 @@ public HybridKubernetesManagementClientBuilder endpoint(String endpoint) { * Sets The environment to connect to. * * @param environment the environment value. - * @return the HybridKubernetesManagementClientBuilder. + * @return the KubernetesClientBuilder. */ - public HybridKubernetesManagementClientBuilder environment(AzureEnvironment environment) { + public KubernetesClientBuilder environment(AzureEnvironment environment) { this.environment = environment; return this; } @@ -76,9 +76,9 @@ public HybridKubernetesManagementClientBuilder environment(AzureEnvironment envi * Sets The HTTP pipeline to send requests through. * * @param pipeline the pipeline value. - * @return the HybridKubernetesManagementClientBuilder. + * @return the KubernetesClientBuilder. */ - public HybridKubernetesManagementClientBuilder pipeline(HttpPipeline pipeline) { + public KubernetesClientBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; } @@ -92,9 +92,9 @@ public HybridKubernetesManagementClientBuilder pipeline(HttpPipeline pipeline) { * Sets The default poll interval for long-running operation. * * @param defaultPollInterval the defaultPollInterval value. - * @return the HybridKubernetesManagementClientBuilder. + * @return the KubernetesClientBuilder. */ - public HybridKubernetesManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + public KubernetesClientBuilder defaultPollInterval(Duration defaultPollInterval) { this.defaultPollInterval = defaultPollInterval; return this; } @@ -108,19 +108,19 @@ public HybridKubernetesManagementClientBuilder defaultPollInterval(Duration defa * Sets The serializer to serialize an object into a string. * * @param serializerAdapter the serializerAdapter value. - * @return the HybridKubernetesManagementClientBuilder. + * @return the KubernetesClientBuilder. */ - public HybridKubernetesManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + public KubernetesClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; } /** - * Builds an instance of HybridKubernetesManagementClientImpl with the provided parameters. + * Builds an instance of KubernetesClientImpl with the provided parameters. * - * @return an instance of HybridKubernetesManagementClientImpl. + * @return an instance of KubernetesClientImpl. */ - public HybridKubernetesManagementClientImpl buildClient() { + public KubernetesClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) @@ -131,8 +131,8 @@ public HybridKubernetesManagementClientImpl buildClient() { SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); - HybridKubernetesManagementClientImpl client = new HybridKubernetesManagementClientImpl(localPipeline, - localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + KubernetesClientImpl client = new KubernetesClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); 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/KubernetesClientImpl.java similarity index 83% rename from sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientImpl.java rename to sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/KubernetesClientImpl.java index 334b69f7b7be..aa2b465ba9be 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/KubernetesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.implementation; @@ -15,16 +15,19 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.hybridkubernetes.fluent.ConnectedClustersClient; -import com.azure.resourcemanager.hybridkubernetes.fluent.HybridKubernetesManagementClient; +import com.azure.resourcemanager.hybridkubernetes.fluent.KubernetesClient; import com.azure.resourcemanager.hybridkubernetes.fluent.OperationsClient; import java.io.IOException; import java.lang.reflect.Type; @@ -36,31 +39,17 @@ import reactor.core.publisher.Mono; /** - * Initializes a new instance of the HybridKubernetesManagementClientImpl type. + * Initializes a new instance of the KubernetesClientImpl type. */ -@ServiceClient(builder = HybridKubernetesManagementClientBuilder.class) -public final class HybridKubernetesManagementClientImpl implements HybridKubernetesManagementClient { +@ServiceClient(builder = KubernetesClientBuilder.class) +public final class KubernetesClientImpl implements KubernetesClient { /** - * 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. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -69,12 +58,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -82,6 +71,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -125,53 +128,53 @@ public Duration getDefaultPollInterval() { } /** - * The ConnectedClustersClient object to access its operations. + * The OperationsClient object to access its operations. */ - private final ConnectedClustersClient connectedClusters; + private final OperationsClient operations; /** - * Gets the ConnectedClustersClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the ConnectedClustersClient object. + * @return the OperationsClient object. */ - public ConnectedClustersClient getConnectedClusters() { - return this.connectedClusters; + public OperationsClient getOperations() { + return this.operations; } /** - * The OperationsClient object to access its operations. + * The ConnectedClustersClient object to access its operations. */ - private final OperationsClient operations; + private final ConnectedClustersClient connectedClusters; /** - * Gets the OperationsClient object to access its operations. + * Gets the ConnectedClustersClient object to access its operations. * - * @return the OperationsClient object. + * @return the ConnectedClustersClient object. */ - public OperationsClient getOperations() { - return this.operations; + public ConnectedClustersClient getConnectedClusters() { + return this.connectedClusters; } /** - * Initializes an instance of HybridKubernetesManagementClient client. + * Initializes an instance of KubernetesClient 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. * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. - * @param endpoint server parameter. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ - HybridKubernetesManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + KubernetesClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, + AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.subscriptionId = subscriptionId; this.apiVersion = "2024-12-01-preview"; - this.connectedClusters = new ConnectedClustersClientImpl(this); this.operations = new OperationsClientImpl(this); + this.connectedClusters = new ConnectedClustersClientImpl(this); } /** @@ -211,6 +214,23 @@ public PollerFlux, U> getLroResult(Mono type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + /** * Gets the final result, or an error, based on last async poll response. * @@ -300,5 +320,5 @@ public Mono getBodyAsString(Charset charset) { } } - private static final ClientLogger LOGGER = new ClientLogger(HybridKubernetesManagementClientImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(KubernetesClientImpl.class); } 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 d66f1b874eba..86bac55cb0c3 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 @@ -1,20 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.implementation; import com.azure.resourcemanager.hybridkubernetes.fluent.models.OperationInner; +import com.azure.resourcemanager.hybridkubernetes.models.ActionType; import com.azure.resourcemanager.hybridkubernetes.models.Operation; import com.azure.resourcemanager.hybridkubernetes.models.OperationDisplay; +import com.azure.resourcemanager.hybridkubernetes.models.Origin; public final class OperationImpl implements Operation { private OperationInner innerObject; - private final com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager; + private final com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager serviceManager; OperationImpl(OperationInner innerObject, - com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { + com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -23,15 +25,27 @@ public String name() { return this.innerModel().name(); } + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + public OperationDisplay display() { return this.innerModel().display(); } + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + public OperationInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager() { + private com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager() { return this.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 76bc543b3611..4dc91407b5bf 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.implementation; @@ -25,9 +25,10 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hybridkubernetes.fluent.OperationsClient; import com.azure.resourcemanager.hybridkubernetes.fluent.models.OperationInner; -import com.azure.resourcemanager.hybridkubernetes.models.OperationList; +import com.azure.resourcemanager.hybridkubernetes.implementation.models.OperationList; import reactor.core.publisher.Mono; /** @@ -42,43 +43,57 @@ public final class OperationsClientImpl implements OperationsClient { /** * The service client containing this operation class. */ - private final HybridKubernetesManagementClientImpl client; + private final KubernetesClientImpl client; /** * Initializes an instance of OperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - OperationsClientImpl(HybridKubernetesManagementClientImpl client) { + OperationsClientImpl(KubernetesClientImpl client) { this.service = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for HybridKubernetesManagementClientOperations to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for KubernetesClientOperations to be used by the proxy service to perform + * REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "HybridKubernetesMana") + @Host("{endpoint}") + @ServiceInterface(name = "KubernetesClientOper") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Kubernetes/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Kubernetes/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @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> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists all of the available API operations for Connected Cluster resource. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -86,7 +101,7 @@ Mono> getNext(@PathParam(value = "nextLink", encoded = t * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSinglePageAsync() { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -94,76 +109,82 @@ private Mono> getSinglePageAsync() { final String accept = "application/json"; return FluxUtil .withContext( - context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + context -> service.list(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)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all of the available API operations for Connected Cluster resource. + * List the operations for the provider. * - * @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}. + * @return the paginated list of connected cluster API operations as paginated response with {@link PagedFlux}. */ - @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.")); - } - 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)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Lists all of the available API operations for Connected Cluster resource. + * List the operations for the provider. * * @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}. + * @return the paginated list of connected cluster API operations along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux getAsync() { - return new PagedFlux<>(() -> getSinglePageAsync(), nextLink -> getNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return 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. + * List the operations for the provider. * * @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 as paginated response with {@link PagedFlux}. + * @return the paginated list of connected cluster API operations along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux getAsync(Context context) { - return new PagedFlux<>(() -> getSinglePageAsync(context), - nextLink -> getNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return 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. + * List the operations for the provider. * * @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}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable get() { - return new PagedIterable<>(getAsync()); + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** - * Lists all of the available API operations for Connected Cluster resource. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -172,8 +193,8 @@ public PagedIterable get() { * @return the paginated list of connected cluster API operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable get(Context context) { - return new PagedIterable<>(getAsync(context)); + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -187,7 +208,7 @@ public PagedIterable get(Context context) { * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -196,12 +217,38 @@ private Mono> getNextSinglePageAsync(String nextLi 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)) + return FluxUtil.withContext(context -> service.listNext(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. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -210,22 +257,24 @@ private Mono> getNextSinglePageAsync(String nextLi * @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}. + * @return the paginated list of connected cluster API operations along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(OperationsClientImpl.class); } 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 90cfd63b3285..da15eef1b0f1 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.implementation; @@ -17,21 +17,21 @@ public final class OperationsImpl implements Operations { private final OperationsClient innerClient; - private final com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager; + private final com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager serviceManager; public OperationsImpl(OperationsClient innerClient, - com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { + com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public PagedIterable get() { - PagedIterable inner = this.serviceClient().get(); + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } - public PagedIterable get(Context context) { - PagedIterable inner = this.serviceClient().get(context); + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } @@ -39,7 +39,7 @@ private OperationsClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager() { + private com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager() { return this.serviceManager; } } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ResourceManagerUtils.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ResourceManagerUtils.java index 7e4c741553f0..5ef3bb575a10 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ResourceManagerUtils.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ResourceManagerUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.implementation; 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/implementation/models/ConnectedClusterList.java similarity index 71% rename from sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterList.java rename to sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/models/ConnectedClusterList.java index d2813dde03cb..172d608395bf 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/implementation/models/ConnectedClusterList.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.hybridkubernetes.models; +package com.azure.resourcemanager.hybridkubernetes.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +17,26 @@ /** * The paginated list of connected Clusters. */ -@Fluent +@Immutable public final class ConnectedClusterList implements JsonSerializable { /* - * The list of connected clusters + * The ConnectedCluster items on this page */ private List value; /* - * The link to fetch the next page of connected clusters + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ConnectedClusterList class. */ - public ConnectedClusterList() { + private ConnectedClusterList() { } /** - * Get the value property: The list of connected clusters. + * Get the value property: The ConnectedCluster items on this page. * * @return the value value. */ @@ -44,18 +45,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. - */ - public ConnectedClusterList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link to fetch the next page of connected clusters. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +53,22 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to fetch the next page of connected clusters. - * - * @param nextLink the nextLink value to set. - * @return the ConnectedClusterList object itself. - */ - public ConnectedClusterList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ConnectedClusterList")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(ConnectedClusterList.class); + /** * {@inheritDoc} */ @@ -102,6 +86,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ConnectedClusterList if the JsonReader was pointing to an instance of it, or null if it * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the ConnectedClusterList. */ public static ConnectedClusterList fromJson(JsonReader jsonReader) throws IOException { 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/implementation/models/OperationList.java similarity index 84% rename from sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/OperationList.java rename to sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/models/OperationList.java index 4577d88e1cb3..6da8b4ef40ad 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/implementation/models/OperationList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.hybridkubernetes.models; +package com.azure.resourcemanager.hybridkubernetes.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The paginated list of connected cluster API operations. */ -@Fluent +@Immutable public final class OperationList implements JsonSerializable { /* * The list of connected cluster API operations. @@ -31,7 +31,7 @@ public final class OperationList implements JsonSerializable { /** * Creates an instance of OperationList class. */ - public OperationList() { + private OperationList() { } /** @@ -52,17 +52,6 @@ public String nextLink() { return this.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. - */ - public OperationList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * @@ -90,6 +79,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of OperationList if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the OperationList. */ public static OperationList fromJson(JsonReader jsonReader) throws IOException { 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 1ee13719d528..6d5e87885f21 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 @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for HybridKubernetesManagementClient. - * Hybrid Kubernetes Client. + * Package containing the implementations for Hybridkubernetes. + * Azure Connected Cluster Resource Provider API for onboarding a Kubernetes Cluster to Azure Arc. */ 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 index 13d9b6d44be6..3f4bf64eed1a 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.models; @@ -20,7 +20,7 @@ public final class AadProfile implements JsonSerializable { /* * Whether to enable Azure RBAC for Kubernetes authorization. */ - private Boolean enableAzureRbac; + private Boolean enableAzureRBAC; /* * The list of AAD group object IDs that will have admin role of the cluster. @@ -31,7 +31,7 @@ public final class AadProfile implements JsonSerializable { * The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment * subscription. */ - private String tenantId; + private String tenantID; /** * Creates an instance of AadProfile class. @@ -40,22 +40,22 @@ public AadProfile() { } /** - * Get the enableAzureRbac property: Whether to enable Azure RBAC for Kubernetes authorization. + * Get the enableAzureRBAC property: Whether to enable Azure RBAC for Kubernetes authorization. * - * @return the enableAzureRbac value. + * @return the enableAzureRBAC value. */ - public Boolean enableAzureRbac() { - return this.enableAzureRbac; + public Boolean enableAzureRBAC() { + return this.enableAzureRBAC; } /** - * Set the enableAzureRbac property: Whether to enable Azure RBAC for Kubernetes authorization. + * Set the enableAzureRBAC property: Whether to enable Azure RBAC for Kubernetes authorization. * - * @param enableAzureRbac the enableAzureRbac value to set. + * @param enableAzureRBAC the enableAzureRBAC value to set. * @return the AadProfile object itself. */ - public AadProfile withEnableAzureRbac(Boolean enableAzureRbac) { - this.enableAzureRbac = enableAzureRbac; + public AadProfile withEnableAzureRBAC(Boolean enableAzureRBAC) { + this.enableAzureRBAC = enableAzureRBAC; return this; } @@ -80,24 +80,24 @@ public AadProfile withAdminGroupObjectIDs(List adminGroupObjectIDs) { } /** - * Get the tenantId property: The AAD tenant ID to use for authentication. If not specified, will use the tenant of + * 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. + * @return the tenantID value. */ - public String tenantId() { - return this.tenantId; + 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 + * 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. + * @param tenantID the tenantID value to set. * @return the AadProfile object itself. */ - public AadProfile withTenantId(String tenantId) { - this.tenantId = tenantId; + public AadProfile withTenantID(String tenantID) { + this.tenantID = tenantID; return this; } @@ -115,10 +115,10 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enableAzureRBAC", this.enableAzureRbac); + jsonWriter.writeBooleanField("enableAzureRBAC", this.enableAzureRBAC); jsonWriter.writeArrayField("adminGroupObjectIDs", this.adminGroupObjectIDs, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("tenantID", this.tenantId); + jsonWriter.writeStringField("tenantID", this.tenantID); return jsonWriter.writeEndObject(); } @@ -138,12 +138,12 @@ public static AadProfile fromJson(JsonReader jsonReader) throws IOException { reader.nextToken(); if ("enableAzureRBAC".equals(fieldName)) { - deserializedAadProfile.enableAzureRbac = reader.getNullable(JsonReader::getBoolean); + deserializedAadProfile.enableAzureRBAC = reader.getNullable(JsonReader::getBoolean); } else if ("adminGroupObjectIDs".equals(fieldName)) { List adminGroupObjectIDs = reader.readArray(reader1 -> reader1.getString()); deserializedAadProfile.adminGroupObjectIDs = adminGroupObjectIDs; } else if ("tenantID".equals(fieldName)) { - deserializedAadProfile.tenantId = reader.getString(); + deserializedAadProfile.tenantID = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ActionType.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ActionType.java new file mode 100644 index 000000000000..e41164b957b5 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ActionType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Actions are for internal-only APIs. + */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} 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 index bc9fff440971..1ea951b09686 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.models; 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 index 3f04a4baa00e..3eadacb15b57 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.models; diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ArcAgentryConfigurations.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ArcAgentryConfigurations.java index 2be04acd8277..dc140fe19e67 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ArcAgentryConfigurations.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ArcAgentryConfigurations.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.models; 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 638312c62625..fba4e32a9125 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.models; 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 index 9259c521095d..36ce6bf59933 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.models; 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 index 5b566963937d..32492e4a2a37 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.models; 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 36a605be02d9..074cb2023039 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.models; @@ -67,7 +67,7 @@ public interface ConnectedCluster { ConnectedClusterKind kind(); /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -693,7 +693,9 @@ interface WithAzureHybridBenefit { * @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 + * @return cluster user credentials of a connected cluster + * + * Gets cluster user credentials of the connected cluster with a specified resource group and name along with * {@link Response}. */ Response listClusterUserCredentialWithResponse(ListClusterUserCredentialProperties properties, @@ -708,7 +710,9 @@ Response listClusterUserCredentialWithResponse(ListClusterUse * @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. + * @return cluster user credentials of a connected cluster + * + * Gets cluster user credentials of the connected cluster with a specified resource group and name. */ CredentialResults listClusterUserCredential(ListClusterUserCredentialProperties properties); } 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 2ac15eb67520..0a7ffcc03f87 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.models; 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 index 80845bba1cc5..6711f5e2ac69 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.models; 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 144fa0d78c34..f8652a236c87 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.models; 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 5773cc7e80cb..cf9f82f6c0a5 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.models; @@ -24,7 +24,10 @@ public interface ConnectedClusters { * @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 represents a connected cluster along with {@link Response}. + * @return the properties of the specified connected cluster. + * + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details along with {@link Response}. */ Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context); @@ -40,7 +43,10 @@ Response getByResourceGroupWithResponse(String resourceGroupNa * @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 represents a connected cluster. + * @return the properties of the specified connected cluster. + * + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. */ ConnectedCluster getByResourceGroup(String resourceGroupName, String clusterName); @@ -72,89 +78,93 @@ Response getByResourceGroupWithResponse(String resourceGroupNa void delete(String resourceGroupName, String clusterName, Context context); /** - * Gets cluster user credentials of a connected cluster + * Lists all connected clusters in the given Resource Group * - * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * 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 clusterName The name of the Kubernetes cluster on which get is called. - * @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}. + * @return the paginated list of connected Clusters as paginated response with {@link PagedIterable}. */ - Response listClusterUserCredentialWithResponse(String resourceGroupName, String clusterName, - ListClusterUserCredentialProperties properties, Context context); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Gets cluster user credentials of a connected cluster + * Lists all connected clusters in the given Resource Group * - * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * 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 clusterName The name of the Kubernetes cluster on which get is called. - * @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. + * @return the paginated list of connected Clusters as paginated response with {@link PagedIterable}. */ - CredentialResults listClusterUserCredential(String resourceGroupName, String clusterName, - ListClusterUserCredentialProperties properties); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Lists all connected clusters in the given ResourceGroup + * Lists all connected clusters in the given Subscription * - * API to enumerate registered connected K8s clusters under a Resource Group. + * API to enumerate registered connected K8s clusters under a Subscription. * - * @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. * @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}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + PagedIterable list(); /** - * Lists all connected clusters in the given ResourceGroup + * Lists all connected clusters in the given Subscription * - * API to enumerate registered connected K8s clusters under a Resource Group. + * API to enumerate registered connected K8s clusters under a Subscription. * - * @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 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}. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + PagedIterable list(Context context); /** - * Lists all connected clusters in the given Subscription + * Gets cluster user credentials of a connected cluster * - * API to enumerate registered connected K8s clusters under a Subscription. + * 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. + * @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 the paginated list of connected Clusters as paginated response with {@link PagedIterable}. + * @return cluster user credentials of a connected cluster + * + * Gets cluster user credentials of the connected cluster with a specified resource group and name along with + * {@link Response}. */ - PagedIterable list(); + Response listClusterUserCredentialWithResponse(String resourceGroupName, String clusterName, + ListClusterUserCredentialProperties properties, Context context); /** - * Lists all connected clusters in the given Subscription + * Gets cluster user credentials of a connected cluster * - * API to enumerate registered connected K8s clusters under a Subscription. + * Gets cluster user credentials of the connected cluster with a specified resource group and name. * - * @param context The context to associate with this operation. + * @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. * @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 the paginated list of connected Clusters as paginated response with {@link PagedIterable}. + * @return cluster user credentials of a connected cluster + * + * Gets cluster user credentials of the connected cluster with a specified resource group and name. */ - PagedIterable list(Context context); + CredentialResults listClusterUserCredential(String resourceGroupName, String clusterName, + ListClusterUserCredentialProperties properties); /** * Get the properties of the specified connected cluster. @@ -166,7 +176,10 @@ CredentialResults listClusterUserCredential(String resourceGroupName, String clu * @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 represents a connected cluster along with {@link Response}. + * @return the properties of the specified connected cluster. + * + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details along with {@link Response}. */ ConnectedCluster getById(String id); @@ -181,7 +194,10 @@ CredentialResults listClusterUserCredential(String resourceGroupName, String clu * @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 represents a connected cluster along with {@link Response}. + * @return the properties of the specified connected cluster. + * + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); 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 46f41ab80a65..423b63f8a0e6 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.models; 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 d43af5af3473..0a2ef8ad0fd8 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.models; @@ -30,7 +30,7 @@ public final class CredentialResult implements JsonSerializable { /* - * Service provider: Microsoft.Kubernetes + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". */ private String provider; /* - * Connected Cluster Resource on which the operation is performed + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". */ private String resource; /* - * Operation type: Read, write, delete, etc. + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". */ private String operation; /* - * Description of the operation. + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ private String description; /** * Creates an instance of OperationDisplay class. */ - public OperationDisplay() { + private OperationDisplay() { } /** - * Get the provider property: Service provider: Microsoft.Kubernetes. + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". * * @return the provider value. */ @@ -52,18 +56,8 @@ public String provider() { } /** - * Set the provider property: Service provider: Microsoft.Kubernetes. - * - * @param provider the provider value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: Connected Cluster Resource on which the operation is performed. + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". * * @return the resource value. */ @@ -72,18 +66,8 @@ 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. - */ - public OperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: Operation type: Read, write, delete, etc. + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". * * @return the operation value. */ @@ -92,18 +76,8 @@ 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. - */ - public OperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: Description of the operation. + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. * * @return the description value. */ @@ -111,17 +85,6 @@ public String description() { return this.description; } - /** - * Set the description property: Description of the operation. - * - * @param description the description value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withDescription(String description) { - this.description = description; - return this; - } - /** * Validates the instance. * @@ -136,10 +99,6 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("provider", this.provider); - jsonWriter.writeStringField("resource", this.resource); - jsonWriter.writeStringField("operation", this.operation); - jsonWriter.writeStringField("description", this.description); return jsonWriter.writeEndObject(); } 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 9f82be81e931..1b2c55fa60f6 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.models; @@ -12,16 +12,16 @@ */ public interface Operations { /** - * Lists all of the available API operations for Connected Cluster resource. + * List the operations for the provider. * * @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}. */ - PagedIterable get(); + PagedIterable list(); /** - * Lists all of the available API operations for Connected Cluster resource. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -29,5 +29,5 @@ public interface Operations { * @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}. */ - PagedIterable get(Context context); + PagedIterable list(Context context); } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/Origin.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/Origin.java new file mode 100644 index 000000000000..6c328372e457 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/Origin.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Indicates the operation is initiated by a user. + */ + public static final Origin USER = fromString("user"); + + /** + * Indicates the operation is initiated by a system. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Indicates the operation is initiated by a user or system. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} 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 index b70110a5ccbf..afe4db660309 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.models; 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 05feecac0036..95ad750204ea 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.models; 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 ab17b11aa367..4ad8e082ab92 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.models; diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/SecurityProfile.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/SecurityProfile.java index f7379fe7ec2a..e17785c8af64 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/SecurityProfile.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/SecurityProfile.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.models; diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/SecurityProfileWorkloadIdentity.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/SecurityProfileWorkloadIdentity.java index 5039e89326aa..0d94951d4796 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/SecurityProfileWorkloadIdentity.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/SecurityProfileWorkloadIdentity.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.models; 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 index 13fe7d714c07..c2c4a1a714c5 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.models; 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 18ba51c7c242..91b3545f7227 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 @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for HybridKubernetesManagementClient. - * Hybrid Kubernetes Client. + * Package containing the data models for Hybridkubernetes. + * Azure Connected Cluster Resource Provider API for onboarding a Kubernetes Cluster to Azure Arc. */ 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 524f2b65cfe3..557db20c7ddd 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 @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for HybridKubernetesManagementClient. - * Hybrid Kubernetes Client. + * Package containing the classes for Hybridkubernetes. + * Azure Connected Cluster Resource Provider API for onboarding a Kubernetes Cluster to Azure Arc. */ 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 40e6e9642fb5..5a2ff5f6df7a 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.resourcemanager.hybridkubernetes { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.hybridkubernetes.fluent.models to com.azure.core; opens com.azure.resourcemanager.hybridkubernetes.models to com.azure.core; + opens com.azure.resourcemanager.hybridkubernetes.implementation.models to com.azure.core; } 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 deleted file mode 100644 index 720cf340956c..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterListByResourceGroupSamples.java +++ /dev/null @@ -1,24 +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; - -/** - * Samples for ConnectedCluster ListByResourceGroup. - */ -public final class ConnectedClusterListByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * GetClustersByResourceGroupExample.json - */ - /** - * Sample code: GetClustersExample. - * - * @param manager Entry point to HybridKubernetesManager. - */ - public static void getClustersExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { - manager.connectedClusters().listByResourceGroup("k8sc-rg", 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 deleted file mode 100644 index 2ea3bc5334c0..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterListSamples.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; - -/** - * Samples for ConnectedCluster List. - */ -public final class ConnectedClusterListSamples { - /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * GetClustersBySubscriptionExample.json - */ - /** - * Sample code: GetClustersBySubscriptionExample. - * - * @param manager Entry point to HybridKubernetesManager. - */ - 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/ConnectedClusterCreateOrReplaceSamples.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClustersCreateOrReplaceSamples.java similarity index 82% rename from sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterCreateOrReplaceSamples.java rename to sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClustersCreateOrReplaceSamples.java index 574047a8ec3d..42706419eac9 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterCreateOrReplaceSamples.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClustersCreateOrReplaceSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.generated; @@ -20,21 +20,19 @@ import java.util.Map; /** - * Samples for ConnectedCluster CreateOrReplace. + * Samples for ConnectedClusters CreateOrReplace. */ -public final class ConnectedClusterCreateOrReplaceSamples { +public final class ConnectedClustersCreateOrReplaceSamples { /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * UpdateClusterByPutExample.json + * x-ms-original-file: 2024-12-01-preview/UpdateClusterByPutExample.json */ /** * Sample code: UpdateClusterByPutExample. * - * @param manager Entry point to HybridKubernetesManager. + * @param manager Entry point to HybridkubernetesManager. */ public static void - updateClusterByPutExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + updateClusterByPutExample(com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager) { manager.connectedClusters() .define("testCluster") .withRegion("East US") @@ -53,17 +51,15 @@ public final class ConnectedClusterCreateOrReplaceSamples { } /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * CreateCluster_KindExample.json + * x-ms-original-file: 2024-12-01-preview/CreateCluster_KindExample.json */ /** * Sample code: CreateCluster_KindExample. * - * @param manager Entry point to HybridKubernetesManager. + * @param manager Entry point to HybridkubernetesManager. */ public static void - createClusterKindExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + createClusterKindExample(com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager) { manager.connectedClusters() .define("testCluster") .withRegion("East US") @@ -75,9 +71,9 @@ public final class ConnectedClusterCreateOrReplaceSamples { .withDistribution("AKS") .withDistributionVersion("1.0") .withAzureHybridBenefit(AzureHybridBenefit.NOT_APPLICABLE) - .withAadProfile(new AadProfile().withEnableAzureRbac(true) + .withAadProfile(new AadProfile().withEnableAzureRBAC(true) .withAdminGroupObjectIDs(Arrays.asList("56f988bf-86f1-41af-91ab-2d7cd011db47")) - .withTenantId("82f988bf-86f1-41af-91ab-2d7cd011db47")) + .withTenantID("82f988bf-86f1-41af-91ab-2d7cd011db47")) .withArcAgentProfile(new ArcAgentProfile().withDesiredAgentVersion("0.1.0") .withAgentAutoUpgrade(AutoUpgradeOptions.ENABLED) .withSystemComponents(Arrays.asList( @@ -87,17 +83,15 @@ public final class ConnectedClusterCreateOrReplaceSamples { } /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * CreateClusterExample.json + * x-ms-original-file: 2024-12-01-preview/CreateClusterExample.json */ /** * Sample code: CreateClusterExample. * - * @param manager Entry point to HybridKubernetesManager. + * @param manager Entry point to HybridkubernetesManager. */ public static void - createClusterExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + createClusterExample(com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager) { manager.connectedClusters() .define("testCluster") .withRegion("East US") @@ -113,17 +107,15 @@ public final class ConnectedClusterCreateOrReplaceSamples { } /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * CreateClusterPrivateLinkExample.json + * x-ms-original-file: 2024-12-01-preview/CreateClusterPrivateLinkExample.json */ /** * Sample code: CreateClusterPrivateLinkExample. * - * @param manager Entry point to HybridKubernetesManager. + * @param manager Entry point to HybridkubernetesManager. */ public static void - createClusterPrivateLinkExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + createClusterPrivateLinkExample(com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager) { manager.connectedClusters() .define("testCluster") .withRegion("East US") @@ -142,17 +134,15 @@ public final class ConnectedClusterCreateOrReplaceSamples { } /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * CreateClusterAgentless_KindAWSExample.json + * x-ms-original-file: 2024-12-01-preview/CreateClusterAgentless_KindAWSExample.json */ /** * Sample code: CreateClusterAgentless_KindAWSExample. * - * @param manager Entry point to HybridKubernetesManager. + * @param manager Entry point to HybridkubernetesManager. */ public static void createClusterAgentlessKindAWSExample( - com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager) { manager.connectedClusters() .define("testCluster") .withRegion("East US") 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/ConnectedClustersDeleteSamples.java similarity index 51% rename from sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterDeleteSamples.java rename to sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClustersDeleteSamples.java index 5d9c6ac09c18..c4de1a72638d 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/ConnectedClustersDeleteSamples.java @@ -1,25 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.generated; /** - * Samples for ConnectedCluster Delete. + * Samples for ConnectedClusters Delete. */ -public final class ConnectedClusterDeleteSamples { +public final class ConnectedClustersDeleteSamples { /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * DeleteClusterExample.json + * x-ms-original-file: 2024-12-01-preview/DeleteClusterExample.json */ /** * Sample code: DeleteClusterExample. * - * @param manager Entry point to HybridKubernetesManager. + * @param manager Entry point to HybridkubernetesManager. */ public static void - deleteClusterExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + 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/ConnectedClustersGetByResourceGroupSamples.java similarity index 50% rename from sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterGetByResourceGroupSamples.java rename to sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClustersGetByResourceGroupSamples.java index 1ed89a481d48..2ca35edbf4a3 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/ConnectedClustersGetByResourceGroupSamples.java @@ -1,40 +1,36 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.generated; /** - * Samples for ConnectedCluster GetByResourceGroup. + * Samples for ConnectedClusters GetByResourceGroup. */ -public final class ConnectedClusterGetByResourceGroupSamples { +public final class ConnectedClustersGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * GetProvisionedClusterExample.json + * x-ms-original-file: 2024-12-01-preview/GetProvisionedClusterExample.json */ /** * Sample code: GetProvisionedClusterExample. * - * @param manager Entry point to HybridKubernetesManager. + * @param manager Entry point to HybridkubernetesManager. */ public static void - getProvisionedClusterExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + 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-12-01-preview/examples/ - * GetClusterExample.json + * x-ms-original-file: 2024-12-01-preview/GetClusterExample.json */ /** * Sample code: GetClusterExample. * - * @param manager Entry point to HybridKubernetesManager. + * @param manager Entry point to HybridkubernetesManager. */ - public static void getClusterExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + public static void getClusterExample(com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager) { 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/ConnectedClustersListByResourceGroupSamples.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClustersListByResourceGroupSamples.java new file mode 100644 index 000000000000..586a8d550bff --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClustersListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.generated; + +/** + * Samples for ConnectedClusters ListByResourceGroup. + */ +public final class ConnectedClustersListByResourceGroupSamples { + /* + * x-ms-original-file: 2024-12-01-preview/GetClustersByResourceGroupExample.json + */ + /** + * Sample code: GetClustersExample. + * + * @param manager Entry point to HybridkubernetesManager. + */ + public static void getClustersExample(com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager) { + manager.connectedClusters().listByResourceGroup("k8sc-rg", com.azure.core.util.Context.NONE); + } +} 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/ConnectedClustersListClusterUserCredentialSamples.java similarity index 61% rename from sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterListClusterUserCredentialSamples.java rename to sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClustersListClusterUserCredentialSamples.java index 95558bc7179d..273f701f77d7 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/ConnectedClustersListClusterUserCredentialSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.generated; @@ -8,21 +8,19 @@ import com.azure.resourcemanager.hybridkubernetes.models.ListClusterUserCredentialProperties; /** - * Samples for ConnectedCluster ListClusterUserCredential. + * Samples for ConnectedClusters ListClusterUserCredential. */ -public final class ConnectedClusterListClusterUserCredentialSamples { +public final class ConnectedClustersListClusterUserCredentialSamples { /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * ConnectedClustersListClusterCredentialResultCSPAAD.json + * x-ms-original-file: 2024-12-01-preview/ConnectedClustersListClusterCredentialResultCSPAAD.json */ /** * Sample code: ListClusterUserCredentialExample. * - * @param manager Entry point to HybridKubernetesManager. + * @param manager Entry point to HybridkubernetesManager. */ public static void - listClusterUserCredentialExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + listClusterUserCredentialExample(com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager) { manager.connectedClusters() .listClusterUserCredentialWithResponse("k8sc-rg", "testCluster", new ListClusterUserCredentialProperties().withAuthenticationMethod(AuthenticationMethod.AAD) @@ -31,17 +29,15 @@ public final class ConnectedClusterListClusterUserCredentialSamples { } /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * ConnectedClustersListClusterCredentialResultHPAAD.json + * x-ms-original-file: 2024-12-01-preview/ConnectedClustersListClusterCredentialResultHPAAD.json */ /** * Sample code: ListClusterUserCredentialCSPExample. * - * @param manager Entry point to HybridKubernetesManager. + * @param manager Entry point to HybridkubernetesManager. */ public static void listClusterUserCredentialCSPExample( - com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager) { manager.connectedClusters() .listClusterUserCredentialWithResponse("k8sc-rg", "testCluster", new ListClusterUserCredentialProperties().withAuthenticationMethod(AuthenticationMethod.AAD) @@ -50,17 +46,15 @@ public static void listClusterUserCredentialCSPExample( } /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * ConnectedClustersListClusterCredentialResultCSPToken.json + * x-ms-original-file: 2024-12-01-preview/ConnectedClustersListClusterCredentialResultCSPToken.json */ /** * Sample code: ListClusterUserCredentialNonAadExample. * - * @param manager Entry point to HybridKubernetesManager. + * @param manager Entry point to HybridkubernetesManager. */ public static void listClusterUserCredentialNonAadExample( - com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager) { manager.connectedClusters() .listClusterUserCredentialWithResponse("k8sc-rg", "testCluster", new ListClusterUserCredentialProperties().withAuthenticationMethod(AuthenticationMethod.TOKEN) @@ -69,17 +63,15 @@ public static void listClusterUserCredentialNonAadExample( } /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * ConnectedClustersListClusterCredentialResultHPToken.json + * x-ms-original-file: 2024-12-01-preview/ConnectedClustersListClusterCredentialResultHPToken.json */ /** * Sample code: ListClusterUserCredentialNonAadCSPExample. * - * @param manager Entry point to HybridKubernetesManager. + * @param manager Entry point to HybridkubernetesManager. */ public static void listClusterUserCredentialNonAadCSPExample( - com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager) { manager.connectedClusters() .listClusterUserCredentialWithResponse("k8sc-rg", "testCluster", new ListClusterUserCredentialProperties().withAuthenticationMethod(AuthenticationMethod.TOKEN) diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClustersListSamples.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClustersListSamples.java new file mode 100644 index 000000000000..1ad3d8789b7d --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClustersListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.generated; + +/** + * Samples for ConnectedClusters List. + */ +public final class ConnectedClustersListSamples { + /* + * x-ms-original-file: 2024-12-01-preview/GetClustersBySubscriptionExample.json + */ + /** + * Sample code: GetClustersBySubscriptionExample. + * + * @param manager Entry point to HybridkubernetesManager. + */ + 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/ConnectedClustersUpdateSamples.java similarity index 76% rename from sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterUpdateSamples.java rename to sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClustersUpdateSamples.java index 1b72154b5b93..0b81b79d0168 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/ConnectedClustersUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.generated; @@ -10,21 +10,19 @@ import java.util.Map; /** - * Samples for ConnectedCluster Update. + * Samples for ConnectedClusters Update. */ -public final class ConnectedClusterUpdateSamples { +public final class ConnectedClustersUpdateSamples { /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * UpdateClusterByPatchExample.json + * x-ms-original-file: 2024-12-01-preview/UpdateClusterByPatchExample.json */ /** * Sample code: UpdateClusterExample. * - * @param manager Entry point to HybridKubernetesManager. + * @param manager Entry point to HybridkubernetesManager. */ public static void - updateClusterExample(com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager) { + updateClusterExample(com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager) { ConnectedCluster resource = manager.connectedClusters() .getByResourceGroupWithResponse("k8sc-rg", "testCluster", com.azure.core.util.Context.NONE) .getValue(); 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 deleted file mode 100644 index b047302a557a..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationsGetSamples.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; - -/** - * Samples for Operations Get. - */ -public final class OperationsGetSamples { - /* - * x-ms-original-file: - * specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-12-01-preview/examples/ - * ListConnectedClusterOperationsExample.json - */ - /** - * Sample code: ListConnectedClusterOperationsExample. - * - * @param manager Entry point to HybridKubernetesManager. - */ - 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/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationsListSamples.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationsListSamples.java new file mode 100644 index 000000000000..441d675e0bf1 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/samples/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2024-12-01-preview/ListConnectedClusterOperationsExample.json + */ + /** + * Sample code: ListConnectedClusterOperationsExample. + * + * @param manager Entry point to HybridkubernetesManager. + */ + public static void listConnectedClusterOperationsExample( + com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/AadProfileTests.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/AadProfileTests.java deleted file mode 100644 index 79e4d099a7d1..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/AadProfileTests.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.AadProfile; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AadProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AadProfile model = BinaryData.fromString( - "{\"enableAzureRBAC\":false,\"adminGroupObjectIDs\":[\"bmufpown\",\"izhwlrxy\"],\"tenantID\":\"soqijg\"}") - .toObject(AadProfile.class); - Assertions.assertEquals(false, model.enableAzureRbac()); - Assertions.assertEquals("bmufpown", model.adminGroupObjectIDs().get(0)); - Assertions.assertEquals("soqijg", model.tenantId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AadProfile model = new AadProfile().withEnableAzureRbac(false) - .withAdminGroupObjectIDs(Arrays.asList("bmufpown", "izhwlrxy")) - .withTenantId("soqijg"); - model = BinaryData.fromObject(model).toObject(AadProfile.class); - Assertions.assertEquals(false, model.enableAzureRbac()); - Assertions.assertEquals("bmufpown", model.adminGroupObjectIDs().get(0)); - Assertions.assertEquals("soqijg", model.tenantId()); - } -} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/AgentErrorTests.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/AgentErrorTests.java deleted file mode 100644 index 1285d21cd600..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/AgentErrorTests.java +++ /dev/null @@ -1,23 +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.AgentError; - -public final class AgentErrorTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AgentError model = BinaryData.fromString( - "{\"message\":\"k\",\"severity\":\"txukcdmp\",\"component\":\"cryuan\",\"time\":\"2021-11-26T19:11:40Z\"}") - .toObject(AgentError.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AgentError model = new AgentError(); - model = BinaryData.fromObject(model).toObject(AgentError.class); - } -} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ArcAgentProfileTests.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ArcAgentProfileTests.java deleted file mode 100644 index 7a3e815bd9e1..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ArcAgentProfileTests.java +++ /dev/null @@ -1,47 +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.AgentError; -import com.azure.resourcemanager.hybridkubernetes.models.ArcAgentProfile; -import com.azure.resourcemanager.hybridkubernetes.models.AutoUpgradeOptions; -import com.azure.resourcemanager.hybridkubernetes.models.SystemComponent; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ArcAgentProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ArcAgentProfile model = BinaryData.fromString( - "{\"desiredAgentVersion\":\"mbpazlobcufpdzn\",\"agentAutoUpgrade\":\"Enabled\",\"systemComponents\":[{\"type\":\"jnqglhqgnu\",\"userSpecifiedVersion\":\"oo\",\"majorVersion\":1211783764,\"currentVersion\":\"fsqesaagdfmglzlh\"},{\"type\":\"rifkwm\",\"userSpecifiedVersion\":\"ktsizntocipaou\",\"majorVersion\":497746750,\"currentVersion\":\"qucmpo\"}],\"agentErrors\":[{\"message\":\"fogknygjofjdde\",\"severity\":\"rd\",\"component\":\"pewnw\",\"time\":\"2021-10-24T12:50:40Z\"}],\"agentState\":\"jzyflu\"}") - .toObject(ArcAgentProfile.class); - Assertions.assertEquals("mbpazlobcufpdzn", model.desiredAgentVersion()); - Assertions.assertEquals(AutoUpgradeOptions.ENABLED, model.agentAutoUpgrade()); - Assertions.assertEquals("jnqglhqgnu", model.systemComponents().get(0).type()); - Assertions.assertEquals("oo", model.systemComponents().get(0).userSpecifiedVersion()); - Assertions.assertEquals(1211783764, model.systemComponents().get(0).majorVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ArcAgentProfile model = new ArcAgentProfile().withDesiredAgentVersion("mbpazlobcufpdzn") - .withAgentAutoUpgrade(AutoUpgradeOptions.ENABLED) - .withSystemComponents(Arrays.asList( - new SystemComponent().withType("jnqglhqgnu") - .withUserSpecifiedVersion("oo") - .withMajorVersion(1211783764), - new SystemComponent().withType("rifkwm") - .withUserSpecifiedVersion("ktsizntocipaou") - .withMajorVersion(497746750))) - .withAgentErrors(Arrays.asList(new AgentError())); - model = BinaryData.fromObject(model).toObject(ArcAgentProfile.class); - Assertions.assertEquals("mbpazlobcufpdzn", model.desiredAgentVersion()); - Assertions.assertEquals(AutoUpgradeOptions.ENABLED, model.agentAutoUpgrade()); - Assertions.assertEquals("jnqglhqgnu", model.systemComponents().get(0).type()); - Assertions.assertEquals("oo", model.systemComponents().get(0).userSpecifiedVersion()); - Assertions.assertEquals(1211783764, model.systemComponents().get(0).majorVersion()); - } -} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ArcAgentryConfigurationsTests.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ArcAgentryConfigurationsTests.java deleted file mode 100644 index 02eac1c10c7f..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ArcAgentryConfigurationsTests.java +++ /dev/null @@ -1,46 +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.ArcAgentryConfigurations; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ArcAgentryConfigurationsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ArcAgentryConfigurations model = BinaryData.fromString( - "{\"feature\":\"symglzufcyz\",\"settings\":{\"s\":\"dbihanufhfcbj\",\"xqhabi\":\"git\"},\"protectedSettings\":{\"y\":\"kxwczbyscnpqxuhi\",\"wby\":\"n\"}}") - .toObject(ArcAgentryConfigurations.class); - Assertions.assertEquals("symglzufcyz", model.feature()); - Assertions.assertEquals("dbihanufhfcbj", model.settings().get("s")); - Assertions.assertEquals("kxwczbyscnpqxuhi", model.protectedSettings().get("y")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ArcAgentryConfigurations model = new ArcAgentryConfigurations().withFeature("symglzufcyz") - .withSettings(mapOf("s", "dbihanufhfcbj", "xqhabi", "git")) - .withProtectedSettings(mapOf("y", "kxwczbyscnpqxuhi", "wby", "n")); - model = BinaryData.fromObject(model).toObject(ArcAgentryConfigurations.class); - Assertions.assertEquals("symglzufcyz", model.feature()); - Assertions.assertEquals("dbihanufhfcbj", model.settings().get("s")); - Assertions.assertEquals("kxwczbyscnpqxuhi", model.protectedSettings().get("y")); - } - - // Use "Map.of" if available - @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/ConnectedClusterIdentityTests.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterIdentityTests.java deleted file mode 100644 index 63aa0102d80c..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterIdentityTests.java +++ /dev/null @@ -1,27 +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\":\"ph\",\"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/ConnectedClusterPatchPropertiesTests.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterPatchPropertiesTests.java deleted file mode 100644 index 3f368d05e175..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterPatchPropertiesTests.java +++ /dev/null @@ -1,34 +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.ConnectedClusterPatchProperties; -import com.azure.resourcemanager.hybridkubernetes.models.AzureHybridBenefit; -import org.junit.jupiter.api.Assertions; - -public final class ConnectedClusterPatchPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectedClusterPatchProperties model = BinaryData.fromString( - "{\"distribution\":\"cnyejhkryhtnapcz\",\"distributionVersion\":\"okjye\",\"azureHybridBenefit\":\"False\"}") - .toObject(ConnectedClusterPatchProperties.class); - Assertions.assertEquals("cnyejhkryhtnapcz", model.distribution()); - Assertions.assertEquals("okjye", model.distributionVersion()); - Assertions.assertEquals(AzureHybridBenefit.FALSE, model.azureHybridBenefit()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectedClusterPatchProperties model - = new ConnectedClusterPatchProperties().withDistribution("cnyejhkryhtnapcz") - .withDistributionVersion("okjye") - .withAzureHybridBenefit(AzureHybridBenefit.FALSE); - model = BinaryData.fromObject(model).toObject(ConnectedClusterPatchProperties.class); - Assertions.assertEquals("cnyejhkryhtnapcz", model.distribution()); - Assertions.assertEquals("okjye", model.distributionVersion()); - Assertions.assertEquals(AzureHybridBenefit.FALSE, model.azureHybridBenefit()); - } -} 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 631fadaaa278..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ConnectedClusterPatchTests.java +++ /dev/null @@ -1,50 +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.AzureHybridBenefit; -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\":{\"mjgr\":\"xvd\"},\"properties\":{\"distribution\":\"vukxgau\",\"distributionVersion\":\"cs\",\"azureHybridBenefit\":\"NotApplicable\"}}") - .toObject(ConnectedClusterPatch.class); - Assertions.assertEquals("xvd", model.tags().get("mjgr")); - Assertions.assertEquals("vukxgau", model.distribution()); - Assertions.assertEquals("cs", model.distributionVersion()); - Assertions.assertEquals(AzureHybridBenefit.NOT_APPLICABLE, model.azureHybridBenefit()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectedClusterPatch model = new ConnectedClusterPatch().withTags(mapOf("mjgr", "xvd")) - .withDistribution("vukxgau") - .withDistributionVersion("cs") - .withAzureHybridBenefit(AzureHybridBenefit.NOT_APPLICABLE); - model = BinaryData.fromObject(model).toObject(ConnectedClusterPatch.class); - Assertions.assertEquals("xvd", model.tags().get("mjgr")); - Assertions.assertEquals("vukxgau", model.distribution()); - Assertions.assertEquals("cs", model.distributionVersion()); - Assertions.assertEquals(AzureHybridBenefit.NOT_APPLICABLE, model.azureHybridBenefit()); - } - - // Use "Map.of" if available - @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 index 6c1dcdcb68a1..5fd0ac681140 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.generated; @@ -9,7 +9,7 @@ import com.azure.core.management.profile.AzureProfile; import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager; +import com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; @@ -22,12 +22,12 @@ public void testDelete() throws Exception { HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HybridKubernetesManager manager = HybridKubernetesManager.configure() + HybridkubernetesManager manager = HybridkubernetesManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.connectedClusters().delete("eltmrldhugjzzdat", "xhocdgeablgphuti", com.azure.core.util.Context.NONE); + manager.connectedClusters().delete("ouf", "mmnkzsmodmgl", 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 fce01c9e0afa..000000000000 --- 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\":\"zkrwfn\"}").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/GatewayTests.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/GatewayTests.java deleted file mode 100644 index eae2eefc6313..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/GatewayTests.java +++ /dev/null @@ -1,26 +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.Gateway; -import org.junit.jupiter.api.Assertions; - -public final class GatewayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Gateway model = BinaryData.fromString("{\"enabled\":true,\"resourceId\":\"bpzvgn\"}").toObject(Gateway.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("bpzvgn", model.resourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Gateway model = new Gateway().withEnabled(true).withResourceId("bpzvgn"); - model = BinaryData.fromObject(model).toObject(Gateway.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("bpzvgn", model.resourceId()); - } -} 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 e7447229356b..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/ListClusterUserCredentialPropertiesTests.java +++ /dev/null @@ -1,31 +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/OidcIssuerProfileTests.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/OidcIssuerProfileTests.java deleted file mode 100644 index c1871a2e445e..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/OidcIssuerProfileTests.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.OidcIssuerProfile; -import org.junit.jupiter.api.Assertions; - -public final class OidcIssuerProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OidcIssuerProfile model = BinaryData - .fromString("{\"enabled\":true,\"issuerUrl\":\"lhmwhfpmrqobm\",\"selfHostedIssuerUrl\":\"kknryrtihf\"}") - .toObject(OidcIssuerProfile.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("kknryrtihf", model.selfHostedIssuerUrl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OidcIssuerProfile model = new OidcIssuerProfile().withEnabled(true).withSelfHostedIssuerUrl("kknryrtihf"); - model = BinaryData.fromObject(model).toObject(OidcIssuerProfile.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("kknryrtihf", model.selfHostedIssuerUrl()); - } -} 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 a3cd38ab1f34..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationDisplayTests.java +++ /dev/null @@ -1,35 +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\":\"lssai\",\"resource\":\"p\",\"operation\":\"nzl\",\"description\":\"fmppe\"}") - .toObject(OperationDisplay.class); - Assertions.assertEquals("lssai", model.provider()); - Assertions.assertEquals("p", model.resource()); - Assertions.assertEquals("nzl", model.operation()); - Assertions.assertEquals("fmppe", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay().withProvider("lssai") - .withResource("p") - .withOperation("nzl") - .withDescription("fmppe"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("lssai", model.provider()); - Assertions.assertEquals("p", model.resource()); - Assertions.assertEquals("nzl", model.operation()); - Assertions.assertEquals("fmppe", 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 9a1598893777..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationInnerTests.java +++ /dev/null @@ -1,23 +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\":\"qulngsntnbybkzgc\",\"display\":{\"provider\":\"clxxwrljdo\",\"resource\":\"kcqvkocrc\",\"operation\":\"kwt\",\"description\":\"xbnjbiksq\"}}") - .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 bccbd15e2ba4..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationListTests.java +++ /dev/null @@ -1,26 +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\":\"dfdosygexp\",\"display\":{\"provider\":\"akhmsbzjhcrz\",\"resource\":\"dphlxaolt\",\"operation\":\"trg\",\"description\":\"bpf\"}},{\"name\":\"s\",\"display\":{\"provider\":\"gvfcj\",\"resource\":\"zoxxjtf\",\"operation\":\"luwfzitonpeqfpjk\",\"description\":\"xofpdvhpfxxypi\"}},{\"name\":\"nmayhuybb\",\"display\":{\"provider\":\"depoog\",\"resource\":\"uvamiheognarxzxt\",\"operation\":\"o\",\"description\":\"si\"}},{\"name\":\"evcciqihnhun\",\"display\":{\"provider\":\"jzrnf\",\"resource\":\"xgispemvtzfkufu\",\"operation\":\"jofxqe\",\"description\":\"jaeq\"}}],\"nextLink\":\"qjbasvms\"}") - .toObject(OperationList.class); - Assertions.assertEquals("qjbasvms", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationList model = new OperationList().withNextLink("qjbasvms"); - model = BinaryData.fromObject(model).toObject(OperationList.class); - Assertions.assertEquals("qjbasvms", 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/OperationsListMockTests.java similarity index 66% rename from sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationsGetMockTests.java rename to sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/OperationsListMockTests.java index 9b5adf3b7e76..72d477cb9791 100644 --- 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/OperationsListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridkubernetes.generated; @@ -10,27 +10,27 @@ import com.azure.core.management.profile.AzureProfile; import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager; +import com.azure.resourcemanager.hybridkubernetes.HybridkubernetesManager; import com.azure.resourcemanager.hybridkubernetes.models.Operation; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class OperationsGetMockTests { +public final class OperationsListMockTests { @Test - public void testGet() throws Exception { + public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"pbhtqqrolfpfpsa\",\"display\":{\"provider\":\"qux\",\"resource\":\"jyj\",\"operation\":\"jaoyfhrtx\",\"description\":\"n\"}}]}"; + = "{\"value\":[{\"name\":\"huticndvkao\",\"isDataAction\":true,\"display\":{\"provider\":\"tyhxhurokft\",\"resource\":\"olniwpwcukjf\",\"operation\":\"iawxklry\",\"description\":\"wckbasyypnd\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HybridKubernetesManager manager = HybridKubernetesManager.configure() + HybridkubernetesManager manager = HybridkubernetesManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.operations().get(com.azure.core.util.Context.NONE); + PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/SecurityProfileTests.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/SecurityProfileTests.java deleted file mode 100644 index 3442c64f3691..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/SecurityProfileTests.java +++ /dev/null @@ -1,27 +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.SecurityProfile; -import com.azure.resourcemanager.hybridkubernetes.models.SecurityProfileWorkloadIdentity; -import org.junit.jupiter.api.Assertions; - -public final class SecurityProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityProfile model - = BinaryData.fromString("{\"workloadIdentity\":{\"enabled\":true}}").toObject(SecurityProfile.class); - Assertions.assertEquals(true, model.workloadIdentity().enabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityProfile model - = new SecurityProfile().withWorkloadIdentity(new SecurityProfileWorkloadIdentity().withEnabled(true)); - model = BinaryData.fromObject(model).toObject(SecurityProfile.class); - Assertions.assertEquals(true, model.workloadIdentity().enabled()); - } -} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/SecurityProfileWorkloadIdentityTests.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/SecurityProfileWorkloadIdentityTests.java deleted file mode 100644 index aef7f22c5a32..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/SecurityProfileWorkloadIdentityTests.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.models.SecurityProfileWorkloadIdentity; -import org.junit.jupiter.api.Assertions; - -public final class SecurityProfileWorkloadIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityProfileWorkloadIdentity model - = BinaryData.fromString("{\"enabled\":false}").toObject(SecurityProfileWorkloadIdentity.class); - Assertions.assertEquals(false, model.enabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityProfileWorkloadIdentity model = new SecurityProfileWorkloadIdentity().withEnabled(false); - model = BinaryData.fromObject(model).toObject(SecurityProfileWorkloadIdentity.class); - Assertions.assertEquals(false, model.enabled()); - } -} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/SystemComponentTests.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/SystemComponentTests.java deleted file mode 100644 index cdeae5cfca79..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/test/java/com/azure/resourcemanager/hybridkubernetes/generated/SystemComponentTests.java +++ /dev/null @@ -1,31 +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.SystemComponent; -import org.junit.jupiter.api.Assertions; - -public final class SystemComponentTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SystemComponent model = BinaryData.fromString( - "{\"type\":\"rh\",\"userSpecifiedVersion\":\"fcqhsmyurkd\",\"majorVersion\":337855308,\"currentVersion\":\"he\"}") - .toObject(SystemComponent.class); - Assertions.assertEquals("rh", model.type()); - Assertions.assertEquals("fcqhsmyurkd", model.userSpecifiedVersion()); - Assertions.assertEquals(337855308, model.majorVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SystemComponent model - = new SystemComponent().withType("rh").withUserSpecifiedVersion("fcqhsmyurkd").withMajorVersion(337855308); - model = BinaryData.fromObject(model).toObject(SystemComponent.class); - Assertions.assertEquals("rh", model.type()); - Assertions.assertEquals("fcqhsmyurkd", model.userSpecifiedVersion()); - Assertions.assertEquals(337855308, model.majorVersion()); - } -} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/tsp-location.yaml b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/tsp-location.yaml new file mode 100644 index 000000000000..2b6d5bc5db74 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/hybridkubernetes/HybridKubernetes.Management +commit: 88ae2ee3303629a5c3b114661d139ec94700251b +repo: Azure/azure-rest-api-specs +additionalDirectories: