From b7541c74aa8a11af3a48f4d6568f05561745c59c Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 19 Aug 2026 13:48:17 +0000 Subject: [PATCH 1/2] Configurations: 'specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/hcpopenshiftclusters/tspconfig.yaml', SDK Release Type: beta, and CommitSHA: '73596619eb5eee265ffb62bad6afe37216a838c7' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6720108 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 8 + .../README.md | 102 ++ .../SAMPLE.md | 867 ++++++++++ .../pom.xml | 74 + ...atOpenShiftHostedControlPlanesManager.java | 367 ++++ .../fluent/ExternalAuthsClient.java | 267 +++ .../fluent/HcpOpenShiftClustersClient.java | 383 +++++ .../fluent/HcpOpenShiftVersionsClient.java | 70 + .../HcpOperatorIdentityRoleSetsClient.java | 72 + .../fluent/NodePoolsClient.java | 271 +++ .../fluent/OperationsClient.java | 40 + ...ftHostedControlPlanesManagementClient.java | 90 + .../fluent/models/ExternalAuthInner.java | 155 ++ ...pOpenShiftClusterAdminCredentialInner.java | 95 ++ .../models/HcpOpenShiftClusterInner.java | 210 +++ .../models/HcpOpenShiftVersionInner.java | 144 ++ .../HcpOperatorIdentityRoleSetInner.java | 148 ++ .../fluent/models/NodePoolInner.java | 210 +++ .../fluent/models/OperationInner.java | 150 ++ .../fluent/models/package-info.java | 8 + .../fluent/package-info.java | 8 + .../implementation/ExternalAuthImpl.java | 132 ++ .../ExternalAuthsClientImpl.java | 993 +++++++++++ .../implementation/ExternalAuthsImpl.java | 158 ++ ...cpOpenShiftClusterAdminCredentialImpl.java | 37 + .../HcpOpenShiftClusterImpl.java | 195 +++ .../HcpOpenShiftClustersClientImpl.java | 1482 +++++++++++++++++ .../HcpOpenShiftClustersImpl.java | 176 ++ .../HcpOpenShiftVersionImpl.java | 50 + .../HcpOpenShiftVersionsClientImpl.java | 345 ++++ .../HcpOpenShiftVersionsImpl.java | 64 + .../HcpOperatorIdentityRoleSetImpl.java | 50 + ...HcpOperatorIdentityRoleSetsClientImpl.java | 348 ++++ .../HcpOperatorIdentityRoleSetsImpl.java | 66 + .../implementation/NodePoolImpl.java | 180 ++ .../implementation/NodePoolsClientImpl.java | 999 +++++++++++ .../implementation/NodePoolsImpl.java | 155 ++ .../implementation/OperationImpl.java | 51 + .../implementation/OperationsClientImpl.java | 242 +++ .../implementation/OperationsImpl.java | 45 + ...dControlPlanesManagementClientBuilder.java | 140 ++ ...stedControlPlanesManagementClientImpl.java | 391 +++++ .../implementation/ResourceManagerUtils.java | 195 +++ .../models/ExternalAuthListResult.java | 95 ++ .../models/HcpOpenShiftClusterListResult.java | 97 ++ .../models/HcpOpenShiftVersionListResult.java | 97 ++ .../HcpOperatorIdentityRoleSetListResult.java | 98 ++ .../models/NodePoolListResult.java | 95 ++ .../models/OperationListResult.java | 96 ++ .../implementation/package-info.java | 8 + .../redhatopenshifthcp/models/ActionType.java | 46 + .../redhatopenshifthcp/models/ApiProfile.java | 135 ++ .../models/ClusterAutoscalingProfile.java | 202 +++ .../models/ClusterImageRegistryProfile.java | 98 ++ .../models/ClusterImageRegistryState.java | 51 + .../redhatopenshifthcp/models/Condition.java | 147 ++ .../models/ConditionType.java | 56 + .../models/ConsoleProfile.java | 74 + .../models/CryptoRestrictions.java | 51 + .../CustomerManagedEncryptionProfile.java | 125 ++ .../models/CustomerManagedEncryptionType.java | 46 + .../models/DiskStorageAccountType.java | 57 + .../redhatopenshifthcp/models/DnsProfile.java | 106 ++ .../redhatopenshifthcp/models/Effect.java | 56 + ...cdDataEncryptionKeyManagementModeType.java | 47 + .../models/EtcdDataEncryptionProfile.java | 122 ++ .../models/EtcdProfile.java | 88 + .../models/ExternalAuth.java | 189 +++ .../models/ExternalAuthClaimProfile.java | 118 ++ .../ExternalAuthClientComponentProfile.java | 140 ++ .../models/ExternalAuthClientProfile.java | 189 +++ .../models/ExternalAuthClientType.java | 54 + .../models/ExternalAuthProperties.java | 184 ++ .../models/ExternalAuthProvisioningState.java | 81 + .../models/ExternalAuths.java | 144 ++ .../models/GroupClaimProfile.java | 126 ++ .../models/HcpOpenShiftCluster.java | 337 ++++ .../HcpOpenShiftClusterAdminCredential.java | 35 + .../models/HcpOpenShiftClusterProperties.java | 490 ++++++ .../models/HcpOpenShiftClusters.java | 207 +++ .../models/HcpOpenShiftVersion.java | 55 + .../models/HcpOpenShiftVersionProperties.java | 118 ++ .../models/HcpOpenShiftVersions.java | 62 + .../models/HcpOperatorIdentityRoleSet.java | 55 + .../HcpOperatorIdentityRoleSetProperties.java | 106 ++ .../models/HcpOperatorIdentityRoleSets.java | 65 + .../models/ImageDigestMirror.java | 222 +++ .../models/IngressProfile.java | 85 + .../models/IngressType.java | 56 + .../models/KeyVaultVisibility.java | 51 + .../models/KmsEncryptionProfile.java | 145 ++ .../redhatopenshifthcp/models/KmsKey.java | 114 ++ .../redhatopenshifthcp/models/Label.java | 114 ++ .../models/ManagedServiceIdentity.java | 154 ++ .../models/ManagedServiceIdentityType.java | 62 + .../models/NetworkProfile.java | 197 +++ .../models/NetworkType.java | 51 + .../redhatopenshifthcp/models/NodePool.java | 300 ++++ .../models/NodePoolAutoScaling.java | 137 ++ .../models/NodePoolPlatformProfile.java | 220 +++ .../models/NodePoolProperties.java | 361 ++++ .../models/NodePoolVersionProfile.java | 123 ++ .../redhatopenshifthcp/models/NodePools.java | 144 ++ .../redhatopenshifthcp/models/Operation.java | 58 + .../models/OperationDisplay.java | 128 ++ .../redhatopenshifthcp/models/Operations.java | 35 + .../models/OperatorIdentityRequired.java | 51 + .../models/OperatorIdentityRoles.java | 115 ++ .../OperatorsAuthenticationProfile.java | 94 ++ .../redhatopenshifthcp/models/Origin.java | 57 + .../models/OsDiskProfile.java | 207 +++ .../redhatopenshifthcp/models/OsDiskType.java | 55 + .../models/OutboundType.java | 46 + .../models/PlatformProfile.java | 294 ++++ .../models/ProvisioningState.java | 76 + .../models/ResourceStatus.java | 75 + .../models/RoleDefinition.java | 92 + .../redhatopenshifthcp/models/StatusType.java | 56 + .../redhatopenshifthcp/models/Taint.java | 142 ++ .../models/TokenClaimMappingsProfile.java | 115 ++ .../models/TokenClaimValidationRule.java | 116 ++ .../models/TokenIssuerProfile.java | 179 ++ .../models/TokenRequiredClaim.java | 135 ++ .../models/TokenValidationRuleType.java | 49 + .../models/UserAssignedIdentitiesProfile.java | 170 ++ .../models/UserAssignedIdentity.java | 89 + .../models/UsernameClaimPrefixPolicy.java | 56 + .../models/UsernameClaimProfile.java | 211 +++ .../models/VersionProfile.java | 123 ++ .../redhatopenshifthcp/models/Visibility.java | 51 + .../models/package-info.java | 8 + .../redhatopenshifthcp/package-info.java | 8 + .../src/main/java/module-info.java | 16 + ...cemanager-redhatopenshifthcp_metadata.json | 1 + .../proxy-config.json | 1 + .../reflect-config.json | 1 + ...ourcemanager-redhatopenshifthcp.properties | 1 + .../ExternalAuthsCreateOrUpdateSamples.java | 63 + .../generated/ExternalAuthsDeleteSamples.java | 24 + .../generated/ExternalAuthsGetSamples.java | 24 + .../ExternalAuthsListByParentSamples.java | 23 + .../generated/ExternalAuthsUpdateSamples.java | 64 + ...penShiftClustersCreateOrUpdateSamples.java | 124 ++ .../HcpOpenShiftClustersDeleteSamples.java | 23 + ...hiftClustersGetByResourceGroupSamples.java | 24 + ...iftClustersListByResourceGroupSamples.java | 23 + .../HcpOpenShiftClustersListSamples.java | 23 + ...ClustersRequestAdminCredentialSamples.java | 24 + ...ShiftClustersRevokeCredentialsSamples.java | 24 + .../HcpOpenShiftClustersUpdateSamples.java | 51 + .../HcpOpenShiftVersionsGetSamples.java | 23 + .../HcpOpenShiftVersionsListSamples.java | 23 + ...HcpOperatorIdentityRoleSetsGetSamples.java | 24 + ...cpOperatorIdentityRoleSetsListSamples.java | 23 + .../NodePoolsCreateOrUpdateSamples.java | 73 + .../generated/NodePoolsDeleteSamples.java | 23 + .../generated/NodePoolsGetSamples.java | 24 + .../NodePoolsListByParentSamples.java | 23 + .../generated/NodePoolsUpdateSamples.java | 61 + .../generated/OperationsListSamples.java | 36 + .../generated/ApiProfileTests.java | 32 + .../ClusterAutoscalingProfileTests.java | 35 + .../ClusterImageRegistryProfileTests.java | 27 + .../generated/ConditionTests.java | 17 + .../generated/ConsoleProfileTests.java | 15 + .../generated/DnsProfileTests.java | 26 + .../ExternalAuthClaimProfileTests.java | 57 + ...ternalAuthClientComponentProfileTests.java | 29 + .../ExternalAuthClientProfileTests.java | 42 + .../generated/ExternalAuthInnerTests.java | 126 ++ .../ExternalAuthListResultTests.java | 33 + .../ExternalAuthPropertiesTests.java | 90 + .../ExternalAuthsCreateOrUpdateMockTests.java | 105 ++ ...ExternalAuthsGetWithResponseMockTests.java | 62 + .../ExternalAuthsListByParentMockTests.java | 68 + .../generated/GroupClaimProfileTests.java | 27 + ...ShiftClusterAdminCredentialInnerTests.java | 17 + ...ustersRequestAdminCredentialMockTests.java | 35 + .../HcpOpenShiftVersionInnerTests.java | 22 + .../HcpOpenShiftVersionListResultTests.java | 24 + .../HcpOpenShiftVersionPropertiesTests.java | 22 + ...ShiftVersionsGetWithResponseMockTests.java | 42 + .../HcpOpenShiftVersionsListMockTests.java | 42 + .../HcpOperatorIdentityRoleSetInnerTests.java | 32 + ...peratorIdentityRoleSetListResultTests.java | 36 + ...peratorIdentityRoleSetPropertiesTests.java | 29 + ...ntityRoleSetsGetWithResponseMockTests.java | 53 + ...OperatorIdentityRoleSetsListMockTests.java | 62 + .../generated/ImageDigestMirrorTests.java | 30 + .../generated/IngressProfileTests.java | 25 + .../generated/KmsKeyTests.java | 27 + .../ManagedServiceIdentityTests.java | 43 + .../generated/NetworkProfileTests.java | 39 + .../generated/NodePoolAutoScalingTests.java | 27 + .../NodePoolPlatformProfileTests.java | 50 + .../NodePoolVersionProfileTests.java | 27 + .../generated/OperationDisplayTests.java | 17 + .../generated/OperationInnerTests.java | 17 + .../generated/OperationListResultTests.java | 19 + .../generated/OperationsListMockTests.java | 36 + .../generated/OperatorIdentityRolesTests.java | 23 + .../OperatorsAuthenticationProfileTests.java | 53 + .../generated/OsDiskProfileTests.java | 37 + .../generated/PlatformProfileTests.java | 73 + .../generated/ResourceStatusTests.java | 17 + .../generated/RoleDefinitionTests.java | 19 + .../TokenClaimMappingsProfileTests.java | 41 + .../TokenClaimValidationRuleTests.java | 34 + .../generated/TokenIssuerProfileTests.java | 33 + .../generated/TokenRequiredClaimTests.java | 27 + .../UserAssignedIdentitiesProfileTests.java | 48 + .../generated/UserAssignedIdentityTests.java | 23 + .../generated/UsernameClaimProfileTests.java | 33 + .../generated/VersionProfileTests.java | 27 + .../tsp-location.yaml | 4 + sdk/redhatopenshifthcp/ci.yml | 46 + sdk/redhatopenshifthcp/pom.xml | 15 + 219 files changed, 23494 insertions(+) create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/CHANGELOG.md create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/README.md create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/SAMPLE.md create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/pom.xml create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/RedHatOpenShiftHostedControlPlanesManager.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/ExternalAuthsClient.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/HcpOpenShiftClustersClient.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/HcpOpenShiftVersionsClient.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/HcpOperatorIdentityRoleSetsClient.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/NodePoolsClient.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/OperationsClient.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/RedHatOpenShiftHostedControlPlanesManagementClient.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/ExternalAuthInner.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/HcpOpenShiftClusterAdminCredentialInner.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/HcpOpenShiftClusterInner.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/HcpOpenShiftVersionInner.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/HcpOperatorIdentityRoleSetInner.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/NodePoolInner.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/OperationInner.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/package-info.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/package-info.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/ExternalAuthImpl.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/ExternalAuthsClientImpl.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/ExternalAuthsImpl.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftClusterAdminCredentialImpl.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftClusterImpl.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftClustersClientImpl.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftClustersImpl.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftVersionImpl.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftVersionsClientImpl.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftVersionsImpl.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOperatorIdentityRoleSetImpl.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOperatorIdentityRoleSetsClientImpl.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOperatorIdentityRoleSetsImpl.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/NodePoolImpl.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/NodePoolsClientImpl.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/NodePoolsImpl.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/OperationImpl.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/OperationsClientImpl.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/OperationsImpl.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/RedHatOpenShiftHostedControlPlanesManagementClientBuilder.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/RedHatOpenShiftHostedControlPlanesManagementClientImpl.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/ResourceManagerUtils.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/models/ExternalAuthListResult.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/models/HcpOpenShiftClusterListResult.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/models/HcpOpenShiftVersionListResult.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/models/HcpOperatorIdentityRoleSetListResult.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/models/NodePoolListResult.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/models/OperationListResult.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/package-info.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ActionType.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ApiProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ClusterAutoscalingProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ClusterImageRegistryProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ClusterImageRegistryState.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/Condition.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ConditionType.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ConsoleProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/CryptoRestrictions.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/CustomerManagedEncryptionProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/CustomerManagedEncryptionType.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/DiskStorageAccountType.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/DnsProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/Effect.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/EtcdDataEncryptionKeyManagementModeType.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/EtcdDataEncryptionProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/EtcdProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuth.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuthClaimProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuthClientComponentProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuthClientProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuthClientType.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuthProperties.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuthProvisioningState.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuths.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/GroupClaimProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftCluster.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftClusterAdminCredential.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftClusterProperties.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftClusters.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftVersion.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftVersionProperties.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftVersions.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOperatorIdentityRoleSet.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOperatorIdentityRoleSetProperties.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOperatorIdentityRoleSets.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ImageDigestMirror.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/IngressProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/IngressType.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/KeyVaultVisibility.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/KmsEncryptionProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/KmsKey.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/Label.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ManagedServiceIdentity.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ManagedServiceIdentityType.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/NetworkProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/NetworkType.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/NodePool.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/NodePoolAutoScaling.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/NodePoolPlatformProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/NodePoolProperties.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/NodePoolVersionProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/NodePools.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/Operation.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/OperationDisplay.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/Operations.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/OperatorIdentityRequired.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/OperatorIdentityRoles.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/OperatorsAuthenticationProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/Origin.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/OsDiskProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/OsDiskType.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/OutboundType.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/PlatformProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ProvisioningState.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ResourceStatus.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/RoleDefinition.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/StatusType.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/Taint.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/TokenClaimMappingsProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/TokenClaimValidationRule.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/TokenIssuerProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/TokenRequiredClaim.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/TokenValidationRuleType.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/UserAssignedIdentitiesProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/UserAssignedIdentity.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/UsernameClaimPrefixPolicy.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/UsernameClaimProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/VersionProfile.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/Visibility.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/package-info.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/package-info.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/module-info.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/resources/META-INF/azure-resourcemanager-redhatopenshifthcp_metadata.json create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-redhatopenshifthcp/proxy-config.json create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-redhatopenshifthcp/reflect-config.json create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/resources/azure-resourcemanager-redhatopenshifthcp.properties create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/samples/java/com/azure/resourcemanager/redhatopenshifthcp/generated/ExternalAuthsCreateOrUpdateSamples.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/samples/java/com/azure/resourcemanager/redhatopenshifthcp/generated/ExternalAuthsDeleteSamples.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/samples/java/com/azure/resourcemanager/redhatopenshifthcp/generated/ExternalAuthsGetSamples.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/samples/java/com/azure/resourcemanager/redhatopenshifthcp/generated/ExternalAuthsListByParentSamples.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/samples/java/com/azure/resourcemanager/redhatopenshifthcp/generated/ExternalAuthsUpdateSamples.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/samples/java/com/azure/resourcemanager/redhatopenshifthcp/generated/HcpOpenShiftClustersCreateOrUpdateSamples.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/samples/java/com/azure/resourcemanager/redhatopenshifthcp/generated/HcpOpenShiftClustersDeleteSamples.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/samples/java/com/azure/resourcemanager/redhatopenshifthcp/generated/HcpOpenShiftClustersGetByResourceGroupSamples.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/samples/java/com/azure/resourcemanager/redhatopenshifthcp/generated/HcpOpenShiftClustersListByResourceGroupSamples.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/samples/java/com/azure/resourcemanager/redhatopenshifthcp/generated/HcpOpenShiftClustersListSamples.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/samples/java/com/azure/resourcemanager/redhatopenshifthcp/generated/HcpOpenShiftClustersRequestAdminCredentialSamples.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/samples/java/com/azure/resourcemanager/redhatopenshifthcp/generated/HcpOpenShiftClustersRevokeCredentialsSamples.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/samples/java/com/azure/resourcemanager/redhatopenshifthcp/generated/HcpOpenShiftClustersUpdateSamples.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/samples/java/com/azure/resourcemanager/redhatopenshifthcp/generated/HcpOpenShiftVersionsGetSamples.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/samples/java/com/azure/resourcemanager/redhatopenshifthcp/generated/HcpOpenShiftVersionsListSamples.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/samples/java/com/azure/resourcemanager/redhatopenshifthcp/generated/HcpOperatorIdentityRoleSetsGetSamples.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/samples/java/com/azure/resourcemanager/redhatopenshifthcp/generated/HcpOperatorIdentityRoleSetsListSamples.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/samples/java/com/azure/resourcemanager/redhatopenshifthcp/generated/NodePoolsCreateOrUpdateSamples.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/samples/java/com/azure/resourcemanager/redhatopenshifthcp/generated/NodePoolsDeleteSamples.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/samples/java/com/azure/resourcemanager/redhatopenshifthcp/generated/NodePoolsGetSamples.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/samples/java/com/azure/resourcemanager/redhatopenshifthcp/generated/NodePoolsListByParentSamples.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/samples/java/com/azure/resourcemanager/redhatopenshifthcp/generated/NodePoolsUpdateSamples.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/samples/java/com/azure/resourcemanager/redhatopenshifthcp/generated/OperationsListSamples.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/ApiProfileTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/ClusterAutoscalingProfileTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/ClusterImageRegistryProfileTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/ConditionTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/ConsoleProfileTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/DnsProfileTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/ExternalAuthClaimProfileTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/ExternalAuthClientComponentProfileTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/ExternalAuthClientProfileTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/ExternalAuthInnerTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/ExternalAuthListResultTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/ExternalAuthPropertiesTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/ExternalAuthsCreateOrUpdateMockTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/ExternalAuthsGetWithResponseMockTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/ExternalAuthsListByParentMockTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/GroupClaimProfileTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/HcpOpenShiftClusterAdminCredentialInnerTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/HcpOpenShiftClustersRequestAdminCredentialMockTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/HcpOpenShiftVersionInnerTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/HcpOpenShiftVersionListResultTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/HcpOpenShiftVersionPropertiesTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/HcpOpenShiftVersionsGetWithResponseMockTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/HcpOpenShiftVersionsListMockTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/HcpOperatorIdentityRoleSetInnerTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/HcpOperatorIdentityRoleSetListResultTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/HcpOperatorIdentityRoleSetPropertiesTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/HcpOperatorIdentityRoleSetsGetWithResponseMockTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/HcpOperatorIdentityRoleSetsListMockTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/ImageDigestMirrorTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/IngressProfileTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/KmsKeyTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/ManagedServiceIdentityTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/NetworkProfileTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/NodePoolAutoScalingTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/NodePoolPlatformProfileTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/NodePoolVersionProfileTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/OperationDisplayTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/OperationInnerTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/OperationListResultTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/OperationsListMockTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/OperatorIdentityRolesTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/OperatorsAuthenticationProfileTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/OsDiskProfileTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/PlatformProfileTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/ResourceStatusTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/RoleDefinitionTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/TokenClaimMappingsProfileTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/TokenClaimValidationRuleTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/TokenIssuerProfileTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/TokenRequiredClaimTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/UserAssignedIdentitiesProfileTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/UserAssignedIdentityTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/UsernameClaimProfileTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/test/java/com/azure/resourcemanager/redhatopenshifthcp/generated/VersionProfileTests.java create mode 100644 sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/tsp-location.yaml create mode 100644 sdk/redhatopenshifthcp/ci.yml create mode 100644 sdk/redhatopenshifthcp/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 625e945fbfe9..7f842bec2d0b 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -539,6 +539,7 @@ com.azure.resourcemanager:azure-resourcemanager-billing-trust;1.0.0-beta.1;1.0.0 com.azure.resourcemanager:azure-resourcemanager-containerservicepreparedimgspec;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-enclave;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-containerserviceaimanager;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-redhatopenshifthcp;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 com.azure.v2:azure-client-sdk-parent;2.0.0-beta.2;2.0.0-beta.2 diff --git a/pom.xml b/pom.xml index ba2dd922652c..de92b31fe7d1 100644 --- a/pom.xml +++ b/pom.xml @@ -226,6 +226,7 @@ sdk/recoveryservicesdatareplication sdk/recoveryservicessiterecovery sdk/redhatopenshift + sdk/redhatopenshifthcp sdk/redis sdk/redisenterprise sdk/relationships diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/CHANGELOG.md b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/CHANGELOG.md new file mode 100644 index 000000000000..f9bb26c9ac98 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 1.0.0-beta.1 (2026-08-19) + +- Azure Resource Manager Red Hat OpenShift Hosted Control Planes client library for Java. This package contains Microsoft Azure SDK for Red Hat OpenShift Hosted Control Planes Management SDK. Package api-version 2026-06-30-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +### Features Added + +- Initial release for the azure-resourcemanager-redhatopenshifthcp Java SDK. diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/README.md b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/README.md new file mode 100644 index 000000000000..8d61d11f0671 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager Red Hat OpenShift Hosted Control Planes client library for Java + +Azure Resource Manager Red Hat OpenShift Hosted Control Planes client library for Java. + +This package contains Microsoft Azure SDK for Red Hat OpenShift Hosted Control Planes Management SDK. Package api-version 2026-06-30-preview. 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 + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-redhatopenshifthcp;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-redhatopenshifthcp + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. + +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +RedHatOpenShiftHostedControlPlanesManager manager = RedHatOpenShiftHostedControlPlanesManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/SAMPLE.md b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/SAMPLE.md new file mode 100644 index 000000000000..345f792018eb --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/SAMPLE.md @@ -0,0 +1,867 @@ +# Code snippets and samples + + +## ExternalAuths + +- [CreateOrUpdate](#externalauths_createorupdate) +- [Delete](#externalauths_delete) +- [Get](#externalauths_get) +- [ListByParent](#externalauths_listbyparent) +- [Update](#externalauths_update) + +## HcpOpenShiftClusters + +- [CreateOrUpdate](#hcpopenshiftclusters_createorupdate) +- [Delete](#hcpopenshiftclusters_delete) +- [GetByResourceGroup](#hcpopenshiftclusters_getbyresourcegroup) +- [List](#hcpopenshiftclusters_list) +- [ListByResourceGroup](#hcpopenshiftclusters_listbyresourcegroup) +- [RequestAdminCredential](#hcpopenshiftclusters_requestadmincredential) +- [RevokeCredentials](#hcpopenshiftclusters_revokecredentials) +- [Update](#hcpopenshiftclusters_update) + +## HcpOpenShiftVersions + +- [Get](#hcpopenshiftversions_get) +- [List](#hcpopenshiftversions_list) + +## HcpOperatorIdentityRoleSets + +- [Get](#hcpoperatoridentityrolesets_get) +- [List](#hcpoperatoridentityrolesets_list) + +## NodePools + +- [CreateOrUpdate](#nodepools_createorupdate) +- [Delete](#nodepools_delete) +- [Get](#nodepools_get) +- [ListByParent](#nodepools_listbyparent) +- [Update](#nodepools_update) + +## Operations + +- [List](#operations_list) +### ExternalAuths_CreateOrUpdate + +```java +import com.azure.resourcemanager.redhatopenshifthcp.models.ExternalAuthClaimProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.ExternalAuthClientComponentProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.ExternalAuthClientProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.ExternalAuthClientType; +import com.azure.resourcemanager.redhatopenshifthcp.models.ExternalAuthProperties; +import com.azure.resourcemanager.redhatopenshifthcp.models.GroupClaimProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.TokenClaimMappingsProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.TokenClaimValidationRule; +import com.azure.resourcemanager.redhatopenshifthcp.models.TokenIssuerProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.TokenRequiredClaim; +import com.azure.resourcemanager.redhatopenshifthcp.models.TokenValidationRuleType; +import com.azure.resourcemanager.redhatopenshifthcp.models.UsernameClaimPrefixPolicy; +import com.azure.resourcemanager.redhatopenshifthcp.models.UsernameClaimProfile; +import java.util.Arrays; + +/** + * Samples for ExternalAuths CreateOrUpdate. + */ +public final class ExternalAuthsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-06-30-preview/ExternalAuths_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalAuths_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ + public static void externalAuthsCreateOrUpdateMaximumSet( + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager) { + manager.externalAuths() + .define("my-cool-auth") + .withExistingHcpOpenShiftCluster("rgopenapi", "hcpCluster-name") + .withProperties(new ExternalAuthProperties() + .withIssuer(new TokenIssuerProfile().withUrl("https://microsoft.com/a") + .withAudiences(Arrays.asList("audience1", "audience2", "audience3", "audience4", "audience5")) + .withCa("lrakpuqodeqscdauefb")) + .withClients(Arrays.asList(new ExternalAuthClientProfile() + .withComponent(new ExternalAuthClientComponentProfile().withName("my-cool-component") + .withAuthClientNamespace("my-cool-namespace")) + .withClientId("vobxtzobefgl") + .withExtraScopes(Arrays.asList("ejmvezdxvoozyiickteiqnvpxqciep")) + .withType(ExternalAuthClientType.CONFIDENTIAL))) + .withClaim(new ExternalAuthClaimProfile().withMappings(new TokenClaimMappingsProfile() + .withUsername(new UsernameClaimProfile().withClaim( + "utlmketyrdxmwijowjzbuqyawuoqrlriryuknigayeviriulgjvuwvxjrsrhpmvavyyxzapgkfeyedcklnoddeviibefgvubvecffqgdhntammtlwjsjemhsqhafmmorskpuwbtjgkoggxq") + .withPrefix("ojmwi") + .withPrefixPolicy(UsernameClaimPrefixPolicy.fromString("mdbghfytgejdqobfllqmajtc"))) + .withGroups(new GroupClaimProfile().withClaim( + "icvcoadhpyprqygxyvqhewaycjdtzrwjzbjgmyralburdaolouyvkymfpetymlcwpqsoteryaatoapieizbsnttmkkxsrhyaacnucznujhgmxkmnmgtcjntjsmuabplpoyxberrjdikkkqqiqfnlvwngpbfajzhxzdgqicoconqtrrstzzumdurgfsheypcm") + .withPrefix("kjlxhbjdvwarcwdu"))) + .withValidationRules( + Arrays.asList(new TokenClaimValidationRule().withType(TokenValidationRuleType.REQUIRED_CLAIM) + .withRequiredClaim(new TokenRequiredClaim().withClaim("ciapdmvrnfitudpx") + .withRequiredValue("mqzzjiozgxfgflhdrnwawpke")))))) + .create(); + } +} +``` + +### ExternalAuths_Delete + +```java +/** + * Samples for ExternalAuths Delete. + */ +public final class ExternalAuthsDeleteSamples { + /* + * x-ms-original-file: 2026-06-30-preview/ExternalAuths_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalAuths_Delete_MaximumSet. + * + * @param manager Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ + public static void externalAuthsDeleteMaximumSet( + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager) { + manager.externalAuths() + .delete("rgopenapi", "hcpCluster-name", "my-cool-auth", com.azure.core.util.Context.NONE); + } +} +``` + +### ExternalAuths_Get + +```java +/** + * Samples for ExternalAuths Get. + */ +public final class ExternalAuthsGetSamples { + /* + * x-ms-original-file: 2026-06-30-preview/ExternalAuths_Get_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalAuths_Get_MaximumSet. + * + * @param manager Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ + public static void externalAuthsGetMaximumSet( + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager) { + manager.externalAuths() + .getWithResponse("rgopenapi", "hcpCluster-name", "my-cool-auth", com.azure.core.util.Context.NONE); + } +} +``` + +### ExternalAuths_ListByParent + +```java +/** + * Samples for ExternalAuths ListByParent. + */ +public final class ExternalAuthsListByParentSamples { + /* + * x-ms-original-file: 2026-06-30-preview/ExternalAuths_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalAuths_ListByParent_MaximumSet. + * + * @param manager Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ + public static void externalAuthsListByParentMaximumSet( + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager) { + manager.externalAuths().listByParent("rgopenapi", "hcpCluster-name", com.azure.core.util.Context.NONE); + } +} +``` + +### ExternalAuths_Update + +```java +import com.azure.resourcemanager.redhatopenshifthcp.models.ExternalAuth; +import com.azure.resourcemanager.redhatopenshifthcp.models.ExternalAuthClaimProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.ExternalAuthClientComponentProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.ExternalAuthClientProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.ExternalAuthClientType; +import com.azure.resourcemanager.redhatopenshifthcp.models.ExternalAuthProperties; +import com.azure.resourcemanager.redhatopenshifthcp.models.GroupClaimProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.TokenClaimMappingsProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.TokenClaimValidationRule; +import com.azure.resourcemanager.redhatopenshifthcp.models.TokenIssuerProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.TokenRequiredClaim; +import com.azure.resourcemanager.redhatopenshifthcp.models.TokenValidationRuleType; +import com.azure.resourcemanager.redhatopenshifthcp.models.UsernameClaimPrefixPolicy; +import com.azure.resourcemanager.redhatopenshifthcp.models.UsernameClaimProfile; +import java.util.Arrays; + +/** + * Samples for ExternalAuths Update. + */ +public final class ExternalAuthsUpdateSamples { + /* + * x-ms-original-file: 2026-06-30-preview/ExternalAuths_Update_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalAuths_Update_MaximumSet. + * + * @param manager Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ + public static void externalAuthsUpdateMaximumSet( + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager) { + ExternalAuth resource = manager.externalAuths() + .getWithResponse("rgopenapi", "hcpCluster-name", "my-cool-auth", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new ExternalAuthProperties() + .withIssuer(new TokenIssuerProfile().withUrl("https://microsoft.com/a") + .withAudiences(Arrays.asList("audience1", "audience2", "audience3", "audience4", "audience5")) + .withCa("rgmklhpshpjkbpjskqxtyfwetjjxr")) + .withClients(Arrays.asList(new ExternalAuthClientProfile() + .withComponent(new ExternalAuthClientComponentProfile().withName("my-cool-component") + .withAuthClientNamespace("my-cool-namespace")) + .withClientId("vobxtzobefgl") + .withExtraScopes(Arrays.asList("ejmvezdxvoozyiickteiqnvpxqciep")) + .withType(ExternalAuthClientType.CONFIDENTIAL))) + .withClaim(new ExternalAuthClaimProfile().withMappings(new TokenClaimMappingsProfile() + .withUsername(new UsernameClaimProfile().withClaim( + "nmaleeslaspkxdurlxhdntydjdcdqmwizhqpgtywqzzykfvxnouqlewuwqyqlejnddtlmudupjlndnogagnkbnupmpxjsplsfbpoknppcbsjbymnlqmmtukbaiaipzevwugtrgxuxqgwlevtdtabxbcauvuwjqzngklgovnnjwcliigxeedcum") + .withPrefix("krxszffgjhffwcszyzttmujlinm") + .withPrefixPolicy(UsernameClaimPrefixPolicy.fromString("grjqszciuqlznueyltsmgec"))) + .withGroups(new GroupClaimProfile().withClaim("yrqawnseinzjlcevwxetagxeqkxoepjoctyrvddrfozociinj") + .withPrefix("ajnojzalbh"))) + .withValidationRules( + Arrays.asList(new TokenClaimValidationRule().withType(TokenValidationRuleType.REQUIRED_CLAIM) + .withRequiredClaim(new TokenRequiredClaim().withClaim("ciapdmvrnfitudpx") + .withRequiredValue("mqzzjiozgxfgflhdrnwawpke")))))) + .apply(); + } +} +``` + +### HcpOpenShiftClusters_CreateOrUpdate + +```java +import com.azure.resourcemanager.redhatopenshifthcp.models.ApiProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.ClusterAutoscalingProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.ClusterImageRegistryProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.ClusterImageRegistryState; +import com.azure.resourcemanager.redhatopenshifthcp.models.CryptoRestrictions; +import com.azure.resourcemanager.redhatopenshifthcp.models.CustomerManagedEncryptionProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.CustomerManagedEncryptionType; +import com.azure.resourcemanager.redhatopenshifthcp.models.DnsProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.EtcdDataEncryptionKeyManagementModeType; +import com.azure.resourcemanager.redhatopenshifthcp.models.EtcdDataEncryptionProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.EtcdProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.HcpOpenShiftClusterProperties; +import com.azure.resourcemanager.redhatopenshifthcp.models.ImageDigestMirror; +import com.azure.resourcemanager.redhatopenshifthcp.models.IngressProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.IngressType; +import com.azure.resourcemanager.redhatopenshifthcp.models.KeyVaultVisibility; +import com.azure.resourcemanager.redhatopenshifthcp.models.KmsEncryptionProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.KmsKey; +import com.azure.resourcemanager.redhatopenshifthcp.models.ManagedServiceIdentity; +import com.azure.resourcemanager.redhatopenshifthcp.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.redhatopenshifthcp.models.NetworkProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.NetworkType; +import com.azure.resourcemanager.redhatopenshifthcp.models.OperatorsAuthenticationProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.OutboundType; +import com.azure.resourcemanager.redhatopenshifthcp.models.PlatformProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.UserAssignedIdentitiesProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.UserAssignedIdentity; +import com.azure.resourcemanager.redhatopenshifthcp.models.VersionProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.Visibility; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for HcpOpenShiftClusters CreateOrUpdate. + */ +public final class HcpOpenShiftClustersCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-06-30-preview/HcpOpenShiftClusters_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: HcpOpenShiftClusters_CreateOrUpdate. + * + * @param manager Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ + public static void hcpOpenShiftClustersCreateOrUpdate( + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager) { + manager.hcpOpenShiftClusters() + .define("hcpCluster-name") + .withRegion("ayecbdqonsqfowbq") + .withExistingResourceGroup("rgopenapi") + .withTags(mapOf("key4181", "fakeTokenPlaceholder")) + .withProperties(new HcpOpenShiftClusterProperties() + .withVersion(new VersionProfile().withId("4.12").withChannelGroup("stable")) + .withDns(new DnsProfile().withBaseDomainPrefix("jcldjrtyebhrlxs")) + .withNetwork(new NetworkProfile().withNetworkType(NetworkType.OVNKUBERNETES) + .withPodCIDR("10.128.0.0/14") + .withServiceCIDR("172.30.0.0/16") + .withMachineCIDR("10.0.0.0/16") + .withHostPrefix(21)) + .withApi(new ApiProfile().withVisibility(Visibility.PUBLIC) + .withAuthorizedCIDRs(Arrays.asList("192.168.1.0/24", "10.0.0.0/16"))) + .withIngress(new IngressProfile().withType(IngressType.PUBLIC)) + .withPlatform(new PlatformProfile().withManagedResourceGroup("nhyhywrxupo") + .withSubnetId( + "/subscriptions/FDEA43EA-0230-4A7D-BDEE-F3AFF2183B1D/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/hcp-network-example/subnets/example-subnet") + .withVnetIntegrationSubnetId( + "/subscriptions/FDEA43EA-0230-4A7D-BDEE-F3AFF2183B1D/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/hcp-network-example/subnets/vnet-integration-subnet") + .withOutboundType(OutboundType.LOAD_BALANCER) + .withNetworkSecurityGroupId( + "/subscriptions/FDEA43EA-0230-4A7D-BDEE-F3AFF2183B1D/resourceGroups/resourceGroupName/providers/Microsoft.Network/networkSecurityGroups/nsg-example") + .withOperatorsAuthentication(new OperatorsAuthenticationProfile().withUserAssignedIdentities( + new UserAssignedIdentitiesProfile().withControlPlaneOperators(mapOf()) + .withDataPlaneOperators(mapOf()) + .withServiceManagedIdentity( + "/subscriptions/FDEA43EA-0230-4A7D-BDEE-F3AFF2183B1D/resourceGroups/rgopenapi/providers/Microsoft.ManagedIdentity/userAssignedIdentities/serviceMI")))) + .withAutoscaling(new ClusterAutoscalingProfile().withMaxNodesTotal(0) + .withMaxPodGracePeriodSeconds(0) + .withMaxNodeProvisionTimeSeconds(0) + .withPodPriorityThreshold(1)) + .withEtcd( + new EtcdProfile() + .withDataEncryption(new EtcdDataEncryptionProfile() + .withKeyManagementMode(EtcdDataEncryptionKeyManagementModeType.CUSTOMER_MANAGED) + .withCustomerManaged(new CustomerManagedEncryptionProfile() + .withEncryptionType(CustomerManagedEncryptionType.KMS) + .withKms(new KmsEncryptionProfile().withVaultName("my-cool-vault") + .withVisibility(KeyVaultVisibility.PUBLIC) + .withActiveKey(new KmsKey().withName("my-cool-key") + .withVersion("8e73e7d1fd7d4a87b730f676fc77d3a6")))))) + .withImageDigestMirrors(Arrays.asList( + new ImageDigestMirror().withSource("registry.example.com/image1") + .withMirrors(Arrays.asList("mirror1.example.com/image1", "mirror2.example.com/image1")), + new ImageDigestMirror().withSource("registry.example.com/image2") + .withMirrors(Arrays.asList("mirror1.example.com/image2")))) + .withNodeDrainTimeoutMinutes(20) + .withClusterImageRegistry( + new ClusterImageRegistryProfile().withState(ClusterImageRegistryState.ENABLED)) + .withCryptoRestrictions(CryptoRestrictions.NONE)) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/FDEA43EA-0230-4A7D-BDEE-F3AFF2183B1D/resourceGroups/rgopenapi/providers/Microsoft.ManagedIdentity/userAssignedIdentities/serviceMI", + new UserAssignedIdentity()))) + .create(); + } + + // 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; + } +} +``` + +### HcpOpenShiftClusters_Delete + +```java +/** + * Samples for HcpOpenShiftClusters Delete. + */ +public final class HcpOpenShiftClustersDeleteSamples { + /* + * x-ms-original-file: 2026-06-30-preview/HcpOpenShiftClusters_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: HcpOpenShiftClusters_Delete. + * + * @param manager Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ + public static void hcpOpenShiftClustersDelete( + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager) { + manager.hcpOpenShiftClusters().delete("rgopenapi", "hcpCluster-name", com.azure.core.util.Context.NONE); + } +} +``` + +### HcpOpenShiftClusters_GetByResourceGroup + +```java +/** + * Samples for HcpOpenShiftClusters GetByResourceGroup. + */ +public final class HcpOpenShiftClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-06-30-preview/HcpOpenShiftClusters_Get_MaximumSet_Gen.json + */ + /** + * Sample code: HcpOpenShiftClusters_Get. + * + * @param manager Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ + public static void hcpOpenShiftClustersGet( + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager) { + manager.hcpOpenShiftClusters() + .getByResourceGroupWithResponse("rgopenapi", "my-cool-cluster", com.azure.core.util.Context.NONE); + } +} +``` + +### HcpOpenShiftClusters_List + +```java +/** + * Samples for HcpOpenShiftClusters List. + */ +public final class HcpOpenShiftClustersListSamples { + /* + * x-ms-original-file: 2026-06-30-preview/HcpOpenShiftClusters_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: HcpOpenShiftClusters_ListBySubscription. + * + * @param manager Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ + public static void hcpOpenShiftClustersListBySubscription( + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager) { + manager.hcpOpenShiftClusters().list(com.azure.core.util.Context.NONE); + } +} +``` + +### HcpOpenShiftClusters_ListByResourceGroup + +```java +/** + * Samples for HcpOpenShiftClusters ListByResourceGroup. + */ +public final class HcpOpenShiftClustersListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-06-30-preview/HcpOpenShiftClusters_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: HcpOpenShiftClusters_ListByResourceGroup. + * + * @param manager Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ + public static void hcpOpenShiftClustersListByResourceGroup( + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager) { + manager.hcpOpenShiftClusters().listByResourceGroup("rgopenapi", com.azure.core.util.Context.NONE); + } +} +``` + +### HcpOpenShiftClusters_RequestAdminCredential + +```java +/** + * Samples for HcpOpenShiftClusters RequestAdminCredential. + */ +public final class HcpOpenShiftClustersRequestAdminCredentialSamples { + /* + * x-ms-original-file: 2026-06-30-preview/HcpOpenShiftClusters_RequestAdminCredential_MaximumSet_Gen.json + */ + /** + * Sample code: HcpOpenShiftClusters_RequestAdminCredential_MaximumSet. + * + * @param manager Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ + public static void hcpOpenShiftClustersRequestAdminCredentialMaximumSet( + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager) { + manager.hcpOpenShiftClusters() + .requestAdminCredential("rgopenapi", "hcpCluster-name", com.azure.core.util.Context.NONE); + } +} +``` + +### HcpOpenShiftClusters_RevokeCredentials + +```java +/** + * Samples for HcpOpenShiftClusters RevokeCredentials. + */ +public final class HcpOpenShiftClustersRevokeCredentialsSamples { + /* + * x-ms-original-file: 2026-06-30-preview/HcpOpenShiftClusters_RevokeCredentials_MaximumSet_Gen.json + */ + /** + * Sample code: HcpOpenShiftClusters_RevokeCredentials_MaximumSet. + * + * @param manager Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ + public static void hcpOpenShiftClustersRevokeCredentialsMaximumSet( + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager) { + manager.hcpOpenShiftClusters() + .revokeCredentials("rgopenapi", "hcpCluster-name", com.azure.core.util.Context.NONE); + } +} +``` + +### HcpOpenShiftClusters_Update + +```java +import com.azure.resourcemanager.redhatopenshifthcp.models.HcpOpenShiftCluster; +import com.azure.resourcemanager.redhatopenshifthcp.models.ManagedServiceIdentity; +import com.azure.resourcemanager.redhatopenshifthcp.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.redhatopenshifthcp.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for HcpOpenShiftClusters Update. + */ +public final class HcpOpenShiftClustersUpdateSamples { + /* + * x-ms-original-file: 2026-06-30-preview/HcpOpenShiftClusters_Update_MaximumSet_Gen.json + */ + /** + * Sample code: HcpOpenShiftClusters_Update. + * + * @param manager Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ + public static void hcpOpenShiftClustersUpdate( + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager) { + HcpOpenShiftCluster resource = manager.hcpOpenShiftClusters() + .getByResourceGroupWithResponse("rgopenapi", "hcpCluster-name", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key4965", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/FDEA43EA-0230-4A7D-BDEE-F3AFF2183B1D/resourceGroups/rgopenapi/providers/Microsoft.ManagedIdentity/userAssignedIdentities/serviceMI", + new UserAssignedIdentity()))) + .apply(); + } + + // 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; + } +} +``` + +### HcpOpenShiftVersions_Get + +```java +/** + * Samples for HcpOpenShiftVersions Get. + */ +public final class HcpOpenShiftVersionsGetSamples { + /* + * x-ms-original-file: 2026-06-30-preview/HcpOpenShiftVersions_Get_MaximumSet_Gen.json + */ + /** + * Sample code: HcpOpenShiftVersions_Get_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ + public static void hcpOpenShiftVersionsGetMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager) { + manager.hcpOpenShiftVersions().getWithResponse("uksouth", "4.18.1", com.azure.core.util.Context.NONE); + } +} +``` + +### HcpOpenShiftVersions_List + +```java +/** + * Samples for HcpOpenShiftVersions List. + */ +public final class HcpOpenShiftVersionsListSamples { + /* + * x-ms-original-file: 2026-06-30-preview/HcpOpenShiftVersions_List_MaximumSet_Gen.json + */ + /** + * Sample code: HcpOpenShiftVersions_List_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ + public static void hcpOpenShiftVersionsListMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager) { + manager.hcpOpenShiftVersions().list("uksouth", com.azure.core.util.Context.NONE); + } +} +``` + +### HcpOperatorIdentityRoleSets_Get + +```java +/** + * Samples for HcpOperatorIdentityRoleSets Get. + */ +public final class HcpOperatorIdentityRoleSetsGetSamples { + /* + * x-ms-original-file: 2026-06-30-preview/HcpOperatorIdentityRoleSets_Get_MaximumSet_Gen.json + */ + /** + * Sample code: HcpOperatorIdentityRoleSets_Get_MaximumSet. + * + * @param manager Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ + public static void hcpOperatorIdentityRoleSetsGetMaximumSet( + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager) { + manager.hcpOperatorIdentityRoleSets() + .getWithResponse("uksouth", "hcp-example-role-set", com.azure.core.util.Context.NONE); + } +} +``` + +### HcpOperatorIdentityRoleSets_List + +```java +/** + * Samples for HcpOperatorIdentityRoleSets List. + */ +public final class HcpOperatorIdentityRoleSetsListSamples { + /* + * x-ms-original-file: 2026-06-30-preview/HcpOperatorIdentityRoleSets_List_MaximumSet_Gen.json + */ + /** + * Sample code: HcpOperatorIdentityRoleSets_List_MaximumSet. + * + * @param manager Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ + public static void hcpOperatorIdentityRoleSetsListMaximumSet( + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager) { + manager.hcpOperatorIdentityRoleSets().list("uksouth", com.azure.core.util.Context.NONE); + } +} +``` + +### NodePools_CreateOrUpdate + +```java +import com.azure.resourcemanager.redhatopenshifthcp.models.DiskStorageAccountType; +import com.azure.resourcemanager.redhatopenshifthcp.models.Effect; +import com.azure.resourcemanager.redhatopenshifthcp.models.Label; +import com.azure.resourcemanager.redhatopenshifthcp.models.NodePoolAutoScaling; +import com.azure.resourcemanager.redhatopenshifthcp.models.NodePoolPlatformProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.NodePoolProperties; +import com.azure.resourcemanager.redhatopenshifthcp.models.NodePoolVersionProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.OsDiskProfile; +import com.azure.resourcemanager.redhatopenshifthcp.models.OsDiskType; +import com.azure.resourcemanager.redhatopenshifthcp.models.Taint; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NodePools CreateOrUpdate. + */ +public final class NodePoolsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-06-30-preview/NodePools_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: NodePools_CreateOrUpdate. + * + * @param manager Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ + public static void nodePoolsCreateOrUpdate( + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager) { + manager.nodePools() + .define("nodePool-name") + .withRegion("mqewzbuvnyxnwbmir") + .withExistingHcpOpenShiftCluster("rgopenapi", "hcpCluster-name") + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withProperties(new NodePoolProperties() + .withVersion(new NodePoolVersionProfile().withId("4.12").withChannelGroup("stable")) + .withPlatform(new NodePoolPlatformProfile().withSubnetId( + "/subscriptions/FDEA43EA-0230-4A7D-BDEE-F3AFF2183B1D/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/hcp-network-example/subnets/example-subnet") + .withVmSize("Standard_D2s_v3") + .withEnableEncryptionAtHost(true) + .withOsDisk(new OsDiskProfile().withSizeGiB(64) + .withDiskStorageAccountType(DiskStorageAccountType.PREMIUM_LRS) + .withEncryptionSetId( + "/subscriptions/FDEA43EA-0230-4A7D-BDEE-F3AFF2183B1D/resourceGroups/resourceGroupName/providers/Microsoft.Compute/diskEncryptionSets/hcp-disk-encryption-set-example") + .withDiskType(OsDiskType.MANAGED)) + .withAvailabilityZone("australiaeast-az1")) + .withReplicas(18) + .withAutoRepair(true) + .withAutoScaling(new NodePoolAutoScaling().withMin(6).withMax(29)) + .withLabels(Arrays.asList(new Label().withKey("fakeTokenPlaceholder").withValue("4.12"))) + .withTaints(Arrays + .asList(new Taint().withKey("fakeTokenPlaceholder").withValue("x").withEffect(Effect.NO_SCHEDULE))) + .withNodeDrainTimeoutMinutes(20)) + .create(); + } + + // 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; + } +} +``` + +### NodePools_Delete + +```java +/** + * Samples for NodePools Delete. + */ +public final class NodePoolsDeleteSamples { + /* + * x-ms-original-file: 2026-06-30-preview/NodePools_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: NodePools_Delete. + * + * @param manager Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ + public static void nodePoolsDelete( + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager) { + manager.nodePools().delete("rgopenapi", "hcpCluster-name", "nodePool-name", com.azure.core.util.Context.NONE); + } +} +``` + +### NodePools_Get + +```java +/** + * Samples for NodePools Get. + */ +public final class NodePoolsGetSamples { + /* + * x-ms-original-file: 2026-06-30-preview/NodePools_Get_MaximumSet_Gen.json + */ + /** + * Sample code: NodePools_Get. + * + * @param manager Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ + public static void + nodePoolsGet(com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager) { + manager.nodePools() + .getWithResponse("rgopenapi", "hcpCluster-name", "nodepool-name", com.azure.core.util.Context.NONE); + } +} +``` + +### NodePools_ListByParent + +```java +/** + * Samples for NodePools ListByParent. + */ +public final class NodePoolsListByParentSamples { + /* + * x-ms-original-file: 2026-06-30-preview/NodePools_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: NodePools_ListByParent. + * + * @param manager Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ + public static void nodePoolsListByParent( + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager) { + manager.nodePools().listByParent("rgopenapi", "hcpCluster-name", com.azure.core.util.Context.NONE); + } +} +``` + +### NodePools_Update + +```java +import com.azure.resourcemanager.redhatopenshifthcp.models.Effect; +import com.azure.resourcemanager.redhatopenshifthcp.models.Label; +import com.azure.resourcemanager.redhatopenshifthcp.models.ManagedServiceIdentity; +import com.azure.resourcemanager.redhatopenshifthcp.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.redhatopenshifthcp.models.NodePool; +import com.azure.resourcemanager.redhatopenshifthcp.models.NodePoolAutoScaling; +import com.azure.resourcemanager.redhatopenshifthcp.models.NodePoolProperties; +import com.azure.resourcemanager.redhatopenshifthcp.models.Taint; +import com.azure.resourcemanager.redhatopenshifthcp.models.UserAssignedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NodePools Update. + */ +public final class NodePoolsUpdateSamples { + /* + * x-ms-original-file: 2026-06-30-preview/NodePools_Update_MaximumSet_Gen.json + */ + /** + * Sample code: NodePools_Update. + * + * @param manager Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ + public static void nodePoolsUpdate( + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager) { + NodePool resource = manager.nodePools() + .getWithResponse("rgopenapi", "hcpCluster-name", "nodePool-name", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withProperties(new NodePoolProperties().withReplicas(7) + .withAutoScaling(new NodePoolAutoScaling().withMin(29).withMax(2)) + .withLabels(Arrays.asList(new Label().withKey("fakeTokenPlaceholder").withValue("4.12"))) + .withTaints(Arrays + .asList(new Taint().withKey("fakeTokenPlaceholder").withValue("x").withEffect(Effect.NO_SCHEDULE))) + .withNodeDrainTimeoutMinutes(20)) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("key4794", new UserAssignedIdentity()))) + .apply(); + } + + // 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; + } +} +``` + +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2026-06-30-preview/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List_Maximum. + * + * @param manager Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ + public static void operationsListMaximum( + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-30-preview/Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List_Minimum. + * + * @param manager Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ + public static void operationsListMinimum( + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/pom.xml b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/pom.xml new file mode 100644 index 000000000000..2446a0f48f04 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/pom.xml @@ -0,0 +1,74 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-redhatopenshifthcp + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Red Hat OpenShift Hosted Control Planes Management + This package contains Microsoft Azure SDK for Red Hat OpenShift Hosted Control Planes Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package api-version 2026-06-30-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + true + + + + com.azure + azure-core + 1.59.0 + + + com.azure + azure-core-management + 1.19.6 + + + com.azure + azure-core-test + 1.27.0-beta.17 + test + + + com.azure + azure-identity + 1.18.4 + test + + + diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/RedHatOpenShiftHostedControlPlanesManager.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/RedHatOpenShiftHostedControlPlanesManager.java new file mode 100644 index 000000000000..e1aacfaec2fb --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/RedHatOpenShiftHostedControlPlanesManager.java @@ -0,0 +1,367 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.RedHatOpenShiftHostedControlPlanesManagementClient; +import com.azure.resourcemanager.redhatopenshifthcp.implementation.ExternalAuthsImpl; +import com.azure.resourcemanager.redhatopenshifthcp.implementation.HcpOpenShiftClustersImpl; +import com.azure.resourcemanager.redhatopenshifthcp.implementation.HcpOpenShiftVersionsImpl; +import com.azure.resourcemanager.redhatopenshifthcp.implementation.HcpOperatorIdentityRoleSetsImpl; +import com.azure.resourcemanager.redhatopenshifthcp.implementation.NodePoolsImpl; +import com.azure.resourcemanager.redhatopenshifthcp.implementation.OperationsImpl; +import com.azure.resourcemanager.redhatopenshifthcp.implementation.RedHatOpenShiftHostedControlPlanesManagementClientBuilder; +import com.azure.resourcemanager.redhatopenshifthcp.models.ExternalAuths; +import com.azure.resourcemanager.redhatopenshifthcp.models.HcpOpenShiftClusters; +import com.azure.resourcemanager.redhatopenshifthcp.models.HcpOpenShiftVersions; +import com.azure.resourcemanager.redhatopenshifthcp.models.HcpOperatorIdentityRoleSets; +import com.azure.resourcemanager.redhatopenshifthcp.models.NodePools; +import com.azure.resourcemanager.redhatopenshifthcp.models.Operations; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to RedHatOpenShiftHostedControlPlanesManager. + */ +public final class RedHatOpenShiftHostedControlPlanesManager { + private Operations operations; + + private HcpOpenShiftClusters hcpOpenShiftClusters; + + private NodePools nodePools; + + private ExternalAuths externalAuths; + + private HcpOpenShiftVersions hcpOpenShiftVersions; + + private HcpOperatorIdentityRoleSets hcpOperatorIdentityRoleSets; + + private final RedHatOpenShiftHostedControlPlanesManagementClient clientObject; + + private RedHatOpenShiftHostedControlPlanesManager(HttpPipeline httpPipeline, AzureProfile profile, + Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new RedHatOpenShiftHostedControlPlanesManagementClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Red Hat OpenShift Hosted Control Planes service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Red Hat OpenShift Hosted Control Planes service API instance. + */ + public static RedHatOpenShiftHostedControlPlanesManager 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 Red Hat OpenShift Hosted Control Planes service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Red Hat OpenShift Hosted Control Planes service API instance. + */ + public static RedHatOpenShiftHostedControlPlanesManager authenticate(HttpPipeline httpPipeline, + AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new RedHatOpenShiftHostedControlPlanesManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create RedHatOpenShiftHostedControlPlanesManager with optional + * configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new RedHatOpenShiftHostedControlPlanesManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-redhatopenshifthcp.properties"); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Red Hat OpenShift Hosted Control Planes service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Red Hat OpenShift Hosted Control Planes service API instance. + */ + public RedHatOpenShiftHostedControlPlanesManager authenticate(TokenCredential credential, + AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.redhatopenshifthcp") + .append("/") + .append(clientVersion); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder.append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new RedHatOpenShiftHostedControlPlanesManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of HcpOpenShiftClusters. It manages HcpOpenShiftCluster. + * + * @return Resource collection API of HcpOpenShiftClusters. + */ + public HcpOpenShiftClusters hcpOpenShiftClusters() { + if (this.hcpOpenShiftClusters == null) { + this.hcpOpenShiftClusters = new HcpOpenShiftClustersImpl(clientObject.getHcpOpenShiftClusters(), this); + } + return hcpOpenShiftClusters; + } + + /** + * Gets the resource collection API of NodePools. It manages NodePool. + * + * @return Resource collection API of NodePools. + */ + public NodePools nodePools() { + if (this.nodePools == null) { + this.nodePools = new NodePoolsImpl(clientObject.getNodePools(), this); + } + return nodePools; + } + + /** + * Gets the resource collection API of ExternalAuths. It manages ExternalAuth. + * + * @return Resource collection API of ExternalAuths. + */ + public ExternalAuths externalAuths() { + if (this.externalAuths == null) { + this.externalAuths = new ExternalAuthsImpl(clientObject.getExternalAuths(), this); + } + return externalAuths; + } + + /** + * Gets the resource collection API of HcpOpenShiftVersions. + * + * @return Resource collection API of HcpOpenShiftVersions. + */ + public HcpOpenShiftVersions hcpOpenShiftVersions() { + if (this.hcpOpenShiftVersions == null) { + this.hcpOpenShiftVersions = new HcpOpenShiftVersionsImpl(clientObject.getHcpOpenShiftVersions(), this); + } + return hcpOpenShiftVersions; + } + + /** + * Gets the resource collection API of HcpOperatorIdentityRoleSets. + * + * @return Resource collection API of HcpOperatorIdentityRoleSets. + */ + public HcpOperatorIdentityRoleSets hcpOperatorIdentityRoleSets() { + if (this.hcpOperatorIdentityRoleSets == null) { + this.hcpOperatorIdentityRoleSets + = new HcpOperatorIdentityRoleSetsImpl(clientObject.getHcpOperatorIdentityRoleSets(), this); + } + return hcpOperatorIdentityRoleSets; + } + + /** + * Gets wrapped service client RedHatOpenShiftHostedControlPlanesManagementClient providing direct access to the + * underlying auto-generated API implementation, based on Azure REST API. + * + * @return Wrapped service client RedHatOpenShiftHostedControlPlanesManagementClient. + */ + public RedHatOpenShiftHostedControlPlanesManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/ExternalAuthsClient.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/ExternalAuthsClient.java new file mode 100644 index 000000000000..1c07d35cb2d7 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/ExternalAuthsClient.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.ExternalAuthInner; + +/** + * An instance of this class provides access to all the operations defined in ExternalAuthsClient. + */ +public interface ExternalAuthsClient { + /** + * Get a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @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 a ExternalAuth along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + String externalAuthName, Context context); + + /** + * Get a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @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 a ExternalAuth. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExternalAuthInner get(String resourceGroupName, String hcpOpenShiftClusterName, String externalAuthName); + + /** + * Create a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param resource Resource create parameters. + * @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 {@link SyncPoller} for polling of externalAuth resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExternalAuthInner> beginCreateOrUpdate(String resourceGroupName, + String hcpOpenShiftClusterName, String externalAuthName, ExternalAuthInner resource); + + /** + * Create a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param resource Resource create parameters. + * @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 {@link SyncPoller} for polling of externalAuth resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExternalAuthInner> beginCreateOrUpdate(String resourceGroupName, + String hcpOpenShiftClusterName, String externalAuthName, ExternalAuthInner resource, Context context); + + /** + * Create a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param resource Resource create parameters. + * @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 externalAuth resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExternalAuthInner createOrUpdate(String resourceGroupName, String hcpOpenShiftClusterName, String externalAuthName, + ExternalAuthInner resource); + + /** + * Create a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param resource Resource create parameters. + * @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 externalAuth resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExternalAuthInner createOrUpdate(String resourceGroupName, String hcpOpenShiftClusterName, String externalAuthName, + ExternalAuthInner resource, Context context); + + /** + * Update a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param properties The resource properties to be updated. + * @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 {@link SyncPoller} for polling of externalAuth resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExternalAuthInner> beginUpdate(String resourceGroupName, + String hcpOpenShiftClusterName, String externalAuthName, ExternalAuthInner properties); + + /** + * Update a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param properties The resource properties to be updated. + * @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 {@link SyncPoller} for polling of externalAuth resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExternalAuthInner> beginUpdate(String resourceGroupName, + String hcpOpenShiftClusterName, String externalAuthName, ExternalAuthInner properties, Context context); + + /** + * Update a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param properties The resource properties to be updated. + * @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 externalAuth resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExternalAuthInner update(String resourceGroupName, String hcpOpenShiftClusterName, String externalAuthName, + ExternalAuthInner properties); + + /** + * Update a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param properties The resource properties to be updated. + * @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 externalAuth resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExternalAuthInner update(String resourceGroupName, String hcpOpenShiftClusterName, String externalAuthName, + ExternalAuthInner properties, Context context); + + /** + * Delete a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String hcpOpenShiftClusterName, + String externalAuthName); + + /** + * Delete a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String hcpOpenShiftClusterName, + String externalAuthName, Context context); + + /** + * Delete a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String hcpOpenShiftClusterName, String externalAuthName); + + /** + * Delete a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String hcpOpenShiftClusterName, String externalAuthName, Context context); + + /** + * List ExternalAuth resources by HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 response of a ExternalAuth list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String hcpOpenShiftClusterName); + + /** + * List ExternalAuth resources by HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 response of a ExternalAuth list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String hcpOpenShiftClusterName, + Context context); +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/HcpOpenShiftClustersClient.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/HcpOpenShiftClustersClient.java new file mode 100644 index 000000000000..07516b3840db --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/HcpOpenShiftClustersClient.java @@ -0,0 +1,383 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOpenShiftClusterAdminCredentialInner; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOpenShiftClusterInner; + +/** + * An instance of this class provides access to all the operations defined in HcpOpenShiftClustersClient. + */ +public interface HcpOpenShiftClustersClient { + /** + * Get a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 a HcpOpenShiftCluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String hcpOpenShiftClusterName, Context context); + + /** + * Get a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 a HcpOpenShiftCluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HcpOpenShiftClusterInner getByResourceGroup(String resourceGroupName, String hcpOpenShiftClusterName); + + /** + * Create a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param resource Resource create parameters. + * @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 {@link SyncPoller} for polling of hCP cluster resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HcpOpenShiftClusterInner> beginCreateOrUpdate( + String resourceGroupName, String hcpOpenShiftClusterName, HcpOpenShiftClusterInner resource); + + /** + * Create a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param resource Resource create parameters. + * @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 {@link SyncPoller} for polling of hCP cluster resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HcpOpenShiftClusterInner> beginCreateOrUpdate( + String resourceGroupName, String hcpOpenShiftClusterName, HcpOpenShiftClusterInner resource, Context context); + + /** + * Create a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param resource Resource create parameters. + * @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 hCP cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HcpOpenShiftClusterInner createOrUpdate(String resourceGroupName, String hcpOpenShiftClusterName, + HcpOpenShiftClusterInner resource); + + /** + * Create a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param resource Resource create parameters. + * @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 hCP cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HcpOpenShiftClusterInner createOrUpdate(String resourceGroupName, String hcpOpenShiftClusterName, + HcpOpenShiftClusterInner resource, Context context); + + /** + * Update a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param properties The resource properties to be updated. + * @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 {@link SyncPoller} for polling of hCP cluster resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HcpOpenShiftClusterInner> beginUpdate(String resourceGroupName, + String hcpOpenShiftClusterName, HcpOpenShiftClusterInner properties); + + /** + * Update a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param properties The resource properties to be updated. + * @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 {@link SyncPoller} for polling of hCP cluster resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HcpOpenShiftClusterInner> beginUpdate(String resourceGroupName, + String hcpOpenShiftClusterName, HcpOpenShiftClusterInner properties, Context context); + + /** + * Update a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param properties The resource properties to be updated. + * @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 hCP cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HcpOpenShiftClusterInner update(String resourceGroupName, String hcpOpenShiftClusterName, + HcpOpenShiftClusterInner properties); + + /** + * Update a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param properties The resource properties to be updated. + * @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 hCP cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HcpOpenShiftClusterInner update(String resourceGroupName, String hcpOpenShiftClusterName, + HcpOpenShiftClusterInner properties, Context context); + + /** + * Delete a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String hcpOpenShiftClusterName); + + /** + * Delete a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String hcpOpenShiftClusterName, + Context context); + + /** + * Delete a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String hcpOpenShiftClusterName); + + /** + * Delete a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String hcpOpenShiftClusterName, Context context); + + /** + * List HcpOpenShiftCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HcpOpenShiftCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List HcpOpenShiftCluster resources by 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 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 response of a HcpOpenShiftCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List HcpOpenShiftCluster resources by subscription ID. + * + * @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 response of a HcpOpenShiftCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List HcpOpenShiftCluster resources by subscription ID. + * + * @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 response of a HcpOpenShiftCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Request a temporary admin kubeconfig for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 {@link SyncPoller} for polling of hCP cluster admin credential. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HcpOpenShiftClusterAdminCredentialInner> + beginRequestAdminCredential(String resourceGroupName, String hcpOpenShiftClusterName); + + /** + * Request a temporary admin kubeconfig for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 {@link SyncPoller} for polling of hCP cluster admin credential. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HcpOpenShiftClusterAdminCredentialInner> + beginRequestAdminCredential(String resourceGroupName, String hcpOpenShiftClusterName, Context context); + + /** + * Request a temporary admin kubeconfig for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 hCP cluster admin credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HcpOpenShiftClusterAdminCredentialInner requestAdminCredential(String resourceGroupName, + String hcpOpenShiftClusterName); + + /** + * Request a temporary admin kubeconfig for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 hCP cluster admin credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HcpOpenShiftClusterAdminCredentialInner requestAdminCredential(String resourceGroupName, + String hcpOpenShiftClusterName, Context context); + + /** + * Revoke all credentials issued by requestAdminCredential. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRevokeCredentials(String resourceGroupName, String hcpOpenShiftClusterName); + + /** + * Revoke all credentials issued by requestAdminCredential. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRevokeCredentials(String resourceGroupName, String hcpOpenShiftClusterName, + Context context); + + /** + * Revoke all credentials issued by requestAdminCredential. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void revokeCredentials(String resourceGroupName, String hcpOpenShiftClusterName); + + /** + * Revoke all credentials issued by requestAdminCredential. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void revokeCredentials(String resourceGroupName, String hcpOpenShiftClusterName, Context context); +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/HcpOpenShiftVersionsClient.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/HcpOpenShiftVersionsClient.java new file mode 100644 index 000000000000..c9fe4b0ba813 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/HcpOpenShiftVersionsClient.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOpenShiftVersionInner; + +/** + * An instance of this class provides access to all the operations defined in HcpOpenShiftVersionsClient. + */ +public interface HcpOpenShiftVersionsClient { + /** + * Get a HcpOpenShiftVersion. + * + * @param location The name of the Azure region. + * @param hcpOpenShiftVersionName The name of the HcpOpenShiftVersion. + * @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 a HcpOpenShiftVersion along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String location, String hcpOpenShiftVersionName, + Context context); + + /** + * Get a HcpOpenShiftVersion. + * + * @param location The name of the Azure region. + * @param hcpOpenShiftVersionName The name of the HcpOpenShiftVersion. + * @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 a HcpOpenShiftVersion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HcpOpenShiftVersionInner get(String location, String hcpOpenShiftVersionName); + + /** + * List HcpOpenShiftVersion resources by SubscriptionLocationResource. + * + * @param location The name of the Azure region. + * @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 response of a HcpOpenShiftVersion list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * List HcpOpenShiftVersion resources by SubscriptionLocationResource. + * + * @param location The name of the Azure region. + * @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 response of a HcpOpenShiftVersion list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/HcpOperatorIdentityRoleSetsClient.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/HcpOperatorIdentityRoleSetsClient.java new file mode 100644 index 000000000000..3e03c69099b1 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/HcpOperatorIdentityRoleSetsClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOperatorIdentityRoleSetInner; + +/** + * An instance of this class provides access to all the operations defined in HcpOperatorIdentityRoleSetsClient. + */ +public interface HcpOperatorIdentityRoleSetsClient { + /** + * List HcpOperatorIdentityRoleSet resources by SubscriptionLocationResource. + * + * @param location The name of the Azure region. + * @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 response of a HcpOperatorIdentityRoleSet list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * List HcpOperatorIdentityRoleSet resources by SubscriptionLocationResource. + * + * @param location The name of the Azure region. + * @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 response of a HcpOperatorIdentityRoleSet list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); + + /** + * Get a HcpOperatorIdentityRoleSet. + * + * @param location The name of the Azure region. + * @param hcpOperatorIdentityRoleSetName The OpenShift minor version these identities are required for. + * @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 a HcpOperatorIdentityRoleSet along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String location, String hcpOperatorIdentityRoleSetName, + Context context); + + /** + * Get a HcpOperatorIdentityRoleSet. + * + * @param location The name of the Azure region. + * @param hcpOperatorIdentityRoleSetName The OpenShift minor version these identities are required for. + * @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 a HcpOperatorIdentityRoleSet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HcpOperatorIdentityRoleSetInner get(String location, String hcpOperatorIdentityRoleSetName); +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/NodePoolsClient.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/NodePoolsClient.java new file mode 100644 index 000000000000..df1f589eeacb --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/NodePoolsClient.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.NodePoolInner; + +/** + * An instance of this class provides access to all the operations defined in NodePoolsClient. + */ +public interface NodePoolsClient { + /** + * Get a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @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 a NodePool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + String nodePoolName, Context context); + + /** + * Get a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @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 a NodePool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NodePoolInner get(String resourceGroupName, String hcpOpenShiftClusterName, String nodePoolName); + + /** + * Create a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param resource Resource create parameters. + * @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 {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NodePoolInner> beginCreateOrUpdate(String resourceGroupName, + String hcpOpenShiftClusterName, String nodePoolName, NodePoolInner resource); + + /** + * Create a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param resource Resource create parameters. + * @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 {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NodePoolInner> beginCreateOrUpdate(String resourceGroupName, + String hcpOpenShiftClusterName, String nodePoolName, NodePoolInner resource, Context context); + + /** + * Create a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param resource Resource create parameters. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NodePoolInner createOrUpdate(String resourceGroupName, String hcpOpenShiftClusterName, String nodePoolName, + NodePoolInner resource); + + /** + * Create a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param resource Resource create parameters. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NodePoolInner createOrUpdate(String resourceGroupName, String hcpOpenShiftClusterName, String nodePoolName, + NodePoolInner resource, Context context); + + /** + * Update a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param properties The resource properties to be updated. + * @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 {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NodePoolInner> beginUpdate(String resourceGroupName, + String hcpOpenShiftClusterName, String nodePoolName, NodePoolInner properties); + + /** + * Update a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param properties The resource properties to be updated. + * @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 {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NodePoolInner> beginUpdate(String resourceGroupName, + String hcpOpenShiftClusterName, String nodePoolName, NodePoolInner properties, Context context); + + /** + * Update a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param properties The resource properties to be updated. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NodePoolInner update(String resourceGroupName, String hcpOpenShiftClusterName, String nodePoolName, + NodePoolInner properties); + + /** + * Update a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param properties The resource properties to be updated. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NodePoolInner update(String resourceGroupName, String hcpOpenShiftClusterName, String nodePoolName, + NodePoolInner properties, Context context); + + /** + * Delete a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String hcpOpenShiftClusterName, + String nodePoolName); + + /** + * Delete a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String hcpOpenShiftClusterName, + String nodePoolName, Context context); + + /** + * Delete a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String hcpOpenShiftClusterName, String nodePoolName); + + /** + * Delete a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String hcpOpenShiftClusterName, String nodePoolName, Context context); + + /** + * List NodePool resources by HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 response of a NodePool list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String hcpOpenShiftClusterName); + + /** + * List NodePool resources by HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 response of a NodePool list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String hcpOpenShiftClusterName, + Context context); +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/OperationsClient.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/OperationsClient.java new file mode 100644 index 000000000000..401d638b6119 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/OperationsClient.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.OperationInner; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public interface OperationsClient { + /** + * 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 a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List the operations for the provider. + * + * @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 a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/RedHatOpenShiftHostedControlPlanesManagementClient.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/RedHatOpenShiftHostedControlPlanesManagementClient.java new file mode 100644 index 000000000000..22a67f375b3c --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/RedHatOpenShiftHostedControlPlanesManagementClient.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for RedHatOpenShiftHostedControlPlanesManagementClient class. + */ +public interface RedHatOpenShiftHostedControlPlanesManagementClient { + /** + * Gets Service host. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * 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. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the HcpOpenShiftClustersClient object to access its operations. + * + * @return the HcpOpenShiftClustersClient object. + */ + HcpOpenShiftClustersClient getHcpOpenShiftClusters(); + + /** + * Gets the NodePoolsClient object to access its operations. + * + * @return the NodePoolsClient object. + */ + NodePoolsClient getNodePools(); + + /** + * Gets the ExternalAuthsClient object to access its operations. + * + * @return the ExternalAuthsClient object. + */ + ExternalAuthsClient getExternalAuths(); + + /** + * Gets the HcpOpenShiftVersionsClient object to access its operations. + * + * @return the HcpOpenShiftVersionsClient object. + */ + HcpOpenShiftVersionsClient getHcpOpenShiftVersions(); + + /** + * Gets the HcpOperatorIdentityRoleSetsClient object to access its operations. + * + * @return the HcpOperatorIdentityRoleSetsClient object. + */ + HcpOperatorIdentityRoleSetsClient getHcpOperatorIdentityRoleSets(); +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/ExternalAuthInner.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/ExternalAuthInner.java new file mode 100644 index 000000000000..6dc804e1de82 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/ExternalAuthInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.redhatopenshifthcp.models.ExternalAuthProperties; +import java.io.IOException; + +/** + * ExternalAuth resource. + */ +@Fluent +public final class ExternalAuthInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private ExternalAuthProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ExternalAuthInner class. + */ + public ExternalAuthInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ExternalAuthProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the ExternalAuthInner object itself. + */ + public ExternalAuthInner withProperties(ExternalAuthProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExternalAuthInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExternalAuthInner 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 ExternalAuthInner. + */ + public static ExternalAuthInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExternalAuthInner deserializedExternalAuthInner = new ExternalAuthInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedExternalAuthInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedExternalAuthInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExternalAuthInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedExternalAuthInner.properties = ExternalAuthProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedExternalAuthInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExternalAuthInner; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/HcpOpenShiftClusterAdminCredentialInner.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/HcpOpenShiftClusterAdminCredentialInner.java new file mode 100644 index 000000000000..2701b6944707 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/HcpOpenShiftClusterAdminCredentialInner.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * HCP cluster admin credential. + */ +@Immutable +public final class HcpOpenShiftClusterAdminCredentialInner + implements JsonSerializable { + /* + * Admin kubeconfig with a temporary client certificate + */ + private String kubeconfig; + + /* + * Expiration timestamp for the kubeconfig's client certificate + */ + private OffsetDateTime expirationTimestamp; + + /** + * Creates an instance of HcpOpenShiftClusterAdminCredentialInner class. + */ + private HcpOpenShiftClusterAdminCredentialInner() { + } + + /** + * Get the kubeconfig property: Admin kubeconfig with a temporary client certificate. + * + * @return the kubeconfig value. + */ + public String kubeconfig() { + return this.kubeconfig; + } + + /** + * Get the expirationTimestamp property: Expiration timestamp for the kubeconfig's client certificate. + * + * @return the expirationTimestamp value. + */ + public OffsetDateTime expirationTimestamp() { + return this.expirationTimestamp; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HcpOpenShiftClusterAdminCredentialInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HcpOpenShiftClusterAdminCredentialInner 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 HcpOpenShiftClusterAdminCredentialInner. + */ + public static HcpOpenShiftClusterAdminCredentialInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HcpOpenShiftClusterAdminCredentialInner deserializedHcpOpenShiftClusterAdminCredentialInner + = new HcpOpenShiftClusterAdminCredentialInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kubeconfig".equals(fieldName)) { + deserializedHcpOpenShiftClusterAdminCredentialInner.kubeconfig = reader.getString(); + } else if ("expirationTimestamp".equals(fieldName)) { + deserializedHcpOpenShiftClusterAdminCredentialInner.expirationTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedHcpOpenShiftClusterAdminCredentialInner; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/HcpOpenShiftClusterInner.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/HcpOpenShiftClusterInner.java new file mode 100644 index 000000000000..d8c63701a75b --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/HcpOpenShiftClusterInner.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.redhatopenshifthcp.models.HcpOpenShiftClusterProperties; +import com.azure.resourcemanager.redhatopenshifthcp.models.ManagedServiceIdentity; +import java.io.IOException; +import java.util.Map; + +/** + * HCP cluster resource. + */ +@Fluent +public final class HcpOpenShiftClusterInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private HcpOpenShiftClusterProperties properties; + + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of HcpOpenShiftClusterInner class. + */ + public HcpOpenShiftClusterInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public HcpOpenShiftClusterProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the HcpOpenShiftClusterInner object itself. + */ + public HcpOpenShiftClusterInner withProperties(HcpOpenShiftClusterProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the HcpOpenShiftClusterInner object itself. + */ + public HcpOpenShiftClusterInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public HcpOpenShiftClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HcpOpenShiftClusterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HcpOpenShiftClusterInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HcpOpenShiftClusterInner 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 HcpOpenShiftClusterInner. + */ + public static HcpOpenShiftClusterInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HcpOpenShiftClusterInner deserializedHcpOpenShiftClusterInner = new HcpOpenShiftClusterInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedHcpOpenShiftClusterInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedHcpOpenShiftClusterInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedHcpOpenShiftClusterInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedHcpOpenShiftClusterInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedHcpOpenShiftClusterInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedHcpOpenShiftClusterInner.properties = HcpOpenShiftClusterProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedHcpOpenShiftClusterInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedHcpOpenShiftClusterInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHcpOpenShiftClusterInner; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/HcpOpenShiftVersionInner.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/HcpOpenShiftVersionInner.java new file mode 100644 index 000000000000..014bb834736b --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/HcpOpenShiftVersionInner.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.redhatopenshifthcp.models.HcpOpenShiftVersionProperties; +import java.io.IOException; + +/** + * HcpOpenShiftVersion represents a location based available HCP OpenShift version. + */ +@Immutable +public final class HcpOpenShiftVersionInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private HcpOpenShiftVersionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of HcpOpenShiftVersionInner class. + */ + private HcpOpenShiftVersionInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public HcpOpenShiftVersionProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HcpOpenShiftVersionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HcpOpenShiftVersionInner 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 HcpOpenShiftVersionInner. + */ + public static HcpOpenShiftVersionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HcpOpenShiftVersionInner deserializedHcpOpenShiftVersionInner = new HcpOpenShiftVersionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedHcpOpenShiftVersionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedHcpOpenShiftVersionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedHcpOpenShiftVersionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedHcpOpenShiftVersionInner.properties = HcpOpenShiftVersionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedHcpOpenShiftVersionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHcpOpenShiftVersionInner; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/HcpOperatorIdentityRoleSetInner.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/HcpOperatorIdentityRoleSetInner.java new file mode 100644 index 000000000000..072214fa5430 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/HcpOperatorIdentityRoleSetInner.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.redhatopenshifthcp.models.HcpOperatorIdentityRoleSetProperties; +import java.io.IOException; + +/** + * HcpOperatorIdentityRoles represents a location based representation of + * the required platform workload identities and their required roles for a given + * OpenShift version. + */ +@Immutable +public final class HcpOperatorIdentityRoleSetInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private HcpOperatorIdentityRoleSetProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of HcpOperatorIdentityRoleSetInner class. + */ + private HcpOperatorIdentityRoleSetInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public HcpOperatorIdentityRoleSetProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HcpOperatorIdentityRoleSetInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HcpOperatorIdentityRoleSetInner 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 HcpOperatorIdentityRoleSetInner. + */ + public static HcpOperatorIdentityRoleSetInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HcpOperatorIdentityRoleSetInner deserializedHcpOperatorIdentityRoleSetInner + = new HcpOperatorIdentityRoleSetInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedHcpOperatorIdentityRoleSetInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedHcpOperatorIdentityRoleSetInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedHcpOperatorIdentityRoleSetInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedHcpOperatorIdentityRoleSetInner.properties + = HcpOperatorIdentityRoleSetProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedHcpOperatorIdentityRoleSetInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHcpOperatorIdentityRoleSetInner; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/NodePoolInner.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/NodePoolInner.java new file mode 100644 index 000000000000..298b21731f40 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/NodePoolInner.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.redhatopenshifthcp.models.ManagedServiceIdentity; +import com.azure.resourcemanager.redhatopenshifthcp.models.NodePoolProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Concrete tracked resource types can be created by aliasing this type using a specific property type. + */ +@Fluent +public final class NodePoolInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private NodePoolProperties properties; + + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of NodePoolInner class. + */ + public NodePoolInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public NodePoolProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the NodePoolInner object itself. + */ + public NodePoolInner withProperties(NodePoolProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the NodePoolInner object itself. + */ + public NodePoolInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public NodePoolInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NodePoolInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NodePoolInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NodePoolInner 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 NodePoolInner. + */ + public static NodePoolInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NodePoolInner deserializedNodePoolInner = new NodePoolInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNodePoolInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNodePoolInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNodePoolInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedNodePoolInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNodePoolInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedNodePoolInner.properties = NodePoolProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedNodePoolInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNodePoolInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNodePoolInner; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/OperationInner.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/OperationInner.java new file mode 100644 index 000000000000..54bfdc8b77f4 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/OperationInner.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.redhatopenshifthcp.models.ActionType; +import com.azure.resourcemanager.redhatopenshifthcp.models.OperationDisplay; +import com.azure.resourcemanager.redhatopenshifthcp.models.Origin; +import java.io.IOException; + +/** + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Immutable +public final class OperationInner implements JsonSerializable { + /* + * 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; + + /* + * 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. + */ + private OperationInner() { + } + + /** + * 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. + */ + public String name() { + return this.name; + } + + /** + * 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. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + 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(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/package-info.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/package-info.java new file mode 100644 index 000000000000..b177927ff5a1 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/models/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the inner data models for RedHatOpenShiftHostedControlPlanes. + */ +package com.azure.resourcemanager.redhatopenshifthcp.fluent.models; diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/package-info.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/package-info.java new file mode 100644 index 000000000000..82e36a6dc6a3 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/fluent/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the service clients for RedHatOpenShiftHostedControlPlanes. + */ +package com.azure.resourcemanager.redhatopenshifthcp.fluent; diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/ExternalAuthImpl.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/ExternalAuthImpl.java new file mode 100644 index 000000000000..db2a34f92e86 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/ExternalAuthImpl.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.ExternalAuthInner; +import com.azure.resourcemanager.redhatopenshifthcp.models.ExternalAuth; +import com.azure.resourcemanager.redhatopenshifthcp.models.ExternalAuthProperties; + +public final class ExternalAuthImpl implements ExternalAuth, ExternalAuth.Definition, ExternalAuth.Update { + private ExternalAuthInner innerObject; + + private final com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ExternalAuthProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ExternalAuthInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String hcpOpenShiftClusterName; + + private String externalAuthName; + + public ExternalAuthImpl withExistingHcpOpenShiftCluster(String resourceGroupName, String hcpOpenShiftClusterName) { + this.resourceGroupName = resourceGroupName; + this.hcpOpenShiftClusterName = hcpOpenShiftClusterName; + return this; + } + + public ExternalAuth create() { + this.innerObject = serviceManager.serviceClient() + .getExternalAuths() + .createOrUpdate(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, this.innerModel(), + Context.NONE); + return this; + } + + public ExternalAuth create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getExternalAuths() + .createOrUpdate(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, this.innerModel(), context); + return this; + } + + ExternalAuthImpl(String name, + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager) { + this.innerObject = new ExternalAuthInner(); + this.serviceManager = serviceManager; + this.externalAuthName = name; + } + + public ExternalAuthImpl update() { + return this; + } + + public ExternalAuth apply() { + this.innerObject = serviceManager.serviceClient() + .getExternalAuths() + .update(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, this.innerModel(), Context.NONE); + return this; + } + + public ExternalAuth apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getExternalAuths() + .update(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, this.innerModel(), context); + return this; + } + + ExternalAuthImpl(ExternalAuthInner innerObject, + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.hcpOpenShiftClusterName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "hcpOpenShiftClusters"); + this.externalAuthName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "externalAuths"); + } + + public ExternalAuth refresh() { + this.innerObject = serviceManager.serviceClient() + .getExternalAuths() + .getWithResponse(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, Context.NONE) + .getValue(); + return this; + } + + public ExternalAuth refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getExternalAuths() + .getWithResponse(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, context) + .getValue(); + return this; + } + + public ExternalAuthImpl withProperties(ExternalAuthProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/ExternalAuthsClientImpl.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/ExternalAuthsClientImpl.java new file mode 100644 index 000000000000..394d56b6c960 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/ExternalAuthsClientImpl.java @@ -0,0 +1,993 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.ExternalAuthsClient; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.ExternalAuthInner; +import com.azure.resourcemanager.redhatopenshifthcp.implementation.models.ExternalAuthListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ExternalAuthsClient. + */ +public final class ExternalAuthsClientImpl implements ExternalAuthsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ExternalAuthsService service; + + /** + * The service client containing this operation class. + */ + private final RedHatOpenShiftHostedControlPlanesManagementClientImpl client; + + /** + * Initializes an instance of ExternalAuthsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExternalAuthsClientImpl(RedHatOpenShiftHostedControlPlanesManagementClientImpl client) { + this.service + = RestProxy.create(ExternalAuthsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RedHatOpenShiftHostedControlPlanesManagementClientExternalAuths to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RedHatOpenShiftHostedControlPlanesManagementClientExternalAuths") + public interface ExternalAuthsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/externalAuths/{externalAuthName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, + @PathParam("externalAuthName") String externalAuthName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/externalAuths/{externalAuthName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, + @PathParam("externalAuthName") String externalAuthName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/externalAuths/{externalAuthName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, + @PathParam("externalAuthName") String externalAuthName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ExternalAuthInner resource, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/externalAuths/{externalAuthName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, + @PathParam("externalAuthName") String externalAuthName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ExternalAuthInner resource, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/externalAuths/{externalAuthName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, + @PathParam("externalAuthName") String externalAuthName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ExternalAuthInner properties, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/externalAuths/{externalAuthName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, + @PathParam("externalAuthName") String externalAuthName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ExternalAuthInner properties, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/externalAuths/{externalAuthName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, + @PathParam("externalAuthName") String externalAuthName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/externalAuths/{externalAuthName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, + @PathParam("externalAuthName") String externalAuthName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/externalAuths") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/externalAuths") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByParentSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParentNext( + @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 listByParentNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @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 ExternalAuth along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String hcpOpenShiftClusterName, String externalAuthName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, externalAuthName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @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 ExternalAuth on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String hcpOpenShiftClusterName, + String externalAuthName) { + return getWithResponseAsync(resourceGroupName, hcpOpenShiftClusterName, externalAuthName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @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 ExternalAuth along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + String externalAuthName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hcpOpenShiftClusterName, externalAuthName, accept, context); + } + + /** + * Get a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @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 ExternalAuth. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExternalAuthInner get(String resourceGroupName, String hcpOpenShiftClusterName, String externalAuthName) { + return getWithResponse(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, Context.NONE).getValue(); + } + + /** + * Create a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param resource Resource create parameters. + * @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 externalAuth resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String hcpOpenShiftClusterName, String externalAuthName, ExternalAuthInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, externalAuthName, + contentType, accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param resource Resource create parameters. + * @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 externalAuth resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + String externalAuthName, ExternalAuthInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, externalAuthName, contentType, + accept, resource, Context.NONE); + } + + /** + * Create a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param resource Resource create parameters. + * @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 externalAuth resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + String externalAuthName, ExternalAuthInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, externalAuthName, contentType, + accept, resource, context); + } + + /** + * Create a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param resource Resource create parameters. + * @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 externalAuth resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ExternalAuthInner> beginCreateOrUpdateAsync( + String resourceGroupName, String hcpOpenShiftClusterName, String externalAuthName, ExternalAuthInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ExternalAuthInner.class, ExternalAuthInner.class, this.client.getContext()); + } + + /** + * Create a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param resource Resource create parameters. + * @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 externalAuth resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExternalAuthInner> beginCreateOrUpdate(String resourceGroupName, + String hcpOpenShiftClusterName, String externalAuthName, ExternalAuthInner resource) { + Response response + = createOrUpdateWithResponse(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, resource); + return this.client.getLroResult(response, ExternalAuthInner.class, + ExternalAuthInner.class, Context.NONE); + } + + /** + * Create a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param resource Resource create parameters. + * @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 externalAuth resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExternalAuthInner> beginCreateOrUpdate(String resourceGroupName, + String hcpOpenShiftClusterName, String externalAuthName, ExternalAuthInner resource, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, hcpOpenShiftClusterName, + externalAuthName, resource, context); + return this.client.getLroResult(response, ExternalAuthInner.class, + ExternalAuthInner.class, context); + } + + /** + * Create a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param resource Resource create parameters. + * @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 externalAuth resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String hcpOpenShiftClusterName, + String externalAuthName, ExternalAuthInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param resource Resource create parameters. + * @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 externalAuth resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExternalAuthInner createOrUpdate(String resourceGroupName, String hcpOpenShiftClusterName, + String externalAuthName, ExternalAuthInner resource) { + return beginCreateOrUpdate(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, resource) + .getFinalResult(); + } + + /** + * Create a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param resource Resource create parameters. + * @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 externalAuth resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExternalAuthInner createOrUpdate(String resourceGroupName, String hcpOpenShiftClusterName, + String externalAuthName, ExternalAuthInner resource, Context context) { + return beginCreateOrUpdate(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, resource, context) + .getFinalResult(); + } + + /** + * Update a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param properties The resource properties to be updated. + * @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 externalAuth resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, + String hcpOpenShiftClusterName, String externalAuthName, ExternalAuthInner properties) { + 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, hcpOpenShiftClusterName, externalAuthName, + contentType, accept, properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param properties The resource properties to be updated. + * @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 externalAuth resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + String externalAuthName, ExternalAuthInner properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, externalAuthName, contentType, + accept, properties, Context.NONE); + } + + /** + * Update a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param properties The resource properties to be updated. + * @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 externalAuth resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + String externalAuthName, ExternalAuthInner properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, externalAuthName, contentType, + accept, properties, context); + } + + /** + * Update a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param properties The resource properties to be updated. + * @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 externalAuth resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ExternalAuthInner> beginUpdateAsync(String resourceGroupName, + String hcpOpenShiftClusterName, String externalAuthName, ExternalAuthInner properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ExternalAuthInner.class, ExternalAuthInner.class, this.client.getContext()); + } + + /** + * Update a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param properties The resource properties to be updated. + * @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 externalAuth resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExternalAuthInner> beginUpdate(String resourceGroupName, + String hcpOpenShiftClusterName, String externalAuthName, ExternalAuthInner properties) { + Response response + = updateWithResponse(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, properties); + return this.client.getLroResult(response, ExternalAuthInner.class, + ExternalAuthInner.class, Context.NONE); + } + + /** + * Update a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param properties The resource properties to be updated. + * @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 externalAuth resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExternalAuthInner> beginUpdate(String resourceGroupName, + String hcpOpenShiftClusterName, String externalAuthName, ExternalAuthInner properties, Context context) { + Response response + = updateWithResponse(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, properties, context); + return this.client.getLroResult(response, ExternalAuthInner.class, + ExternalAuthInner.class, context); + } + + /** + * Update a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param properties The resource properties to be updated. + * @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 externalAuth resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String hcpOpenShiftClusterName, + String externalAuthName, ExternalAuthInner properties) { + return beginUpdateAsync(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param properties The resource properties to be updated. + * @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 externalAuth resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExternalAuthInner update(String resourceGroupName, String hcpOpenShiftClusterName, String externalAuthName, + ExternalAuthInner properties) { + return beginUpdate(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, properties).getFinalResult(); + } + + /** + * Update a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @param properties The resource properties to be updated. + * @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 externalAuth resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExternalAuthInner update(String resourceGroupName, String hcpOpenShiftClusterName, String externalAuthName, + ExternalAuthInner properties, Context context) { + return beginUpdate(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, properties, context) + .getFinalResult(); + } + + /** + * Delete a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String hcpOpenShiftClusterName, String externalAuthName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, externalAuthName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + String externalAuthName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, externalAuthName, + Context.NONE); + } + + /** + * Delete a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + String externalAuthName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, externalAuthName, context); + } + + /** + * Delete a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @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 hcpOpenShiftClusterName, String externalAuthName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, hcpOpenShiftClusterName, externalAuthName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String hcpOpenShiftClusterName, + String externalAuthName) { + Response response + = deleteWithResponse(resourceGroupName, hcpOpenShiftClusterName, externalAuthName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String hcpOpenShiftClusterName, + String externalAuthName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @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 hcpOpenShiftClusterName, String externalAuthName) { + return beginDeleteAsync(resourceGroupName, hcpOpenShiftClusterName, externalAuthName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String hcpOpenShiftClusterName, String externalAuthName) { + beginDelete(resourceGroupName, hcpOpenShiftClusterName, externalAuthName).getFinalResult(); + } + + /** + * Delete a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String hcpOpenShiftClusterName, String externalAuthName, + Context context) { + beginDelete(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, context).getFinalResult(); + } + + /** + * List ExternalAuth resources by HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 response of a ExternalAuth list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync(String resourceGroupName, + String hcpOpenShiftClusterName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByParent(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, 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())); + } + + /** + * List ExternalAuth resources by HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 response of a ExternalAuth list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String hcpOpenShiftClusterName) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, hcpOpenShiftClusterName), + nextLink -> listByParentNextSinglePageAsync(nextLink)); + } + + /** + * List ExternalAuth resources by HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 response of a ExternalAuth list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByParentSinglePage(String resourceGroupName, + String hcpOpenShiftClusterName) { + final String accept = "application/json"; + Response res + = service.listByParentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List ExternalAuth resources by HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 response of a ExternalAuth list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByParentSinglePage(String resourceGroupName, + String hcpOpenShiftClusterName, Context context) { + final String accept = "application/json"; + Response res + = service.listByParentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List ExternalAuth resources by HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 response of a ExternalAuth list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String hcpOpenShiftClusterName) { + return new PagedIterable<>(() -> listByParentSinglePage(resourceGroupName, hcpOpenShiftClusterName), + nextLink -> listByParentNextSinglePage(nextLink)); + } + + /** + * List ExternalAuth resources by HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 response of a ExternalAuth list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String hcpOpenShiftClusterName, + Context context) { + return new PagedIterable<>(() -> listByParentSinglePage(resourceGroupName, hcpOpenShiftClusterName, context), + nextLink -> listByParentNextSinglePage(nextLink, context)); + } + + /** + * 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 response of a ExternalAuth list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByParentNext(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 response of a ExternalAuth list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByParentNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByParentNextSync(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. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a ExternalAuth list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByParentNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByParentNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/ExternalAuthsImpl.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/ExternalAuthsImpl.java new file mode 100644 index 000000000000..9e4a41006a88 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/ExternalAuthsImpl.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.ExternalAuthsClient; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.ExternalAuthInner; +import com.azure.resourcemanager.redhatopenshifthcp.models.ExternalAuth; +import com.azure.resourcemanager.redhatopenshifthcp.models.ExternalAuths; + +public final class ExternalAuthsImpl implements ExternalAuths { + private static final ClientLogger LOGGER = new ClientLogger(ExternalAuthsImpl.class); + + private final ExternalAuthsClient innerClient; + + private final com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager; + + public ExternalAuthsImpl(ExternalAuthsClient innerClient, + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + String externalAuthName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ExternalAuthImpl(inner.getValue(), this.manager())); + } + + public ExternalAuth get(String resourceGroupName, String hcpOpenShiftClusterName, String externalAuthName) { + ExternalAuthInner inner + = this.serviceClient().get(resourceGroupName, hcpOpenShiftClusterName, externalAuthName); + if (inner != null) { + return new ExternalAuthImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String hcpOpenShiftClusterName, String externalAuthName) { + this.serviceClient().delete(resourceGroupName, hcpOpenShiftClusterName, externalAuthName); + } + + public void delete(String resourceGroupName, String hcpOpenShiftClusterName, String externalAuthName, + Context context) { + this.serviceClient().delete(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, context); + } + + public PagedIterable listByParent(String resourceGroupName, String hcpOpenShiftClusterName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, hcpOpenShiftClusterName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExternalAuthImpl(inner1, this.manager())); + } + + public PagedIterable listByParent(String resourceGroupName, String hcpOpenShiftClusterName, + Context context) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, hcpOpenShiftClusterName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExternalAuthImpl(inner1, this.manager())); + } + + public ExternalAuth getById(String id) { + 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 hcpOpenShiftClusterName = ResourceManagerUtils.getValueFromIdByName(id, "hcpOpenShiftClusters"); + if (hcpOpenShiftClusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hcpOpenShiftClusters'.", id))); + } + String externalAuthName = ResourceManagerUtils.getValueFromIdByName(id, "externalAuths"); + if (externalAuthName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'externalAuths'.", id))); + } + return this.getWithResponse(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + 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 hcpOpenShiftClusterName = ResourceManagerUtils.getValueFromIdByName(id, "hcpOpenShiftClusters"); + if (hcpOpenShiftClusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hcpOpenShiftClusters'.", id))); + } + String externalAuthName = ResourceManagerUtils.getValueFromIdByName(id, "externalAuths"); + if (externalAuthName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'externalAuths'.", id))); + } + return this.getWithResponse(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, context); + } + + public void deleteById(String id) { + 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 hcpOpenShiftClusterName = ResourceManagerUtils.getValueFromIdByName(id, "hcpOpenShiftClusters"); + if (hcpOpenShiftClusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hcpOpenShiftClusters'.", id))); + } + String externalAuthName = ResourceManagerUtils.getValueFromIdByName(id, "externalAuths"); + if (externalAuthName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'externalAuths'.", id))); + } + this.delete(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + 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 hcpOpenShiftClusterName = ResourceManagerUtils.getValueFromIdByName(id, "hcpOpenShiftClusters"); + if (hcpOpenShiftClusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hcpOpenShiftClusters'.", id))); + } + String externalAuthName = ResourceManagerUtils.getValueFromIdByName(id, "externalAuths"); + if (externalAuthName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'externalAuths'.", id))); + } + this.delete(resourceGroupName, hcpOpenShiftClusterName, externalAuthName, context); + } + + private ExternalAuthsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager() { + return this.serviceManager; + } + + public ExternalAuthImpl define(String name) { + return new ExternalAuthImpl(name, this.manager()); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftClusterAdminCredentialImpl.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftClusterAdminCredentialImpl.java new file mode 100644 index 000000000000..ab0b65d15c9e --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftClusterAdminCredentialImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation; + +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOpenShiftClusterAdminCredentialInner; +import com.azure.resourcemanager.redhatopenshifthcp.models.HcpOpenShiftClusterAdminCredential; +import java.time.OffsetDateTime; + +public final class HcpOpenShiftClusterAdminCredentialImpl implements HcpOpenShiftClusterAdminCredential { + private HcpOpenShiftClusterAdminCredentialInner innerObject; + + private final com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager; + + HcpOpenShiftClusterAdminCredentialImpl(HcpOpenShiftClusterAdminCredentialInner innerObject, + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String kubeconfig() { + return this.innerModel().kubeconfig(); + } + + public OffsetDateTime expirationTimestamp() { + return this.innerModel().expirationTimestamp(); + } + + public HcpOpenShiftClusterAdminCredentialInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftClusterImpl.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftClusterImpl.java new file mode 100644 index 000000000000..2edcb1d4a77c --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftClusterImpl.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOpenShiftClusterInner; +import com.azure.resourcemanager.redhatopenshifthcp.models.HcpOpenShiftCluster; +import com.azure.resourcemanager.redhatopenshifthcp.models.HcpOpenShiftClusterAdminCredential; +import com.azure.resourcemanager.redhatopenshifthcp.models.HcpOpenShiftClusterProperties; +import com.azure.resourcemanager.redhatopenshifthcp.models.ManagedServiceIdentity; +import java.util.Collections; +import java.util.Map; + +public final class HcpOpenShiftClusterImpl + implements HcpOpenShiftCluster, HcpOpenShiftCluster.Definition, HcpOpenShiftCluster.Update { + private HcpOpenShiftClusterInner innerObject; + + private final com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public HcpOpenShiftClusterProperties properties() { + return this.innerModel().properties(); + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public HcpOpenShiftClusterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String hcpOpenShiftClusterName; + + public HcpOpenShiftClusterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public HcpOpenShiftCluster create() { + this.innerObject = serviceManager.serviceClient() + .getHcpOpenShiftClusters() + .createOrUpdate(resourceGroupName, hcpOpenShiftClusterName, this.innerModel(), Context.NONE); + return this; + } + + public HcpOpenShiftCluster create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHcpOpenShiftClusters() + .createOrUpdate(resourceGroupName, hcpOpenShiftClusterName, this.innerModel(), context); + return this; + } + + HcpOpenShiftClusterImpl(String name, + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager) { + this.innerObject = new HcpOpenShiftClusterInner(); + this.serviceManager = serviceManager; + this.hcpOpenShiftClusterName = name; + } + + public HcpOpenShiftClusterImpl update() { + return this; + } + + public HcpOpenShiftCluster apply() { + this.innerObject = serviceManager.serviceClient() + .getHcpOpenShiftClusters() + .update(resourceGroupName, hcpOpenShiftClusterName, this.innerModel(), Context.NONE); + return this; + } + + public HcpOpenShiftCluster apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHcpOpenShiftClusters() + .update(resourceGroupName, hcpOpenShiftClusterName, this.innerModel(), context); + return this; + } + + HcpOpenShiftClusterImpl(HcpOpenShiftClusterInner innerObject, + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.hcpOpenShiftClusterName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "hcpOpenShiftClusters"); + } + + public HcpOpenShiftCluster refresh() { + this.innerObject = serviceManager.serviceClient() + .getHcpOpenShiftClusters() + .getByResourceGroupWithResponse(resourceGroupName, hcpOpenShiftClusterName, Context.NONE) + .getValue(); + return this; + } + + public HcpOpenShiftCluster refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHcpOpenShiftClusters() + .getByResourceGroupWithResponse(resourceGroupName, hcpOpenShiftClusterName, context) + .getValue(); + return this; + } + + public HcpOpenShiftClusterAdminCredential requestAdminCredential() { + return serviceManager.hcpOpenShiftClusters().requestAdminCredential(resourceGroupName, hcpOpenShiftClusterName); + } + + public HcpOpenShiftClusterAdminCredential requestAdminCredential(Context context) { + return serviceManager.hcpOpenShiftClusters() + .requestAdminCredential(resourceGroupName, hcpOpenShiftClusterName, context); + } + + public void revokeCredentials() { + serviceManager.hcpOpenShiftClusters().revokeCredentials(resourceGroupName, hcpOpenShiftClusterName); + } + + public void revokeCredentials(Context context) { + serviceManager.hcpOpenShiftClusters().revokeCredentials(resourceGroupName, hcpOpenShiftClusterName, context); + } + + public HcpOpenShiftClusterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public HcpOpenShiftClusterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public HcpOpenShiftClusterImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public HcpOpenShiftClusterImpl withProperties(HcpOpenShiftClusterProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public HcpOpenShiftClusterImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftClustersClientImpl.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftClustersClientImpl.java new file mode 100644 index 000000000000..fbffc63af506 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftClustersClientImpl.java @@ -0,0 +1,1482 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.HcpOpenShiftClustersClient; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOpenShiftClusterAdminCredentialInner; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOpenShiftClusterInner; +import com.azure.resourcemanager.redhatopenshifthcp.implementation.models.HcpOpenShiftClusterListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in HcpOpenShiftClustersClient. + */ +public final class HcpOpenShiftClustersClientImpl implements HcpOpenShiftClustersClient { + /** + * The proxy service used to perform REST calls. + */ + private final HcpOpenShiftClustersService service; + + /** + * The service client containing this operation class. + */ + private final RedHatOpenShiftHostedControlPlanesManagementClientImpl client; + + /** + * Initializes an instance of HcpOpenShiftClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HcpOpenShiftClustersClientImpl(RedHatOpenShiftHostedControlPlanesManagementClientImpl client) { + this.service = RestProxy.create(HcpOpenShiftClustersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * RedHatOpenShiftHostedControlPlanesManagementClientHcpOpenShiftClusters to be used by the proxy service to perform + * REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RedHatOpenShiftHostedControlPlanesManagementClientHcpOpenShiftClusters") + public interface HcpOpenShiftClustersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HcpOpenShiftClusterInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HcpOpenShiftClusterInner resource, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HcpOpenShiftClusterInner properties, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HcpOpenShiftClusterInner properties, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters") + @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.RedHatOpenShift/hcpOpenShiftClusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + 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); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + 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.RedHatOpenShift/hcpOpenShiftClusters") + @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); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/requestAdminCredential") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> requestAdminCredential(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/requestAdminCredential") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response requestAdminCredentialSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/revokeCredentials") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> revokeCredentials(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/revokeCredentials") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response revokeCredentialsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @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" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @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); + } + + /** + * Get a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 HcpOpenShiftCluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String hcpOpenShiftClusterName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 HcpOpenShiftCluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String hcpOpenShiftClusterName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, hcpOpenShiftClusterName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 HcpOpenShiftCluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String hcpOpenShiftClusterName, Context context) { + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, accept, context); + } + + /** + * Get a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 HcpOpenShiftCluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HcpOpenShiftClusterInner getByResourceGroup(String resourceGroupName, String hcpOpenShiftClusterName) { + return getByResourceGroupWithResponse(resourceGroupName, hcpOpenShiftClusterName, Context.NONE).getValue(); + } + + /** + * Create a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param resource Resource create parameters. + * @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 hCP cluster resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String hcpOpenShiftClusterName, HcpOpenShiftClusterInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, contentType, accept, + resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param resource Resource create parameters. + * @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 hCP cluster resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + HcpOpenShiftClusterInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, contentType, accept, resource, + Context.NONE); + } + + /** + * Create a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param resource Resource create parameters. + * @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 hCP cluster resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + HcpOpenShiftClusterInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, contentType, accept, resource, + context); + } + + /** + * Create a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param resource Resource create parameters. + * @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 hCP cluster resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, HcpOpenShiftClusterInner> beginCreateOrUpdateAsync( + String resourceGroupName, String hcpOpenShiftClusterName, HcpOpenShiftClusterInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, hcpOpenShiftClusterName, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), HcpOpenShiftClusterInner.class, HcpOpenShiftClusterInner.class, + this.client.getContext()); + } + + /** + * Create a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param resource Resource create parameters. + * @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 hCP cluster resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HcpOpenShiftClusterInner> beginCreateOrUpdate( + String resourceGroupName, String hcpOpenShiftClusterName, HcpOpenShiftClusterInner resource) { + Response response + = createOrUpdateWithResponse(resourceGroupName, hcpOpenShiftClusterName, resource); + return this.client.getLroResult(response, + HcpOpenShiftClusterInner.class, HcpOpenShiftClusterInner.class, Context.NONE); + } + + /** + * Create a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param resource Resource create parameters. + * @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 hCP cluster resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HcpOpenShiftClusterInner> beginCreateOrUpdate( + String resourceGroupName, String hcpOpenShiftClusterName, HcpOpenShiftClusterInner resource, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, hcpOpenShiftClusterName, resource, context); + return this.client.getLroResult(response, + HcpOpenShiftClusterInner.class, HcpOpenShiftClusterInner.class, context); + } + + /** + * Create a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param resource Resource create parameters. + * @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 hCP cluster resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String hcpOpenShiftClusterName, + HcpOpenShiftClusterInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, hcpOpenShiftClusterName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param resource Resource create parameters. + * @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 hCP cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HcpOpenShiftClusterInner createOrUpdate(String resourceGroupName, String hcpOpenShiftClusterName, + HcpOpenShiftClusterInner resource) { + return beginCreateOrUpdate(resourceGroupName, hcpOpenShiftClusterName, resource).getFinalResult(); + } + + /** + * Create a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param resource Resource create parameters. + * @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 hCP cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HcpOpenShiftClusterInner createOrUpdate(String resourceGroupName, String hcpOpenShiftClusterName, + HcpOpenShiftClusterInner resource, Context context) { + return beginCreateOrUpdate(resourceGroupName, hcpOpenShiftClusterName, resource, context).getFinalResult(); + } + + /** + * Update a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param properties The resource properties to be updated. + * @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 hCP cluster resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, + String hcpOpenShiftClusterName, HcpOpenShiftClusterInner properties) { + 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, hcpOpenShiftClusterName, contentType, accept, + properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param properties The resource properties to be updated. + * @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 hCP cluster resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + HcpOpenShiftClusterInner properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, contentType, accept, + properties, Context.NONE); + } + + /** + * Update a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param properties The resource properties to be updated. + * @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 hCP cluster resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + HcpOpenShiftClusterInner properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, contentType, accept, + properties, context); + } + + /** + * Update a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param properties The resource properties to be updated. + * @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 hCP cluster resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, HcpOpenShiftClusterInner> beginUpdateAsync( + String resourceGroupName, String hcpOpenShiftClusterName, HcpOpenShiftClusterInner properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, hcpOpenShiftClusterName, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), HcpOpenShiftClusterInner.class, HcpOpenShiftClusterInner.class, + this.client.getContext()); + } + + /** + * Update a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param properties The resource properties to be updated. + * @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 hCP cluster resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HcpOpenShiftClusterInner> + beginUpdate(String resourceGroupName, String hcpOpenShiftClusterName, HcpOpenShiftClusterInner properties) { + Response response = updateWithResponse(resourceGroupName, hcpOpenShiftClusterName, properties); + return this.client.getLroResult(response, + HcpOpenShiftClusterInner.class, HcpOpenShiftClusterInner.class, Context.NONE); + } + + /** + * Update a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param properties The resource properties to be updated. + * @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 hCP cluster resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HcpOpenShiftClusterInner> beginUpdate( + String resourceGroupName, String hcpOpenShiftClusterName, HcpOpenShiftClusterInner properties, + Context context) { + Response response + = updateWithResponse(resourceGroupName, hcpOpenShiftClusterName, properties, context); + return this.client.getLroResult(response, + HcpOpenShiftClusterInner.class, HcpOpenShiftClusterInner.class, context); + } + + /** + * Update a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param properties The resource properties to be updated. + * @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 hCP cluster resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String hcpOpenShiftClusterName, + HcpOpenShiftClusterInner properties) { + return beginUpdateAsync(resourceGroupName, hcpOpenShiftClusterName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param properties The resource properties to be updated. + * @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 hCP cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HcpOpenShiftClusterInner update(String resourceGroupName, String hcpOpenShiftClusterName, + HcpOpenShiftClusterInner properties) { + return beginUpdate(resourceGroupName, hcpOpenShiftClusterName, properties).getFinalResult(); + } + + /** + * Update a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param properties The resource properties to be updated. + * @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 hCP cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HcpOpenShiftClusterInner update(String resourceGroupName, String hcpOpenShiftClusterName, + HcpOpenShiftClusterInner properties, Context context) { + return beginUpdate(resourceGroupName, hcpOpenShiftClusterName, properties, context).getFinalResult(); + } + + /** + * Delete a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String hcpOpenShiftClusterName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String hcpOpenShiftClusterName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, Context.NONE); + } + + /** + * Delete a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, context); + } + + /** + * Delete a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 hcpOpenShiftClusterName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, hcpOpenShiftClusterName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String hcpOpenShiftClusterName) { + Response response = deleteWithResponse(resourceGroupName, hcpOpenShiftClusterName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String hcpOpenShiftClusterName, + Context context) { + Response response = deleteWithResponse(resourceGroupName, hcpOpenShiftClusterName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 hcpOpenShiftClusterName) { + return beginDeleteAsync(resourceGroupName, hcpOpenShiftClusterName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String hcpOpenShiftClusterName) { + beginDelete(resourceGroupName, hcpOpenShiftClusterName).getFinalResult(); + } + + /** + * Delete a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String hcpOpenShiftClusterName, Context context) { + beginDelete(resourceGroupName, hcpOpenShiftClusterName, context).getFinalResult(); + } + + /** + * List HcpOpenShiftCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HcpOpenShiftCluster list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List HcpOpenShiftCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HcpOpenShiftCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List HcpOpenShiftCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HcpOpenShiftCluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + 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); + } + + /** + * List HcpOpenShiftCluster resources by 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 response of a HcpOpenShiftCluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, + Context context) { + 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); + } + + /** + * List HcpOpenShiftCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HcpOpenShiftCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); + } + + /** + * List HcpOpenShiftCluster resources by 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 response of a HcpOpenShiftCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * List HcpOpenShiftCluster resources by subscription ID. + * + * @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 response of a HcpOpenShiftCluster list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .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())); + } + + /** + * List HcpOpenShiftCluster resources by subscription ID. + * + * @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 response of a HcpOpenShiftCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List HcpOpenShiftCluster resources by subscription ID. + * + * @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 response of a HcpOpenShiftCluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + 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); + } + + /** + * List HcpOpenShiftCluster resources by subscription ID. + * + * @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 response of a HcpOpenShiftCluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + 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); + } + + /** + * List HcpOpenShiftCluster resources by subscription ID. + * + * @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 response of a HcpOpenShiftCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * List HcpOpenShiftCluster resources by subscription ID. + * + * @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 response of a HcpOpenShiftCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + } + + /** + * Request a temporary admin kubeconfig for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 hCP cluster admin credential along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> requestAdminCredentialWithResponseAsync(String resourceGroupName, + String hcpOpenShiftClusterName) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.requestAdminCredential(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Request a temporary admin kubeconfig for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 hCP cluster admin credential along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response requestAdminCredentialWithResponse(String resourceGroupName, + String hcpOpenShiftClusterName) { + final String accept = "application/json"; + return service.requestAdminCredentialSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, accept, Context.NONE); + } + + /** + * Request a temporary admin kubeconfig for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 hCP cluster admin credential along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response requestAdminCredentialWithResponse(String resourceGroupName, + String hcpOpenShiftClusterName, Context context) { + final String accept = "application/json"; + return service.requestAdminCredentialSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, accept, context); + } + + /** + * Request a temporary admin kubeconfig for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 hCP cluster admin credential. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, HcpOpenShiftClusterAdminCredentialInner> + beginRequestAdminCredentialAsync(String resourceGroupName, String hcpOpenShiftClusterName) { + Mono>> mono + = requestAdminCredentialWithResponseAsync(resourceGroupName, hcpOpenShiftClusterName); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), HcpOpenShiftClusterAdminCredentialInner.class, + HcpOpenShiftClusterAdminCredentialInner.class, this.client.getContext()); + } + + /** + * Request a temporary admin kubeconfig for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 hCP cluster admin credential. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HcpOpenShiftClusterAdminCredentialInner> + beginRequestAdminCredential(String resourceGroupName, String hcpOpenShiftClusterName) { + Response response = requestAdminCredentialWithResponse(resourceGroupName, hcpOpenShiftClusterName); + return this.client + .getLroResult(response, + HcpOpenShiftClusterAdminCredentialInner.class, HcpOpenShiftClusterAdminCredentialInner.class, + Context.NONE); + } + + /** + * Request a temporary admin kubeconfig for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 hCP cluster admin credential. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HcpOpenShiftClusterAdminCredentialInner> + beginRequestAdminCredential(String resourceGroupName, String hcpOpenShiftClusterName, Context context) { + Response response + = requestAdminCredentialWithResponse(resourceGroupName, hcpOpenShiftClusterName, context); + return this.client + .getLroResult(response, + HcpOpenShiftClusterAdminCredentialInner.class, HcpOpenShiftClusterAdminCredentialInner.class, context); + } + + /** + * Request a temporary admin kubeconfig for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 hCP cluster admin credential on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono requestAdminCredentialAsync(String resourceGroupName, + String hcpOpenShiftClusterName) { + return beginRequestAdminCredentialAsync(resourceGroupName, hcpOpenShiftClusterName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Request a temporary admin kubeconfig for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 hCP cluster admin credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HcpOpenShiftClusterAdminCredentialInner requestAdminCredential(String resourceGroupName, + String hcpOpenShiftClusterName) { + return beginRequestAdminCredential(resourceGroupName, hcpOpenShiftClusterName).getFinalResult(); + } + + /** + * Request a temporary admin kubeconfig for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 hCP cluster admin credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HcpOpenShiftClusterAdminCredentialInner requestAdminCredential(String resourceGroupName, + String hcpOpenShiftClusterName, Context context) { + return beginRequestAdminCredential(resourceGroupName, hcpOpenShiftClusterName, context).getFinalResult(); + } + + /** + * Revoke all credentials issued by requestAdminCredential. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> revokeCredentialsWithResponseAsync(String resourceGroupName, + String hcpOpenShiftClusterName) { + return FluxUtil + .withContext(context -> service.revokeCredentials(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Revoke all credentials issued by requestAdminCredential. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response revokeCredentialsWithResponse(String resourceGroupName, + String hcpOpenShiftClusterName) { + return service.revokeCredentialsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, Context.NONE); + } + + /** + * Revoke all credentials issued by requestAdminCredential. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response revokeCredentialsWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + Context context) { + return service.revokeCredentialsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, context); + } + + /** + * Revoke all credentials issued by requestAdminCredential. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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> beginRevokeCredentialsAsync(String resourceGroupName, + String hcpOpenShiftClusterName) { + Mono>> mono + = revokeCredentialsWithResponseAsync(resourceGroupName, hcpOpenShiftClusterName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Revoke all credentials issued by requestAdminCredential. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRevokeCredentials(String resourceGroupName, + String hcpOpenShiftClusterName) { + Response response = revokeCredentialsWithResponse(resourceGroupName, hcpOpenShiftClusterName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Revoke all credentials issued by requestAdminCredential. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRevokeCredentials(String resourceGroupName, + String hcpOpenShiftClusterName, Context context) { + Response response + = revokeCredentialsWithResponse(resourceGroupName, hcpOpenShiftClusterName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Revoke all credentials issued by requestAdminCredential. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 revokeCredentialsAsync(String resourceGroupName, String hcpOpenShiftClusterName) { + return beginRevokeCredentialsAsync(resourceGroupName, hcpOpenShiftClusterName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Revoke all credentials issued by requestAdminCredential. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void revokeCredentials(String resourceGroupName, String hcpOpenShiftClusterName) { + beginRevokeCredentials(resourceGroupName, hcpOpenShiftClusterName).getFinalResult(); + } + + /** + * Revoke all credentials issued by requestAdminCredential. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void revokeCredentials(String resourceGroupName, String hcpOpenShiftClusterName, Context context) { + beginRevokeCredentials(resourceGroupName, hcpOpenShiftClusterName, context).getFinalResult(); + } + + /** + * 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 response of a HcpOpenShiftCluster list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .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 response of a HcpOpenShiftCluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + 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); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a HcpOpenShiftCluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, + Context context) { + final String accept = "application/json"; + 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); + } + + /** + * 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 response of a HcpOpenShiftCluster list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .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 response of a HcpOpenShiftCluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + 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); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a HcpOpenShiftCluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + 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); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftClustersImpl.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftClustersImpl.java new file mode 100644 index 000000000000..323561100f03 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftClustersImpl.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.HcpOpenShiftClustersClient; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOpenShiftClusterAdminCredentialInner; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOpenShiftClusterInner; +import com.azure.resourcemanager.redhatopenshifthcp.models.HcpOpenShiftCluster; +import com.azure.resourcemanager.redhatopenshifthcp.models.HcpOpenShiftClusterAdminCredential; +import com.azure.resourcemanager.redhatopenshifthcp.models.HcpOpenShiftClusters; + +public final class HcpOpenShiftClustersImpl implements HcpOpenShiftClusters { + private static final ClientLogger LOGGER = new ClientLogger(HcpOpenShiftClustersImpl.class); + + private final HcpOpenShiftClustersClient innerClient; + + private final com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager; + + public HcpOpenShiftClustersImpl(HcpOpenShiftClustersClient innerClient, + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String hcpOpenShiftClusterName, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, hcpOpenShiftClusterName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HcpOpenShiftClusterImpl(inner.getValue(), this.manager())); + } + + public HcpOpenShiftCluster getByResourceGroup(String resourceGroupName, String hcpOpenShiftClusterName) { + HcpOpenShiftClusterInner inner + = this.serviceClient().getByResourceGroup(resourceGroupName, hcpOpenShiftClusterName); + if (inner != null) { + return new HcpOpenShiftClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String hcpOpenShiftClusterName) { + this.serviceClient().delete(resourceGroupName, hcpOpenShiftClusterName); + } + + public void delete(String resourceGroupName, String hcpOpenShiftClusterName, Context context) { + this.serviceClient().delete(resourceGroupName, hcpOpenShiftClusterName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HcpOpenShiftClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HcpOpenShiftClusterImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HcpOpenShiftClusterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HcpOpenShiftClusterImpl(inner1, this.manager())); + } + + public HcpOpenShiftClusterAdminCredential requestAdminCredential(String resourceGroupName, + String hcpOpenShiftClusterName) { + HcpOpenShiftClusterAdminCredentialInner inner + = this.serviceClient().requestAdminCredential(resourceGroupName, hcpOpenShiftClusterName); + if (inner != null) { + return new HcpOpenShiftClusterAdminCredentialImpl(inner, this.manager()); + } else { + return null; + } + } + + public HcpOpenShiftClusterAdminCredential requestAdminCredential(String resourceGroupName, + String hcpOpenShiftClusterName, Context context) { + HcpOpenShiftClusterAdminCredentialInner inner + = this.serviceClient().requestAdminCredential(resourceGroupName, hcpOpenShiftClusterName, context); + if (inner != null) { + return new HcpOpenShiftClusterAdminCredentialImpl(inner, this.manager()); + } else { + return null; + } + } + + public void revokeCredentials(String resourceGroupName, String hcpOpenShiftClusterName) { + this.serviceClient().revokeCredentials(resourceGroupName, hcpOpenShiftClusterName); + } + + public void revokeCredentials(String resourceGroupName, String hcpOpenShiftClusterName, Context context) { + this.serviceClient().revokeCredentials(resourceGroupName, hcpOpenShiftClusterName, context); + } + + public HcpOpenShiftCluster getById(String id) { + 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 hcpOpenShiftClusterName = ResourceManagerUtils.getValueFromIdByName(id, "hcpOpenShiftClusters"); + if (hcpOpenShiftClusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hcpOpenShiftClusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, hcpOpenShiftClusterName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + 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 hcpOpenShiftClusterName = ResourceManagerUtils.getValueFromIdByName(id, "hcpOpenShiftClusters"); + if (hcpOpenShiftClusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hcpOpenShiftClusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, hcpOpenShiftClusterName, context); + } + + public void deleteById(String id) { + 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 hcpOpenShiftClusterName = ResourceManagerUtils.getValueFromIdByName(id, "hcpOpenShiftClusters"); + if (hcpOpenShiftClusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hcpOpenShiftClusters'.", id))); + } + this.delete(resourceGroupName, hcpOpenShiftClusterName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + 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 hcpOpenShiftClusterName = ResourceManagerUtils.getValueFromIdByName(id, "hcpOpenShiftClusters"); + if (hcpOpenShiftClusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hcpOpenShiftClusters'.", id))); + } + this.delete(resourceGroupName, hcpOpenShiftClusterName, context); + } + + private HcpOpenShiftClustersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager() { + return this.serviceManager; + } + + public HcpOpenShiftClusterImpl define(String name) { + return new HcpOpenShiftClusterImpl(name, this.manager()); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftVersionImpl.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftVersionImpl.java new file mode 100644 index 000000000000..6cc74e46c911 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftVersionImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOpenShiftVersionInner; +import com.azure.resourcemanager.redhatopenshifthcp.models.HcpOpenShiftVersion; +import com.azure.resourcemanager.redhatopenshifthcp.models.HcpOpenShiftVersionProperties; + +public final class HcpOpenShiftVersionImpl implements HcpOpenShiftVersion { + private HcpOpenShiftVersionInner innerObject; + + private final com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager; + + HcpOpenShiftVersionImpl(HcpOpenShiftVersionInner innerObject, + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public HcpOpenShiftVersionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public HcpOpenShiftVersionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftVersionsClientImpl.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftVersionsClientImpl.java new file mode 100644 index 000000000000..83ef3e235838 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftVersionsClientImpl.java @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.HcpOpenShiftVersionsClient; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOpenShiftVersionInner; +import com.azure.resourcemanager.redhatopenshifthcp.implementation.models.HcpOpenShiftVersionListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in HcpOpenShiftVersionsClient. + */ +public final class HcpOpenShiftVersionsClientImpl implements HcpOpenShiftVersionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final HcpOpenShiftVersionsService service; + + /** + * The service client containing this operation class. + */ + private final RedHatOpenShiftHostedControlPlanesManagementClientImpl client; + + /** + * Initializes an instance of HcpOpenShiftVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HcpOpenShiftVersionsClientImpl(RedHatOpenShiftHostedControlPlanesManagementClientImpl client) { + this.service = RestProxy.create(HcpOpenShiftVersionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * RedHatOpenShiftHostedControlPlanesManagementClientHcpOpenShiftVersions to be used by the proxy service to perform + * REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RedHatOpenShiftHostedControlPlanesManagementClientHcpOpenShiftVersions") + public interface HcpOpenShiftVersionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RedHatOpenShift/locations/{location}/hcpOpenShiftVersions/{hcpOpenShiftVersionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @PathParam("hcpOpenShiftVersionName") String hcpOpenShiftVersionName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RedHatOpenShift/locations/{location}/hcpOpenShiftVersions/{hcpOpenShiftVersionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @PathParam("hcpOpenShiftVersionName") String hcpOpenShiftVersionName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RedHatOpenShift/locations/{location}/hcpOpenShiftVersions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RedHatOpenShift/locations/{location}/hcpOpenShiftVersions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + 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); + } + + /** + * Get a HcpOpenShiftVersion. + * + * @param location The name of the Azure region. + * @param hcpOpenShiftVersionName The name of the HcpOpenShiftVersion. + * @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 HcpOpenShiftVersion along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String location, + String hcpOpenShiftVersionName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, hcpOpenShiftVersionName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a HcpOpenShiftVersion. + * + * @param location The name of the Azure region. + * @param hcpOpenShiftVersionName The name of the HcpOpenShiftVersion. + * @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 HcpOpenShiftVersion on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String location, String hcpOpenShiftVersionName) { + return getWithResponseAsync(location, hcpOpenShiftVersionName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a HcpOpenShiftVersion. + * + * @param location The name of the Azure region. + * @param hcpOpenShiftVersionName The name of the HcpOpenShiftVersion. + * @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 HcpOpenShiftVersion along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String location, String hcpOpenShiftVersionName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + location, hcpOpenShiftVersionName, accept, context); + } + + /** + * Get a HcpOpenShiftVersion. + * + * @param location The name of the Azure region. + * @param hcpOpenShiftVersionName The name of the HcpOpenShiftVersion. + * @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 HcpOpenShiftVersion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HcpOpenShiftVersionInner get(String location, String hcpOpenShiftVersionName) { + return getWithResponse(location, hcpOpenShiftVersionName, Context.NONE).getValue(); + } + + /** + * List HcpOpenShiftVersion resources by SubscriptionLocationResource. + * + * @param location The name of the Azure region. + * @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 response of a HcpOpenShiftVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, 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())); + } + + /** + * List HcpOpenShiftVersion resources by SubscriptionLocationResource. + * + * @param location The name of the Azure region. + * @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 response of a HcpOpenShiftVersion list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List HcpOpenShiftVersion resources by SubscriptionLocationResource. + * + * @param location The name of the Azure region. + * @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 response of a HcpOpenShiftVersion list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String location) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List HcpOpenShiftVersion resources by SubscriptionLocationResource. + * + * @param location The name of the Azure region. + * @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 response of a HcpOpenShiftVersion list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String location, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List HcpOpenShiftVersion resources by SubscriptionLocationResource. + * + * @param location The name of the Azure region. + * @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 response of a HcpOpenShiftVersion list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(() -> listSinglePage(location), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List HcpOpenShiftVersion resources by SubscriptionLocationResource. + * + * @param location The name of the Azure region. + * @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 response of a HcpOpenShiftVersion list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(() -> listSinglePage(location, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * 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 response of a HcpOpenShiftVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + 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 response of a HcpOpenShiftVersion list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + 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. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a HcpOpenShiftVersion list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + 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); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftVersionsImpl.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftVersionsImpl.java new file mode 100644 index 000000000000..c3ea22a99f83 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOpenShiftVersionsImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.HcpOpenShiftVersionsClient; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOpenShiftVersionInner; +import com.azure.resourcemanager.redhatopenshifthcp.models.HcpOpenShiftVersion; +import com.azure.resourcemanager.redhatopenshifthcp.models.HcpOpenShiftVersions; + +public final class HcpOpenShiftVersionsImpl implements HcpOpenShiftVersions { + private static final ClientLogger LOGGER = new ClientLogger(HcpOpenShiftVersionsImpl.class); + + private final HcpOpenShiftVersionsClient innerClient; + + private final com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager; + + public HcpOpenShiftVersionsImpl(HcpOpenShiftVersionsClient innerClient, + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String location, String hcpOpenShiftVersionName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(location, hcpOpenShiftVersionName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HcpOpenShiftVersionImpl(inner.getValue(), this.manager())); + } + + public HcpOpenShiftVersion get(String location, String hcpOpenShiftVersionName) { + HcpOpenShiftVersionInner inner = this.serviceClient().get(location, hcpOpenShiftVersionName); + if (inner != null) { + return new HcpOpenShiftVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HcpOpenShiftVersionImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HcpOpenShiftVersionImpl(inner1, this.manager())); + } + + private HcpOpenShiftVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOperatorIdentityRoleSetImpl.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOperatorIdentityRoleSetImpl.java new file mode 100644 index 000000000000..2b24e8cce3fc --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOperatorIdentityRoleSetImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOperatorIdentityRoleSetInner; +import com.azure.resourcemanager.redhatopenshifthcp.models.HcpOperatorIdentityRoleSet; +import com.azure.resourcemanager.redhatopenshifthcp.models.HcpOperatorIdentityRoleSetProperties; + +public final class HcpOperatorIdentityRoleSetImpl implements HcpOperatorIdentityRoleSet { + private HcpOperatorIdentityRoleSetInner innerObject; + + private final com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager; + + HcpOperatorIdentityRoleSetImpl(HcpOperatorIdentityRoleSetInner innerObject, + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public HcpOperatorIdentityRoleSetProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public HcpOperatorIdentityRoleSetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOperatorIdentityRoleSetsClientImpl.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOperatorIdentityRoleSetsClientImpl.java new file mode 100644 index 000000000000..e76b93dc51cd --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOperatorIdentityRoleSetsClientImpl.java @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.HcpOperatorIdentityRoleSetsClient; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOperatorIdentityRoleSetInner; +import com.azure.resourcemanager.redhatopenshifthcp.implementation.models.HcpOperatorIdentityRoleSetListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in HcpOperatorIdentityRoleSetsClient. + */ +public final class HcpOperatorIdentityRoleSetsClientImpl implements HcpOperatorIdentityRoleSetsClient { + /** + * The proxy service used to perform REST calls. + */ + private final HcpOperatorIdentityRoleSetsService service; + + /** + * The service client containing this operation class. + */ + private final RedHatOpenShiftHostedControlPlanesManagementClientImpl client; + + /** + * Initializes an instance of HcpOperatorIdentityRoleSetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HcpOperatorIdentityRoleSetsClientImpl(RedHatOpenShiftHostedControlPlanesManagementClientImpl client) { + this.service = RestProxy.create(HcpOperatorIdentityRoleSetsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * RedHatOpenShiftHostedControlPlanesManagementClientHcpOperatorIdentityRoleSets to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RedHatOpenShiftHostedControlPlanesManagementClientHcpOperatorIdentityRoleSets") + public interface HcpOperatorIdentityRoleSetsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RedHatOpenShift/locations/{location}/hcpOperatorIdentityRoleSets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RedHatOpenShift/locations/{location}/hcpOperatorIdentityRoleSets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RedHatOpenShift/locations/{location}/hcpOperatorIdentityRoleSets/{hcpOperatorIdentityRoleSetName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @PathParam("hcpOperatorIdentityRoleSetName") String hcpOperatorIdentityRoleSetName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.RedHatOpenShift/locations/{location}/hcpOperatorIdentityRoleSets/{hcpOperatorIdentityRoleSetName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @PathParam("hcpOperatorIdentityRoleSetName") String hcpOperatorIdentityRoleSetName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + 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); + } + + /** + * List HcpOperatorIdentityRoleSet resources by SubscriptionLocationResource. + * + * @param location The name of the Azure region. + * @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 response of a HcpOperatorIdentityRoleSet list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, 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())); + } + + /** + * List HcpOperatorIdentityRoleSet resources by SubscriptionLocationResource. + * + * @param location The name of the Azure region. + * @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 response of a HcpOperatorIdentityRoleSet list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List HcpOperatorIdentityRoleSet resources by SubscriptionLocationResource. + * + * @param location The name of the Azure region. + * @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 response of a HcpOperatorIdentityRoleSet list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String location) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List HcpOperatorIdentityRoleSet resources by SubscriptionLocationResource. + * + * @param location The name of the Azure region. + * @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 response of a HcpOperatorIdentityRoleSet list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String location, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List HcpOperatorIdentityRoleSet resources by SubscriptionLocationResource. + * + * @param location The name of the Azure region. + * @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 response of a HcpOperatorIdentityRoleSet list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(() -> listSinglePage(location), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List HcpOperatorIdentityRoleSet resources by SubscriptionLocationResource. + * + * @param location The name of the Azure region. + * @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 response of a HcpOperatorIdentityRoleSet list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(() -> listSinglePage(location, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get a HcpOperatorIdentityRoleSet. + * + * @param location The name of the Azure region. + * @param hcpOperatorIdentityRoleSetName The OpenShift minor version these identities are required for. + * @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 HcpOperatorIdentityRoleSet along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String location, + String hcpOperatorIdentityRoleSetName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, hcpOperatorIdentityRoleSetName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a HcpOperatorIdentityRoleSet. + * + * @param location The name of the Azure region. + * @param hcpOperatorIdentityRoleSetName The OpenShift minor version these identities are required for. + * @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 HcpOperatorIdentityRoleSet on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String location, String hcpOperatorIdentityRoleSetName) { + return getWithResponseAsync(location, hcpOperatorIdentityRoleSetName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a HcpOperatorIdentityRoleSet. + * + * @param location The name of the Azure region. + * @param hcpOperatorIdentityRoleSetName The OpenShift minor version these identities are required for. + * @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 HcpOperatorIdentityRoleSet along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String location, + String hcpOperatorIdentityRoleSetName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + location, hcpOperatorIdentityRoleSetName, accept, context); + } + + /** + * Get a HcpOperatorIdentityRoleSet. + * + * @param location The name of the Azure region. + * @param hcpOperatorIdentityRoleSetName The OpenShift minor version these identities are required for. + * @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 HcpOperatorIdentityRoleSet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HcpOperatorIdentityRoleSetInner get(String location, String hcpOperatorIdentityRoleSetName) { + return getWithResponse(location, hcpOperatorIdentityRoleSetName, Context.NONE).getValue(); + } + + /** + * 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 response of a HcpOperatorIdentityRoleSet list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + 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 response of a HcpOperatorIdentityRoleSet list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + 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. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a HcpOperatorIdentityRoleSet list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + 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); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOperatorIdentityRoleSetsImpl.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOperatorIdentityRoleSetsImpl.java new file mode 100644 index 000000000000..f8f55a92644e --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/HcpOperatorIdentityRoleSetsImpl.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.HcpOperatorIdentityRoleSetsClient; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOperatorIdentityRoleSetInner; +import com.azure.resourcemanager.redhatopenshifthcp.models.HcpOperatorIdentityRoleSet; +import com.azure.resourcemanager.redhatopenshifthcp.models.HcpOperatorIdentityRoleSets; + +public final class HcpOperatorIdentityRoleSetsImpl implements HcpOperatorIdentityRoleSets { + private static final ClientLogger LOGGER = new ClientLogger(HcpOperatorIdentityRoleSetsImpl.class); + + private final HcpOperatorIdentityRoleSetsClient innerClient; + + private final com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager; + + public HcpOperatorIdentityRoleSetsImpl(HcpOperatorIdentityRoleSetsClient innerClient, + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new HcpOperatorIdentityRoleSetImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new HcpOperatorIdentityRoleSetImpl(inner1, this.manager())); + } + + public Response getWithResponse(String location, String hcpOperatorIdentityRoleSetName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(location, hcpOperatorIdentityRoleSetName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HcpOperatorIdentityRoleSetImpl(inner.getValue(), this.manager())); + } + + public HcpOperatorIdentityRoleSet get(String location, String hcpOperatorIdentityRoleSetName) { + HcpOperatorIdentityRoleSetInner inner = this.serviceClient().get(location, hcpOperatorIdentityRoleSetName); + if (inner != null) { + return new HcpOperatorIdentityRoleSetImpl(inner, this.manager()); + } else { + return null; + } + } + + private HcpOperatorIdentityRoleSetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/NodePoolImpl.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/NodePoolImpl.java new file mode 100644 index 000000000000..5d00ce87029b --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/NodePoolImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.NodePoolInner; +import com.azure.resourcemanager.redhatopenshifthcp.models.ManagedServiceIdentity; +import com.azure.resourcemanager.redhatopenshifthcp.models.NodePool; +import com.azure.resourcemanager.redhatopenshifthcp.models.NodePoolProperties; +import java.util.Collections; +import java.util.Map; + +public final class NodePoolImpl implements NodePool, NodePool.Definition, NodePool.Update { + private NodePoolInner innerObject; + + private final com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public NodePoolProperties properties() { + return this.innerModel().properties(); + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public NodePoolInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String hcpOpenShiftClusterName; + + private String nodePoolName; + + public NodePoolImpl withExistingHcpOpenShiftCluster(String resourceGroupName, String hcpOpenShiftClusterName) { + this.resourceGroupName = resourceGroupName; + this.hcpOpenShiftClusterName = hcpOpenShiftClusterName; + return this; + } + + public NodePool create() { + this.innerObject = serviceManager.serviceClient() + .getNodePools() + .createOrUpdate(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, this.innerModel(), Context.NONE); + return this; + } + + public NodePool create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getNodePools() + .createOrUpdate(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, this.innerModel(), context); + return this; + } + + NodePoolImpl(String name, + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager) { + this.innerObject = new NodePoolInner(); + this.serviceManager = serviceManager; + this.nodePoolName = name; + } + + public NodePoolImpl update() { + return this; + } + + public NodePool apply() { + this.innerObject = serviceManager.serviceClient() + .getNodePools() + .update(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, this.innerModel(), Context.NONE); + return this; + } + + public NodePool apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getNodePools() + .update(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, this.innerModel(), context); + return this; + } + + NodePoolImpl(NodePoolInner innerObject, + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.hcpOpenShiftClusterName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "hcpOpenShiftClusters"); + this.nodePoolName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "nodePools"); + } + + public NodePool refresh() { + this.innerObject = serviceManager.serviceClient() + .getNodePools() + .getWithResponse(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, Context.NONE) + .getValue(); + return this; + } + + public NodePool refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getNodePools() + .getWithResponse(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, context) + .getValue(); + return this; + } + + public NodePoolImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NodePoolImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NodePoolImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public NodePoolImpl withProperties(NodePoolProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public NodePoolImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/NodePoolsClientImpl.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/NodePoolsClientImpl.java new file mode 100644 index 000000000000..be357cd7a211 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/NodePoolsClientImpl.java @@ -0,0 +1,999 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.NodePoolsClient; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.NodePoolInner; +import com.azure.resourcemanager.redhatopenshifthcp.implementation.models.NodePoolListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in NodePoolsClient. + */ +public final class NodePoolsClientImpl implements NodePoolsClient { + /** + * The proxy service used to perform REST calls. + */ + private final NodePoolsService service; + + /** + * The service client containing this operation class. + */ + private final RedHatOpenShiftHostedControlPlanesManagementClientImpl client; + + /** + * Initializes an instance of NodePoolsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NodePoolsClientImpl(RedHatOpenShiftHostedControlPlanesManagementClientImpl client) { + this.service + = RestProxy.create(NodePoolsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RedHatOpenShiftHostedControlPlanesManagementClientNodePools to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RedHatOpenShiftHostedControlPlanesManagementClientNodePools") + public interface NodePoolsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/nodePools/{nodePoolName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, + @PathParam("nodePoolName") String nodePoolName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/nodePools/{nodePoolName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, + @PathParam("nodePoolName") String nodePoolName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/nodePools/{nodePoolName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, + @PathParam("nodePoolName") String nodePoolName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") NodePoolInner resource, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/nodePools/{nodePoolName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, + @PathParam("nodePoolName") String nodePoolName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") NodePoolInner resource, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/nodePools/{nodePoolName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, + @PathParam("nodePoolName") String nodePoolName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") NodePoolInner properties, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/nodePools/{nodePoolName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, + @PathParam("nodePoolName") String nodePoolName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") NodePoolInner properties, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/nodePools/{nodePoolName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, + @PathParam("nodePoolName") String nodePoolName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/nodePools/{nodePoolName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, + @PathParam("nodePoolName") String nodePoolName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/nodePools") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/hcpOpenShiftClusters/{hcpOpenShiftClusterName}/nodePools") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByParentSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hcpOpenShiftClusterName") String hcpOpenShiftClusterName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParentNext( + @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 listByParentNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @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 NodePool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String hcpOpenShiftClusterName, + String nodePoolName) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, nodePoolName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @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 NodePool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String hcpOpenShiftClusterName, + String nodePoolName) { + return getWithResponseAsync(resourceGroupName, hcpOpenShiftClusterName, nodePoolName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @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 NodePool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + String nodePoolName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hcpOpenShiftClusterName, nodePoolName, accept, context); + } + + /** + * Get a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @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 NodePool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NodePoolInner get(String resourceGroupName, String hcpOpenShiftClusterName, String nodePoolName) { + return getWithResponse(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, Context.NONE).getValue(); + } + + /** + * Create a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param resource Resource create parameters. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String hcpOpenShiftClusterName, String nodePoolName, NodePoolInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, nodePoolName, contentType, + accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param resource Resource create parameters. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + String nodePoolName, NodePoolInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, nodePoolName, contentType, + accept, resource, Context.NONE); + } + + /** + * Create a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param resource Resource create parameters. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + String nodePoolName, NodePoolInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, nodePoolName, contentType, + accept, resource, context); + } + + /** + * Create a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param resource Resource create parameters. + * @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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NodePoolInner> beginCreateOrUpdateAsync(String resourceGroupName, + String hcpOpenShiftClusterName, String nodePoolName, NodePoolInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + NodePoolInner.class, NodePoolInner.class, this.client.getContext()); + } + + /** + * Create a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param resource Resource create parameters. + * @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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NodePoolInner> beginCreateOrUpdate(String resourceGroupName, + String hcpOpenShiftClusterName, String nodePoolName, NodePoolInner resource) { + Response response + = createOrUpdateWithResponse(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, resource); + return this.client.getLroResult(response, NodePoolInner.class, + NodePoolInner.class, Context.NONE); + } + + /** + * Create a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param resource Resource create parameters. + * @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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NodePoolInner> beginCreateOrUpdate(String resourceGroupName, + String hcpOpenShiftClusterName, String nodePoolName, NodePoolInner resource, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, resource, context); + return this.client.getLroResult(response, NodePoolInner.class, + NodePoolInner.class, context); + } + + /** + * Create a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param resource Resource create parameters. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String hcpOpenShiftClusterName, + String nodePoolName, NodePoolInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param resource Resource create parameters. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NodePoolInner createOrUpdate(String resourceGroupName, String hcpOpenShiftClusterName, String nodePoolName, + NodePoolInner resource) { + return beginCreateOrUpdate(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, resource).getFinalResult(); + } + + /** + * Create a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param resource Resource create parameters. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NodePoolInner createOrUpdate(String resourceGroupName, String hcpOpenShiftClusterName, String nodePoolName, + NodePoolInner resource, Context context) { + return beginCreateOrUpdate(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, resource, context) + .getFinalResult(); + } + + /** + * Update a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param properties The resource properties to be updated. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, + String hcpOpenShiftClusterName, String nodePoolName, NodePoolInner properties) { + 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, hcpOpenShiftClusterName, nodePoolName, contentType, + accept, properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param properties The resource properties to be updated. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + String nodePoolName, NodePoolInner properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, nodePoolName, contentType, + accept, properties, Context.NONE); + } + + /** + * Update a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param properties The resource properties to be updated. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + String nodePoolName, NodePoolInner properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, nodePoolName, contentType, + accept, properties, context); + } + + /** + * Update a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param properties The resource properties to be updated. + * @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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NodePoolInner> beginUpdateAsync(String resourceGroupName, + String hcpOpenShiftClusterName, String nodePoolName, NodePoolInner properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + NodePoolInner.class, NodePoolInner.class, this.client.getContext()); + } + + /** + * Update a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param properties The resource properties to be updated. + * @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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NodePoolInner> beginUpdate(String resourceGroupName, + String hcpOpenShiftClusterName, String nodePoolName, NodePoolInner properties) { + Response response + = updateWithResponse(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, properties); + return this.client.getLroResult(response, NodePoolInner.class, + NodePoolInner.class, Context.NONE); + } + + /** + * Update a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param properties The resource properties to be updated. + * @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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NodePoolInner> beginUpdate(String resourceGroupName, + String hcpOpenShiftClusterName, String nodePoolName, NodePoolInner properties, Context context) { + Response response + = updateWithResponse(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, properties, context); + return this.client.getLroResult(response, NodePoolInner.class, + NodePoolInner.class, context); + } + + /** + * Update a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param properties The resource properties to be updated. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String hcpOpenShiftClusterName, + String nodePoolName, NodePoolInner properties) { + return beginUpdateAsync(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param properties The resource properties to be updated. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NodePoolInner update(String resourceGroupName, String hcpOpenShiftClusterName, String nodePoolName, + NodePoolInner properties) { + return beginUpdate(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, properties).getFinalResult(); + } + + /** + * Update a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @param properties The resource properties to be updated. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NodePoolInner update(String resourceGroupName, String hcpOpenShiftClusterName, String nodePoolName, + NodePoolInner properties, Context context) { + return beginUpdate(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, properties, context) + .getFinalResult(); + } + + /** + * Delete a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String hcpOpenShiftClusterName, String nodePoolName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, nodePoolName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + String nodePoolName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, nodePoolName, Context.NONE); + } + + /** + * Delete a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + String nodePoolName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, nodePoolName, context); + } + + /** + * Delete a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @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 hcpOpenShiftClusterName, String nodePoolName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, hcpOpenShiftClusterName, nodePoolName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String hcpOpenShiftClusterName, + String nodePoolName) { + Response response = deleteWithResponse(resourceGroupName, hcpOpenShiftClusterName, nodePoolName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String hcpOpenShiftClusterName, + String nodePoolName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @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 hcpOpenShiftClusterName, String nodePoolName) { + return beginDeleteAsync(resourceGroupName, hcpOpenShiftClusterName, nodePoolName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String hcpOpenShiftClusterName, String nodePoolName) { + beginDelete(resourceGroupName, hcpOpenShiftClusterName, nodePoolName).getFinalResult(); + } + + /** + * Delete a NodePool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param nodePoolName The name of the NodePool. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String hcpOpenShiftClusterName, String nodePoolName, Context context) { + beginDelete(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, context).getFinalResult(); + } + + /** + * List NodePool resources by HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 response of a NodePool list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync(String resourceGroupName, + String hcpOpenShiftClusterName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByParent(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, 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())); + } + + /** + * List NodePool resources by HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 response of a NodePool list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String hcpOpenShiftClusterName) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, hcpOpenShiftClusterName), + nextLink -> listByParentNextSinglePageAsync(nextLink)); + } + + /** + * List NodePool resources by HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 response of a NodePool list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByParentSinglePage(String resourceGroupName, + String hcpOpenShiftClusterName) { + final String accept = "application/json"; + Response res + = service.listByParentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List NodePool resources by HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 response of a NodePool list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByParentSinglePage(String resourceGroupName, + String hcpOpenShiftClusterName, Context context) { + final String accept = "application/json"; + Response res + = service.listByParentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hcpOpenShiftClusterName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List NodePool resources by HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 response of a NodePool list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String hcpOpenShiftClusterName) { + return new PagedIterable<>(() -> listByParentSinglePage(resourceGroupName, hcpOpenShiftClusterName), + nextLink -> listByParentNextSinglePage(nextLink)); + } + + /** + * List NodePool resources by HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 response of a NodePool list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String hcpOpenShiftClusterName, + Context context) { + return new PagedIterable<>(() -> listByParentSinglePage(resourceGroupName, hcpOpenShiftClusterName, context), + nextLink -> listByParentNextSinglePage(nextLink, context)); + } + + /** + * 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 response of a NodePool list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByParentNext(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 response of a NodePool list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByParentNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByParentNextSync(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. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a NodePool list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByParentNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByParentNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/NodePoolsImpl.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/NodePoolsImpl.java new file mode 100644 index 000000000000..5088a7b24c4d --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/NodePoolsImpl.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.NodePoolsClient; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.NodePoolInner; +import com.azure.resourcemanager.redhatopenshifthcp.models.NodePool; +import com.azure.resourcemanager.redhatopenshifthcp.models.NodePools; + +public final class NodePoolsImpl implements NodePools { + private static final ClientLogger LOGGER = new ClientLogger(NodePoolsImpl.class); + + private final NodePoolsClient innerClient; + + private final com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager; + + public NodePoolsImpl(NodePoolsClient innerClient, + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + String nodePoolName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NodePoolImpl(inner.getValue(), this.manager())); + } + + public NodePool get(String resourceGroupName, String hcpOpenShiftClusterName, String nodePoolName) { + NodePoolInner inner = this.serviceClient().get(resourceGroupName, hcpOpenShiftClusterName, nodePoolName); + if (inner != null) { + return new NodePoolImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String hcpOpenShiftClusterName, String nodePoolName) { + this.serviceClient().delete(resourceGroupName, hcpOpenShiftClusterName, nodePoolName); + } + + public void delete(String resourceGroupName, String hcpOpenShiftClusterName, String nodePoolName, Context context) { + this.serviceClient().delete(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, context); + } + + public PagedIterable listByParent(String resourceGroupName, String hcpOpenShiftClusterName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, hcpOpenShiftClusterName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NodePoolImpl(inner1, this.manager())); + } + + public PagedIterable listByParent(String resourceGroupName, String hcpOpenShiftClusterName, + Context context) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, hcpOpenShiftClusterName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NodePoolImpl(inner1, this.manager())); + } + + public NodePool getById(String id) { + 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 hcpOpenShiftClusterName = ResourceManagerUtils.getValueFromIdByName(id, "hcpOpenShiftClusters"); + if (hcpOpenShiftClusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hcpOpenShiftClusters'.", id))); + } + String nodePoolName = ResourceManagerUtils.getValueFromIdByName(id, "nodePools"); + if (nodePoolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'nodePools'.", id))); + } + return this.getWithResponse(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + 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 hcpOpenShiftClusterName = ResourceManagerUtils.getValueFromIdByName(id, "hcpOpenShiftClusters"); + if (hcpOpenShiftClusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hcpOpenShiftClusters'.", id))); + } + String nodePoolName = ResourceManagerUtils.getValueFromIdByName(id, "nodePools"); + if (nodePoolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'nodePools'.", id))); + } + return this.getWithResponse(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, context); + } + + public void deleteById(String id) { + 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 hcpOpenShiftClusterName = ResourceManagerUtils.getValueFromIdByName(id, "hcpOpenShiftClusters"); + if (hcpOpenShiftClusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hcpOpenShiftClusters'.", id))); + } + String nodePoolName = ResourceManagerUtils.getValueFromIdByName(id, "nodePools"); + if (nodePoolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'nodePools'.", id))); + } + this.delete(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + 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 hcpOpenShiftClusterName = ResourceManagerUtils.getValueFromIdByName(id, "hcpOpenShiftClusters"); + if (hcpOpenShiftClusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hcpOpenShiftClusters'.", id))); + } + String nodePoolName = ResourceManagerUtils.getValueFromIdByName(id, "nodePools"); + if (nodePoolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'nodePools'.", id))); + } + this.delete(resourceGroupName, hcpOpenShiftClusterName, nodePoolName, context); + } + + private NodePoolsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager() { + return this.serviceManager; + } + + public NodePoolImpl define(String name) { + return new NodePoolImpl(name, this.manager()); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/OperationImpl.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/OperationImpl.java new file mode 100644 index 000000000000..7e28999115c0 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/OperationImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation; + +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.OperationInner; +import com.azure.resourcemanager.redhatopenshifthcp.models.ActionType; +import com.azure.resourcemanager.redhatopenshifthcp.models.Operation; +import com.azure.resourcemanager.redhatopenshifthcp.models.OperationDisplay; +import com.azure.resourcemanager.redhatopenshifthcp.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager; + + OperationImpl(OperationInner innerObject, + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/OperationsClientImpl.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..94abb41b2b5c --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/OperationsClientImpl.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.OperationsClient; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.OperationInner; +import com.azure.resourcemanager.redhatopenshifthcp.implementation.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public final class OperationsClientImpl implements OperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final OperationsService service; + + /** + * The service client containing this operation class. + */ + private final RedHatOpenShiftHostedControlPlanesManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(RedHatOpenShiftHostedControlPlanesManagementClientImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RedHatOpenShiftHostedControlPlanesManagementClientOperations to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RedHatOpenShiftHostedControlPlanesManagementClientOperations") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.RedHatOpenShift/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + 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.RedHatOpenShift/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> 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); + } + + /** + * 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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext( + 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())); + } + + /** + * 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 a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + 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); + } + + /** + * 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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + 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); + } + + /** + * 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 a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * 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 a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * 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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + 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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + 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. + * + * @param nextLink The URL to get the next list of items. + * @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 list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + 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); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/OperationsImpl.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/OperationsImpl.java new file mode 100644 index 000000000000..dbb33bb6782f --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.OperationsClient; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.OperationInner; +import com.azure.resourcemanager.redhatopenshifthcp.models.Operation; +import com.azure.resourcemanager.redhatopenshifthcp.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.redhatopenshifthcp.RedHatOpenShiftHostedControlPlanesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/RedHatOpenShiftHostedControlPlanesManagementClientBuilder.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/RedHatOpenShiftHostedControlPlanesManagementClientBuilder.java new file mode 100644 index 000000000000..9e7ff209875b --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/RedHatOpenShiftHostedControlPlanesManagementClientBuilder.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** + * A builder for creating a new instance of the RedHatOpenShiftHostedControlPlanesManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { RedHatOpenShiftHostedControlPlanesManagementClientImpl.class }) +public final class RedHatOpenShiftHostedControlPlanesManagementClientBuilder { + /* + * Service host + */ + private String endpoint; + + /** + * Sets Service host. + * + * @param endpoint the endpoint value. + * @return the RedHatOpenShiftHostedControlPlanesManagementClientBuilder. + */ + public RedHatOpenShiftHostedControlPlanesManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @param subscriptionId the subscriptionId value. + * @return the RedHatOpenShiftHostedControlPlanesManagementClientBuilder. + */ + public RedHatOpenShiftHostedControlPlanesManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the RedHatOpenShiftHostedControlPlanesManagementClientBuilder. + */ + public RedHatOpenShiftHostedControlPlanesManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the RedHatOpenShiftHostedControlPlanesManagementClientBuilder. + */ + public RedHatOpenShiftHostedControlPlanesManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the RedHatOpenShiftHostedControlPlanesManagementClientBuilder. + */ + public RedHatOpenShiftHostedControlPlanesManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the RedHatOpenShiftHostedControlPlanesManagementClientBuilder. + */ + public RedHatOpenShiftHostedControlPlanesManagementClientBuilder + serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of RedHatOpenShiftHostedControlPlanesManagementClientImpl with the provided parameters. + * + * @return an instance of RedHatOpenShiftHostedControlPlanesManagementClientImpl. + */ + public RedHatOpenShiftHostedControlPlanesManagementClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + RedHatOpenShiftHostedControlPlanesManagementClientImpl client + = new RedHatOpenShiftHostedControlPlanesManagementClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); + return client; + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/RedHatOpenShiftHostedControlPlanesManagementClientImpl.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/RedHatOpenShiftHostedControlPlanesManagementClientImpl.java new file mode 100644 index 000000000000..08f1ba15f56a --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/RedHatOpenShiftHostedControlPlanesManagementClientImpl.java @@ -0,0 +1,391 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +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.redhatopenshifthcp.fluent.ExternalAuthsClient; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.HcpOpenShiftClustersClient; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.HcpOpenShiftVersionsClient; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.HcpOperatorIdentityRoleSetsClient; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.NodePoolsClient; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.OperationsClient; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.RedHatOpenShiftHostedControlPlanesManagementClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the RedHatOpenShiftHostedControlPlanesManagementClientImpl type. + */ +@ServiceClient(builder = RedHatOpenShiftHostedControlPlanesManagementClientBuilder.class) +public final class RedHatOpenShiftHostedControlPlanesManagementClientImpl + implements RedHatOpenShiftHostedControlPlanesManagementClient { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Version parameter. + */ + private final String apiVersion; + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + 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. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The default poll interval for long-running operation. + */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** + * The OperationsClient object to access its operations. + */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** + * The HcpOpenShiftClustersClient object to access its operations. + */ + private final HcpOpenShiftClustersClient hcpOpenShiftClusters; + + /** + * Gets the HcpOpenShiftClustersClient object to access its operations. + * + * @return the HcpOpenShiftClustersClient object. + */ + public HcpOpenShiftClustersClient getHcpOpenShiftClusters() { + return this.hcpOpenShiftClusters; + } + + /** + * The NodePoolsClient object to access its operations. + */ + private final NodePoolsClient nodePools; + + /** + * Gets the NodePoolsClient object to access its operations. + * + * @return the NodePoolsClient object. + */ + public NodePoolsClient getNodePools() { + return this.nodePools; + } + + /** + * The ExternalAuthsClient object to access its operations. + */ + private final ExternalAuthsClient externalAuths; + + /** + * Gets the ExternalAuthsClient object to access its operations. + * + * @return the ExternalAuthsClient object. + */ + public ExternalAuthsClient getExternalAuths() { + return this.externalAuths; + } + + /** + * The HcpOpenShiftVersionsClient object to access its operations. + */ + private final HcpOpenShiftVersionsClient hcpOpenShiftVersions; + + /** + * Gets the HcpOpenShiftVersionsClient object to access its operations. + * + * @return the HcpOpenShiftVersionsClient object. + */ + public HcpOpenShiftVersionsClient getHcpOpenShiftVersions() { + return this.hcpOpenShiftVersions; + } + + /** + * The HcpOperatorIdentityRoleSetsClient object to access its operations. + */ + private final HcpOperatorIdentityRoleSetsClient hcpOperatorIdentityRoleSets; + + /** + * Gets the HcpOperatorIdentityRoleSetsClient object to access its operations. + * + * @return the HcpOperatorIdentityRoleSetsClient object. + */ + public HcpOperatorIdentityRoleSetsClient getHcpOperatorIdentityRoleSets() { + return this.hcpOperatorIdentityRoleSets; + } + + /** + * Initializes an instance of RedHatOpenShiftHostedControlPlanesManagementClient 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 endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + */ + RedHatOpenShiftHostedControlPlanesManagementClientImpl(HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, Duration defaultPollInterval, AzureEnvironment environment, + String endpoint, String subscriptionId) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.endpoint = endpoint; + this.subscriptionId = subscriptionId; + this.apiVersion = "2026-06-30-preview"; + this.operations = new OperationsClientImpl(this); + this.hcpOpenShiftClusters = new HcpOpenShiftClustersClientImpl(this); + this.nodePools = new NodePoolsClientImpl(this); + this.externalAuths = new ExternalAuthsClientImpl(this); + this.hcpOpenShiftVersions = new HcpOpenShiftVersionsClientImpl(this); + this.hcpOperatorIdentityRoleSets = new HcpOperatorIdentityRoleSetsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param 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. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? new byte[0] : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(HttpHeaderName.fromString(s)); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER + = new ClientLogger(RedHatOpenShiftHostedControlPlanesManagementClientImpl.class); +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/ResourceManagerUtils.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/ResourceManagerUtils.java new file mode 100644 index 000000000000..7b44713fd98b --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (!segments.isEmpty() && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl<>(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/models/ExternalAuthListResult.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/models/ExternalAuthListResult.java new file mode 100644 index 000000000000..588143163658 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/models/ExternalAuthListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.ExternalAuthInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ExternalAuth list operation. + */ +@Immutable +public final class ExternalAuthListResult implements JsonSerializable { + /* + * The ExternalAuth items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ExternalAuthListResult class. + */ + private ExternalAuthListResult() { + } + + /** + * Get the value property: The ExternalAuth items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExternalAuthListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExternalAuthListResult 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 ExternalAuthListResult. + */ + public static ExternalAuthListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExternalAuthListResult deserializedExternalAuthListResult = new ExternalAuthListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ExternalAuthInner.fromJson(reader1)); + deserializedExternalAuthListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedExternalAuthListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExternalAuthListResult; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/models/HcpOpenShiftClusterListResult.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/models/HcpOpenShiftClusterListResult.java new file mode 100644 index 000000000000..e6490c565bd2 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/models/HcpOpenShiftClusterListResult.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOpenShiftClusterInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a HcpOpenShiftCluster list operation. + */ +@Immutable +public final class HcpOpenShiftClusterListResult implements JsonSerializable { + /* + * The HcpOpenShiftCluster items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of HcpOpenShiftClusterListResult class. + */ + private HcpOpenShiftClusterListResult() { + } + + /** + * Get the value property: The HcpOpenShiftCluster items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HcpOpenShiftClusterListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HcpOpenShiftClusterListResult 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 HcpOpenShiftClusterListResult. + */ + public static HcpOpenShiftClusterListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HcpOpenShiftClusterListResult deserializedHcpOpenShiftClusterListResult + = new HcpOpenShiftClusterListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> HcpOpenShiftClusterInner.fromJson(reader1)); + deserializedHcpOpenShiftClusterListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedHcpOpenShiftClusterListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHcpOpenShiftClusterListResult; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/models/HcpOpenShiftVersionListResult.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/models/HcpOpenShiftVersionListResult.java new file mode 100644 index 000000000000..2929bee66a1a --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/models/HcpOpenShiftVersionListResult.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOpenShiftVersionInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a HcpOpenShiftVersion list operation. + */ +@Immutable +public final class HcpOpenShiftVersionListResult implements JsonSerializable { + /* + * The HcpOpenShiftVersion items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of HcpOpenShiftVersionListResult class. + */ + private HcpOpenShiftVersionListResult() { + } + + /** + * Get the value property: The HcpOpenShiftVersion items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HcpOpenShiftVersionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HcpOpenShiftVersionListResult 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 HcpOpenShiftVersionListResult. + */ + public static HcpOpenShiftVersionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HcpOpenShiftVersionListResult deserializedHcpOpenShiftVersionListResult + = new HcpOpenShiftVersionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> HcpOpenShiftVersionInner.fromJson(reader1)); + deserializedHcpOpenShiftVersionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedHcpOpenShiftVersionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHcpOpenShiftVersionListResult; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/models/HcpOperatorIdentityRoleSetListResult.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/models/HcpOperatorIdentityRoleSetListResult.java new file mode 100644 index 000000000000..94b5d0d9fd51 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/models/HcpOperatorIdentityRoleSetListResult.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOperatorIdentityRoleSetInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a HcpOperatorIdentityRoleSet list operation. + */ +@Immutable +public final class HcpOperatorIdentityRoleSetListResult + implements JsonSerializable { + /* + * The HcpOperatorIdentityRoleSet items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of HcpOperatorIdentityRoleSetListResult class. + */ + private HcpOperatorIdentityRoleSetListResult() { + } + + /** + * Get the value property: The HcpOperatorIdentityRoleSet items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HcpOperatorIdentityRoleSetListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HcpOperatorIdentityRoleSetListResult 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 HcpOperatorIdentityRoleSetListResult. + */ + public static HcpOperatorIdentityRoleSetListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HcpOperatorIdentityRoleSetListResult deserializedHcpOperatorIdentityRoleSetListResult + = new HcpOperatorIdentityRoleSetListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> HcpOperatorIdentityRoleSetInner.fromJson(reader1)); + deserializedHcpOperatorIdentityRoleSetListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedHcpOperatorIdentityRoleSetListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHcpOperatorIdentityRoleSetListResult; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/models/NodePoolListResult.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/models/NodePoolListResult.java new file mode 100644 index 000000000000..ce417f421ea8 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/models/NodePoolListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.NodePoolInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a NodePool list operation. + */ +@Immutable +public final class NodePoolListResult implements JsonSerializable { + /* + * The NodePool items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of NodePoolListResult class. + */ + private NodePoolListResult() { + } + + /** + * Get the value property: The NodePool items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NodePoolListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NodePoolListResult 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 NodePoolListResult. + */ + public static NodePoolListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NodePoolListResult deserializedNodePoolListResult = new NodePoolListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> NodePoolInner.fromJson(reader1)); + deserializedNodePoolListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNodePoolListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNodePoolListResult; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/models/OperationListResult.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/models/OperationListResult.java new file mode 100644 index 000000000000..2725dd905897 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/models/OperationListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.OperationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult implements JsonSerializable { + /* + * The Operation items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + private OperationListResult() { + } + + /** + * Get the value property: The Operation items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult 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 OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/package-info.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/package-info.java new file mode 100644 index 000000000000..ffbbd535655f --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/implementation/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the implementations for RedHatOpenShiftHostedControlPlanes. + */ +package com.azure.resourcemanager.redhatopenshifthcp.implementation; diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ActionType.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ActionType.java new file mode 100644 index 000000000000..a8ed8f46488e --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/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.redhatopenshifthcp.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/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ApiProfile.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ApiProfile.java new file mode 100644 index 000000000000..7d8f1b1a58b1 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ApiProfile.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Information about the API of a cluster. + */ +@Fluent +public final class ApiProfile implements JsonSerializable { + /* + * URL endpoint for the API server + */ + private String url; + + /* + * The internet visibility of the OpenShift API server + */ + private Visibility visibility; + + /* + * The list of authorized IPv4 CIDR blocks allowed to access the API server. Maximum 500 entries. + */ + private List authorizedCIDRs; + + /** + * Creates an instance of ApiProfile class. + */ + public ApiProfile() { + } + + /** + * Get the url property: URL endpoint for the API server. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Get the visibility property: The internet visibility of the OpenShift API server. + * + * @return the visibility value. + */ + public Visibility visibility() { + return this.visibility; + } + + /** + * Set the visibility property: The internet visibility of the OpenShift API server. + * + * @param visibility the visibility value to set. + * @return the ApiProfile object itself. + */ + public ApiProfile withVisibility(Visibility visibility) { + this.visibility = visibility; + return this; + } + + /** + * Get the authorizedCIDRs property: The list of authorized IPv4 CIDR blocks allowed to access the API server. + * Maximum 500 entries. + * + * @return the authorizedCIDRs value. + */ + public List authorizedCIDRs() { + return this.authorizedCIDRs; + } + + /** + * Set the authorizedCIDRs property: The list of authorized IPv4 CIDR blocks allowed to access the API server. + * Maximum 500 entries. + * + * @param authorizedCIDRs the authorizedCIDRs value to set. + * @return the ApiProfile object itself. + */ + public ApiProfile withAuthorizedCIDRs(List authorizedCIDRs) { + this.authorizedCIDRs = authorizedCIDRs; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("visibility", this.visibility == null ? null : this.visibility.toString()); + jsonWriter.writeArrayField("authorizedCidrs", this.authorizedCIDRs, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiProfile 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 ApiProfile. + */ + public static ApiProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiProfile deserializedApiProfile = new ApiProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("url".equals(fieldName)) { + deserializedApiProfile.url = reader.getString(); + } else if ("visibility".equals(fieldName)) { + deserializedApiProfile.visibility = Visibility.fromString(reader.getString()); + } else if ("authorizedCidrs".equals(fieldName)) { + List authorizedCIDRs = reader.readArray(reader1 -> reader1.getString()); + deserializedApiProfile.authorizedCIDRs = authorizedCIDRs; + } else { + reader.skipChildren(); + } + } + + return deserializedApiProfile; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ClusterAutoscalingProfile.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ClusterAutoscalingProfile.java new file mode 100644 index 000000000000..c5be321e78e8 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ClusterAutoscalingProfile.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * ClusterAutoscaling specifies auto-scaling behavior that + * applies to all NodePools associated with a control plane. + */ +@Fluent +public final class ClusterAutoscalingProfile implements JsonSerializable { + /* + * maxNodesTotal is the maximum allowable number of nodes for the Autoscaler scale out to be operational. + * The autoscaler will not grow the cluster beyond this number. If omitted, the autoscaler will not have a maximum + * limit. + */ + private Integer maxNodesTotal; + + /* + * maxPodGracePeriod is the maximum seconds to wait for graceful pod termination before scaling down a NodePool. + * The default is 600 seconds. + */ + private Integer maxPodGracePeriodSeconds; + + /* + * maxNodeProvisionTimeSeconds is the maximum time to wait for node provisioning before considering the + * provisioning to be unsuccessful. The default is 900 seconds, or 15 minutes. + */ + private Integer maxNodeProvisionTimeSeconds; + + /* + * podPriorityThreshold enables users to schedule "best-effort" pods, which shouldn't trigger autoscaler actions, + * but only run when there are spare resources available. The default is -10. + * See the following for more details: + * https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#how-does-cluster-autoscaler-work- + * with-pod-priority-and-preemption + */ + private Integer podPriorityThreshold; + + /** + * Creates an instance of ClusterAutoscalingProfile class. + */ + public ClusterAutoscalingProfile() { + } + + /** + * Get the maxNodesTotal property: maxNodesTotal is the maximum allowable number of nodes for the Autoscaler scale + * out to be operational. + * The autoscaler will not grow the cluster beyond this number. If omitted, the autoscaler will not have a maximum + * limit. + * + * @return the maxNodesTotal value. + */ + public Integer maxNodesTotal() { + return this.maxNodesTotal; + } + + /** + * Set the maxNodesTotal property: maxNodesTotal is the maximum allowable number of nodes for the Autoscaler scale + * out to be operational. + * The autoscaler will not grow the cluster beyond this number. If omitted, the autoscaler will not have a maximum + * limit. + * + * @param maxNodesTotal the maxNodesTotal value to set. + * @return the ClusterAutoscalingProfile object itself. + */ + public ClusterAutoscalingProfile withMaxNodesTotal(Integer maxNodesTotal) { + this.maxNodesTotal = maxNodesTotal; + return this; + } + + /** + * Get the maxPodGracePeriodSeconds property: maxPodGracePeriod is the maximum seconds to wait for graceful pod + * termination before scaling down a NodePool. + * The default is 600 seconds. + * + * @return the maxPodGracePeriodSeconds value. + */ + public Integer maxPodGracePeriodSeconds() { + return this.maxPodGracePeriodSeconds; + } + + /** + * Set the maxPodGracePeriodSeconds property: maxPodGracePeriod is the maximum seconds to wait for graceful pod + * termination before scaling down a NodePool. + * The default is 600 seconds. + * + * @param maxPodGracePeriodSeconds the maxPodGracePeriodSeconds value to set. + * @return the ClusterAutoscalingProfile object itself. + */ + public ClusterAutoscalingProfile withMaxPodGracePeriodSeconds(Integer maxPodGracePeriodSeconds) { + this.maxPodGracePeriodSeconds = maxPodGracePeriodSeconds; + return this; + } + + /** + * Get the maxNodeProvisionTimeSeconds property: maxNodeProvisionTimeSeconds is the maximum time to wait for node + * provisioning before considering the + * provisioning to be unsuccessful. The default is 900 seconds, or 15 minutes. + * + * @return the maxNodeProvisionTimeSeconds value. + */ + public Integer maxNodeProvisionTimeSeconds() { + return this.maxNodeProvisionTimeSeconds; + } + + /** + * Set the maxNodeProvisionTimeSeconds property: maxNodeProvisionTimeSeconds is the maximum time to wait for node + * provisioning before considering the + * provisioning to be unsuccessful. The default is 900 seconds, or 15 minutes. + * + * @param maxNodeProvisionTimeSeconds the maxNodeProvisionTimeSeconds value to set. + * @return the ClusterAutoscalingProfile object itself. + */ + public ClusterAutoscalingProfile withMaxNodeProvisionTimeSeconds(Integer maxNodeProvisionTimeSeconds) { + this.maxNodeProvisionTimeSeconds = maxNodeProvisionTimeSeconds; + return this; + } + + /** + * Get the podPriorityThreshold property: podPriorityThreshold enables users to schedule "best-effort" pods, which + * shouldn't trigger autoscaler actions, + * but only run when there are spare resources available. The default is -10. + * See the following for more details: + * https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#how-does-cluster-autoscaler-work-with-pod-priority-and-preemption. + * + * @return the podPriorityThreshold value. + */ + public Integer podPriorityThreshold() { + return this.podPriorityThreshold; + } + + /** + * Set the podPriorityThreshold property: podPriorityThreshold enables users to schedule "best-effort" pods, which + * shouldn't trigger autoscaler actions, + * but only run when there are spare resources available. The default is -10. + * See the following for more details: + * https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#how-does-cluster-autoscaler-work-with-pod-priority-and-preemption. + * + * @param podPriorityThreshold the podPriorityThreshold value to set. + * @return the ClusterAutoscalingProfile object itself. + */ + public ClusterAutoscalingProfile withPodPriorityThreshold(Integer podPriorityThreshold) { + this.podPriorityThreshold = podPriorityThreshold; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("maxNodesTotal", this.maxNodesTotal); + jsonWriter.writeNumberField("maxPodGracePeriodSeconds", this.maxPodGracePeriodSeconds); + jsonWriter.writeNumberField("maxNodeProvisionTimeSeconds", this.maxNodeProvisionTimeSeconds); + jsonWriter.writeNumberField("podPriorityThreshold", this.podPriorityThreshold); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterAutoscalingProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterAutoscalingProfile if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterAutoscalingProfile. + */ + public static ClusterAutoscalingProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterAutoscalingProfile deserializedClusterAutoscalingProfile = new ClusterAutoscalingProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxNodesTotal".equals(fieldName)) { + deserializedClusterAutoscalingProfile.maxNodesTotal = reader.getNullable(JsonReader::getInt); + } else if ("maxPodGracePeriodSeconds".equals(fieldName)) { + deserializedClusterAutoscalingProfile.maxPodGracePeriodSeconds + = reader.getNullable(JsonReader::getInt); + } else if ("maxNodeProvisionTimeSeconds".equals(fieldName)) { + deserializedClusterAutoscalingProfile.maxNodeProvisionTimeSeconds + = reader.getNullable(JsonReader::getInt); + } else if ("podPriorityThreshold".equals(fieldName)) { + deserializedClusterAutoscalingProfile.podPriorityThreshold = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterAutoscalingProfile; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ClusterImageRegistryProfile.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ClusterImageRegistryProfile.java new file mode 100644 index 000000000000..b52f62de3f0f --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ClusterImageRegistryProfile.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * OpenShift cluster image registry. + */ +@Fluent +public final class ClusterImageRegistryProfile implements JsonSerializable { + /* + * state indicates the desired ImageStream-backed cluster image registry installation mode. + * This can only be set during cluster creation and cannot be changed after cluster creation. + * Enabled means the ImageStream-backed image registry will be run as pods on worker nodes in + * the cluster. Disabled means the ImageStream-backed image registry will not be present in + * the cluster. The default is Enabled. + */ + private ClusterImageRegistryState state; + + /** + * Creates an instance of ClusterImageRegistryProfile class. + */ + public ClusterImageRegistryProfile() { + } + + /** + * Get the state property: state indicates the desired ImageStream-backed cluster image registry installation mode. + * This can only be set during cluster creation and cannot be changed after cluster creation. + * Enabled means the ImageStream-backed image registry will be run as pods on worker nodes in + * the cluster. Disabled means the ImageStream-backed image registry will not be present in + * the cluster. The default is Enabled. + * + * @return the state value. + */ + public ClusterImageRegistryState state() { + return this.state; + } + + /** + * Set the state property: state indicates the desired ImageStream-backed cluster image registry installation mode. + * This can only be set during cluster creation and cannot be changed after cluster creation. + * Enabled means the ImageStream-backed image registry will be run as pods on worker nodes in + * the cluster. Disabled means the ImageStream-backed image registry will not be present in + * the cluster. The default is Enabled. + * + * @param state the state value to set. + * @return the ClusterImageRegistryProfile object itself. + */ + public ClusterImageRegistryProfile withState(ClusterImageRegistryState state) { + this.state = state; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterImageRegistryProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterImageRegistryProfile if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterImageRegistryProfile. + */ + public static ClusterImageRegistryProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterImageRegistryProfile deserializedClusterImageRegistryProfile = new ClusterImageRegistryProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedClusterImageRegistryProfile.state + = ClusterImageRegistryState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterImageRegistryProfile; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ClusterImageRegistryState.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ClusterImageRegistryState.java new file mode 100644 index 000000000000..633ead55411c --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ClusterImageRegistryState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The desired state of the ImageStream-backed cluster image registry. + */ +public final class ClusterImageRegistryState extends ExpandableStringEnum { + /** + * The ImageStream-backed image registry will be run as pods on worker nodes. + */ + public static final ClusterImageRegistryState ENABLED = fromString("Enabled"); + + /** + * The ImageStream-backed image registry will not be present in the cluster. + */ + public static final ClusterImageRegistryState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of ClusterImageRegistryState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterImageRegistryState() { + } + + /** + * Creates or finds a ClusterImageRegistryState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterImageRegistryState. + */ + public static ClusterImageRegistryState fromString(String name) { + return fromString(name, ClusterImageRegistryState.class); + } + + /** + * Gets known ClusterImageRegistryState values. + * + * @return known ClusterImageRegistryState values. + */ + public static Collection values() { + return values(ClusterImageRegistryState.class); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/Condition.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/Condition.java new file mode 100644 index 000000000000..d0bd14e1a080 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/Condition.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Condition represents an observation of a resource's state. + */ +@Immutable +public final class Condition implements JsonSerializable { + /* + * Type of the condition. + * This is a PascalCase identifier representing the type of the condition. + */ + private ConditionType type; + + /* + * The status of the condition. + */ + private StatusType status; + + /* + * The last time the condition transitioned from one status to another. + */ + private OffsetDateTime lastTransitionTime; + + /* + * A programmatic identifier indicating the reason for the condition's last transition. + * This value should be a CamelCase string. + */ + private String reason; + + /* + * A human readable message indicating details about the transition. + * This may be an empty string. + */ + private String message; + + /** + * Creates an instance of Condition class. + */ + private Condition() { + } + + /** + * Get the type property: Type of the condition. + * This is a PascalCase identifier representing the type of the condition. + * + * @return the type value. + */ + public ConditionType type() { + return this.type; + } + + /** + * Get the status property: The status of the condition. + * + * @return the status value. + */ + public StatusType status() { + return this.status; + } + + /** + * Get the lastTransitionTime property: The last time the condition transitioned from one status to another. + * + * @return the lastTransitionTime value. + */ + public OffsetDateTime lastTransitionTime() { + return this.lastTransitionTime; + } + + /** + * Get the reason property: A programmatic identifier indicating the reason for the condition's last transition. + * This value should be a CamelCase string. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Get the message property: A human readable message indicating details about the transition. + * This may be an empty string. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Condition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Condition 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 Condition. + */ + public static Condition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Condition deserializedCondition = new Condition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedCondition.type = ConditionType.fromString(reader.getString()); + } else if ("status".equals(fieldName)) { + deserializedCondition.status = StatusType.fromString(reader.getString()); + } else if ("lastTransitionTime".equals(fieldName)) { + deserializedCondition.lastTransitionTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("reason".equals(fieldName)) { + deserializedCondition.reason = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedCondition.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCondition; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ConditionType.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ConditionType.java new file mode 100644 index 000000000000..24a5f2c5ac2c --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ConditionType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Representation of the possible condition types. + */ +public final class ConditionType extends ExpandableStringEnum { + /** + * Indicates that the resource is available. + */ + public static final ConditionType AVAILABLE = fromString("Available"); + + /** + * Indicates that the resource is in a degraded state. + */ + public static final ConditionType DEGRADED = fromString("Degraded"); + + /** + * Indicates that the resource is in a progressing state. + */ + public static final ConditionType PROGRESSING = fromString("Progressing"); + + /** + * Creates a new instance of ConditionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConditionType() { + } + + /** + * Creates or finds a ConditionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConditionType. + */ + public static ConditionType fromString(String name) { + return fromString(name, ConditionType.class); + } + + /** + * Gets known ConditionType values. + * + * @return known ConditionType values. + */ + public static Collection values() { + return values(ConditionType.class); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ConsoleProfile.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ConsoleProfile.java new file mode 100644 index 000000000000..376b1919394a --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ConsoleProfile.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configuration of the cluster web console. + */ +@Immutable +public final class ConsoleProfile implements JsonSerializable { + /* + * The cluster web console URL endpoint + */ + private String url; + + /** + * Creates an instance of ConsoleProfile class. + */ + private ConsoleProfile() { + } + + /** + * Get the url property: The cluster web console URL endpoint. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConsoleProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConsoleProfile 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 ConsoleProfile. + */ + public static ConsoleProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConsoleProfile deserializedConsoleProfile = new ConsoleProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("url".equals(fieldName)) { + deserializedConsoleProfile.url = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConsoleProfile; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/CryptoRestrictions.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/CryptoRestrictions.java new file mode 100644 index 000000000000..9600e1d9a5f6 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/CryptoRestrictions.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Cryptographic restrictions for kernel and userspace libraries. + */ +public final class CryptoRestrictions extends ExpandableStringEnum { + /** + * No restrictions. + */ + public static final CryptoRestrictions NONE = fromString("None"); + + /** + * Use only FIPS-validated algorithms and implementations. + */ + public static final CryptoRestrictions FIPS = fromString("FIPS"); + + /** + * Creates a new instance of CryptoRestrictions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CryptoRestrictions() { + } + + /** + * Creates or finds a CryptoRestrictions from its string representation. + * + * @param name a name to look for. + * @return the corresponding CryptoRestrictions. + */ + public static CryptoRestrictions fromString(String name) { + return fromString(name, CryptoRestrictions.class); + } + + /** + * Gets known CryptoRestrictions values. + * + * @return known CryptoRestrictions values. + */ + public static Collection values() { + return values(CryptoRestrictions.class); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/CustomerManagedEncryptionProfile.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/CustomerManagedEncryptionProfile.java new file mode 100644 index 000000000000..ced0cee567ce --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/CustomerManagedEncryptionProfile.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Customer managed encryption key profile. + */ +@Fluent +public final class CustomerManagedEncryptionProfile implements JsonSerializable { + /* + * The encryption type used. + * By default, "KMS" is used. + */ + private CustomerManagedEncryptionType encryptionType; + + /* + * The Key Management Service (KMS) encryption key details. + * + * Required when encryptionType is "KMS". + */ + private KmsEncryptionProfile kms; + + /** + * Creates an instance of CustomerManagedEncryptionProfile class. + */ + public CustomerManagedEncryptionProfile() { + } + + /** + * Get the encryptionType property: The encryption type used. + * By default, "KMS" is used. + * + * @return the encryptionType value. + */ + public CustomerManagedEncryptionType encryptionType() { + return this.encryptionType; + } + + /** + * Set the encryptionType property: The encryption type used. + * By default, "KMS" is used. + * + * @param encryptionType the encryptionType value to set. + * @return the CustomerManagedEncryptionProfile object itself. + */ + public CustomerManagedEncryptionProfile withEncryptionType(CustomerManagedEncryptionType encryptionType) { + this.encryptionType = encryptionType; + return this; + } + + /** + * Get the kms property: The Key Management Service (KMS) encryption key details. + * + * Required when encryptionType is "KMS". + * + * @return the kms value. + */ + public KmsEncryptionProfile kms() { + return this.kms; + } + + /** + * Set the kms property: The Key Management Service (KMS) encryption key details. + * + * Required when encryptionType is "KMS". + * + * @param kms the kms value to set. + * @return the CustomerManagedEncryptionProfile object itself. + */ + public CustomerManagedEncryptionProfile withKms(KmsEncryptionProfile kms) { + this.kms = kms; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("encryptionType", + this.encryptionType == null ? null : this.encryptionType.toString()); + jsonWriter.writeJsonField("kms", this.kms); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomerManagedEncryptionProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomerManagedEncryptionProfile if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomerManagedEncryptionProfile. + */ + public static CustomerManagedEncryptionProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomerManagedEncryptionProfile deserializedCustomerManagedEncryptionProfile + = new CustomerManagedEncryptionProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("encryptionType".equals(fieldName)) { + deserializedCustomerManagedEncryptionProfile.encryptionType + = CustomerManagedEncryptionType.fromString(reader.getString()); + } else if ("kms".equals(fieldName)) { + deserializedCustomerManagedEncryptionProfile.kms = KmsEncryptionProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomerManagedEncryptionProfile; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/CustomerManagedEncryptionType.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/CustomerManagedEncryptionType.java new file mode 100644 index 000000000000..4601c3fc7b7c --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/CustomerManagedEncryptionType.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.redhatopenshifthcp.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The encryption types supported for a customer managed key. + */ +public final class CustomerManagedEncryptionType extends ExpandableStringEnum { + /** + * KMS encryption type. + */ + public static final CustomerManagedEncryptionType KMS = fromString("KMS"); + + /** + * Creates a new instance of CustomerManagedEncryptionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CustomerManagedEncryptionType() { + } + + /** + * Creates or finds a CustomerManagedEncryptionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CustomerManagedEncryptionType. + */ + public static CustomerManagedEncryptionType fromString(String name) { + return fromString(name, CustomerManagedEncryptionType.class); + } + + /** + * Gets known CustomerManagedEncryptionType values. + * + * @return known CustomerManagedEncryptionType values. + */ + public static Collection values() { + return values(CustomerManagedEncryptionType.class); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/DiskStorageAccountType.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/DiskStorageAccountType.java new file mode 100644 index 000000000000..0b6d96cdb882 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/DiskStorageAccountType.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.redhatopenshifthcp.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Supported Azure storage account types + * - https://learn.microsoft.com/en-us/azure/virtual-machines/disks-types. + */ +public final class DiskStorageAccountType extends ExpandableStringEnum { + /** + * Premium SSD with Locally Redundant Storage (LRS). + */ + public static final DiskStorageAccountType PREMIUM_LRS = fromString("Premium_LRS"); + + /** + * Standard SSD with Locally Redundant Storage (LRS). + */ + public static final DiskStorageAccountType STANDARD_SSD_LRS = fromString("StandardSSD_LRS"); + + /** + * Standard HDD with Locally Redundant Storage (LRS). + */ + public static final DiskStorageAccountType STANDARD_LRS = fromString("Standard_LRS"); + + /** + * Creates a new instance of DiskStorageAccountType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiskStorageAccountType() { + } + + /** + * Creates or finds a DiskStorageAccountType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiskStorageAccountType. + */ + public static DiskStorageAccountType fromString(String name) { + return fromString(name, DiskStorageAccountType.class); + } + + /** + * Gets known DiskStorageAccountType values. + * + * @return known DiskStorageAccountType values. + */ + public static Collection values() { + return values(DiskStorageAccountType.class); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/DnsProfile.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/DnsProfile.java new file mode 100644 index 000000000000..9bb688df4415 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/DnsProfile.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * DNS contains the DNS settings of the cluster. + */ +@Fluent +public final class DnsProfile implements JsonSerializable { + /* + * BaseDomain is the base DNS domain of the cluster. + */ + private String baseDomain; + + /* + * BaseDomainPrefix is the unique name of the cluster representing the OpenShift's cluster name. + * BaseDomainPrefix is the name that will appear in the cluster's DNS, provisioned cloud providers resources + */ + private String baseDomainPrefix; + + /** + * Creates an instance of DnsProfile class. + */ + public DnsProfile() { + } + + /** + * Get the baseDomain property: BaseDomain is the base DNS domain of the cluster. + * + * @return the baseDomain value. + */ + public String baseDomain() { + return this.baseDomain; + } + + /** + * Get the baseDomainPrefix property: BaseDomainPrefix is the unique name of the cluster representing the + * OpenShift's cluster name. + * BaseDomainPrefix is the name that will appear in the cluster's DNS, provisioned cloud providers resources. + * + * @return the baseDomainPrefix value. + */ + public String baseDomainPrefix() { + return this.baseDomainPrefix; + } + + /** + * Set the baseDomainPrefix property: BaseDomainPrefix is the unique name of the cluster representing the + * OpenShift's cluster name. + * BaseDomainPrefix is the name that will appear in the cluster's DNS, provisioned cloud providers resources. + * + * @param baseDomainPrefix the baseDomainPrefix value to set. + * @return the DnsProfile object itself. + */ + public DnsProfile withBaseDomainPrefix(String baseDomainPrefix) { + this.baseDomainPrefix = baseDomainPrefix; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("baseDomainPrefix", this.baseDomainPrefix); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DnsProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DnsProfile if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the DnsProfile. + */ + public static DnsProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DnsProfile deserializedDnsProfile = new DnsProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("baseDomain".equals(fieldName)) { + deserializedDnsProfile.baseDomain = reader.getString(); + } else if ("baseDomainPrefix".equals(fieldName)) { + deserializedDnsProfile.baseDomainPrefix = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDnsProfile; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/Effect.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/Effect.java new file mode 100644 index 000000000000..3c0b39db8729 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/Effect.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The taint effect the same as in Kubernetes. + */ +public final class Effect extends ExpandableStringEnum { + /** + * NoSchedule taint effect. + */ + public static final Effect NO_SCHEDULE = fromString("NoSchedule"); + + /** + * PreferNoSchedule taint effect. + */ + public static final Effect PREFER_NO_SCHEDULE = fromString("PreferNoSchedule"); + + /** + * NoExecute taint effect. + */ + public static final Effect NO_EXECUTE = fromString("NoExecute"); + + /** + * Creates a new instance of Effect value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Effect() { + } + + /** + * Creates or finds a Effect from its string representation. + * + * @param name a name to look for. + * @return the corresponding Effect. + */ + public static Effect fromString(String name) { + return fromString(name, Effect.class); + } + + /** + * Gets known Effect values. + * + * @return known Effect values. + */ + public static Collection values() { + return values(Effect.class); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/EtcdDataEncryptionKeyManagementModeType.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/EtcdDataEncryptionKeyManagementModeType.java new file mode 100644 index 000000000000..0e9ac1720135 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/EtcdDataEncryptionKeyManagementModeType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The encryption key management mode types supported for ETCD data encryption. + */ +public final class EtcdDataEncryptionKeyManagementModeType + extends ExpandableStringEnum { + /** + * Customer managed encryption key management mode type. + */ + public static final EtcdDataEncryptionKeyManagementModeType CUSTOMER_MANAGED = fromString("CustomerManaged"); + + /** + * Creates a new instance of EtcdDataEncryptionKeyManagementModeType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EtcdDataEncryptionKeyManagementModeType() { + } + + /** + * Creates or finds a EtcdDataEncryptionKeyManagementModeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EtcdDataEncryptionKeyManagementModeType. + */ + public static EtcdDataEncryptionKeyManagementModeType fromString(String name) { + return fromString(name, EtcdDataEncryptionKeyManagementModeType.class); + } + + /** + * Gets known EtcdDataEncryptionKeyManagementModeType values. + * + * @return known EtcdDataEncryptionKeyManagementModeType values. + */ + public static Collection values() { + return values(EtcdDataEncryptionKeyManagementModeType.class); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/EtcdDataEncryptionProfile.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/EtcdDataEncryptionProfile.java new file mode 100644 index 000000000000..b2a9be3df14c --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/EtcdDataEncryptionProfile.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ETCD data encryption settings. + */ +@Fluent +public final class EtcdDataEncryptionProfile implements JsonSerializable { + /* + * Specify the key management strategy used for the encryption key that encrypts the ETCD data. + */ + private EtcdDataEncryptionKeyManagementModeType keyManagementMode; + + /* + * Specify customer managed encryption key details. + * Required when keyManagementMode is "CustomerManaged". + */ + private CustomerManagedEncryptionProfile customerManaged; + + /** + * Creates an instance of EtcdDataEncryptionProfile class. + */ + public EtcdDataEncryptionProfile() { + } + + /** + * Get the keyManagementMode property: Specify the key management strategy used for the encryption key that encrypts + * the ETCD data. + * + * @return the keyManagementMode value. + */ + public EtcdDataEncryptionKeyManagementModeType keyManagementMode() { + return this.keyManagementMode; + } + + /** + * Set the keyManagementMode property: Specify the key management strategy used for the encryption key that encrypts + * the ETCD data. + * + * @param keyManagementMode the keyManagementMode value to set. + * @return the EtcdDataEncryptionProfile object itself. + */ + public EtcdDataEncryptionProfile withKeyManagementMode(EtcdDataEncryptionKeyManagementModeType keyManagementMode) { + this.keyManagementMode = keyManagementMode; + return this; + } + + /** + * Get the customerManaged property: Specify customer managed encryption key details. + * Required when keyManagementMode is "CustomerManaged". + * + * @return the customerManaged value. + */ + public CustomerManagedEncryptionProfile customerManaged() { + return this.customerManaged; + } + + /** + * Set the customerManaged property: Specify customer managed encryption key details. + * Required when keyManagementMode is "CustomerManaged". + * + * @param customerManaged the customerManaged value to set. + * @return the EtcdDataEncryptionProfile object itself. + */ + public EtcdDataEncryptionProfile withCustomerManaged(CustomerManagedEncryptionProfile customerManaged) { + this.customerManaged = customerManaged; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyManagementMode", + this.keyManagementMode == null ? null : this.keyManagementMode.toString()); + jsonWriter.writeJsonField("customerManaged", this.customerManaged); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EtcdDataEncryptionProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EtcdDataEncryptionProfile 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 EtcdDataEncryptionProfile. + */ + public static EtcdDataEncryptionProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EtcdDataEncryptionProfile deserializedEtcdDataEncryptionProfile = new EtcdDataEncryptionProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyManagementMode".equals(fieldName)) { + deserializedEtcdDataEncryptionProfile.keyManagementMode + = EtcdDataEncryptionKeyManagementModeType.fromString(reader.getString()); + } else if ("customerManaged".equals(fieldName)) { + deserializedEtcdDataEncryptionProfile.customerManaged + = CustomerManagedEncryptionProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEtcdDataEncryptionProfile; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/EtcdProfile.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/EtcdProfile.java new file mode 100644 index 000000000000..03f78aa7b33d --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/EtcdProfile.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ETCD settings and configuration options. + */ +@Fluent +public final class EtcdProfile implements JsonSerializable { + /* + * ETCD Data Encryption settings. + * If not specified platform managed keys are used. + */ + private EtcdDataEncryptionProfile dataEncryption; + + /** + * Creates an instance of EtcdProfile class. + */ + public EtcdProfile() { + } + + /** + * Get the dataEncryption property: ETCD Data Encryption settings. + * If not specified platform managed keys are used. + * + * @return the dataEncryption value. + */ + public EtcdDataEncryptionProfile dataEncryption() { + return this.dataEncryption; + } + + /** + * Set the dataEncryption property: ETCD Data Encryption settings. + * If not specified platform managed keys are used. + * + * @param dataEncryption the dataEncryption value to set. + * @return the EtcdProfile object itself. + */ + public EtcdProfile withDataEncryption(EtcdDataEncryptionProfile dataEncryption) { + this.dataEncryption = dataEncryption; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("dataEncryption", this.dataEncryption); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EtcdProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EtcdProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EtcdProfile. + */ + public static EtcdProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EtcdProfile deserializedEtcdProfile = new EtcdProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataEncryption".equals(fieldName)) { + deserializedEtcdProfile.dataEncryption = EtcdDataEncryptionProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEtcdProfile; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuth.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuth.java new file mode 100644 index 000000000000..318b3e130039 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuth.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.ExternalAuthInner; + +/** + * An immutable client-side representation of ExternalAuth. + */ +public interface ExternalAuth { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + ExternalAuthProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.redhatopenshifthcp.fluent.models.ExternalAuthInner object. + * + * @return the inner object. + */ + ExternalAuthInner innerModel(); + + /** + * The entirety of the ExternalAuth definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The ExternalAuth definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ExternalAuth definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the ExternalAuth definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, hcpOpenShiftClusterName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @return the next definition stage. + */ + WithCreate withExistingHcpOpenShiftCluster(String resourceGroupName, String hcpOpenShiftClusterName); + } + + /** + * The stage of the ExternalAuth definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ExternalAuth create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ExternalAuth create(Context context); + } + + /** + * The stage of the ExternalAuth definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(ExternalAuthProperties properties); + } + } + + /** + * Begins update for the ExternalAuth resource. + * + * @return the stage of resource update. + */ + ExternalAuth.Update update(); + + /** + * The template for ExternalAuth update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ExternalAuth apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ExternalAuth apply(Context context); + } + + /** + * The ExternalAuth update stages. + */ + interface UpdateStages { + /** + * The stage of the ExternalAuth update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(ExternalAuthProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ExternalAuth refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ExternalAuth refresh(Context context); +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuthClaimProfile.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuthClaimProfile.java new file mode 100644 index 000000000000..6ab49a6926ce --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuthClaimProfile.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * External Auth claim profile. + */ +@Fluent +public final class ExternalAuthClaimProfile implements JsonSerializable { + /* + * The claim mappings + */ + private TokenClaimMappingsProfile mappings; + + /* + * The claim validation rules + */ + private List validationRules; + + /** + * Creates an instance of ExternalAuthClaimProfile class. + */ + public ExternalAuthClaimProfile() { + } + + /** + * Get the mappings property: The claim mappings. + * + * @return the mappings value. + */ + public TokenClaimMappingsProfile mappings() { + return this.mappings; + } + + /** + * Set the mappings property: The claim mappings. + * + * @param mappings the mappings value to set. + * @return the ExternalAuthClaimProfile object itself. + */ + public ExternalAuthClaimProfile withMappings(TokenClaimMappingsProfile mappings) { + this.mappings = mappings; + return this; + } + + /** + * Get the validationRules property: The claim validation rules. + * + * @return the validationRules value. + */ + public List validationRules() { + return this.validationRules; + } + + /** + * Set the validationRules property: The claim validation rules. + * + * @param validationRules the validationRules value to set. + * @return the ExternalAuthClaimProfile object itself. + */ + public ExternalAuthClaimProfile withValidationRules(List validationRules) { + this.validationRules = validationRules; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("mappings", this.mappings); + jsonWriter.writeArrayField("validationRules", this.validationRules, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExternalAuthClaimProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExternalAuthClaimProfile 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 ExternalAuthClaimProfile. + */ + public static ExternalAuthClaimProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExternalAuthClaimProfile deserializedExternalAuthClaimProfile = new ExternalAuthClaimProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mappings".equals(fieldName)) { + deserializedExternalAuthClaimProfile.mappings = TokenClaimMappingsProfile.fromJson(reader); + } else if ("validationRules".equals(fieldName)) { + List validationRules + = reader.readArray(reader1 -> TokenClaimValidationRule.fromJson(reader1)); + deserializedExternalAuthClaimProfile.validationRules = validationRules; + } else { + reader.skipChildren(); + } + } + + return deserializedExternalAuthClaimProfile; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuthClientComponentProfile.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuthClientComponentProfile.java new file mode 100644 index 000000000000..606b853ce9c3 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuthClientComponentProfile.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * External Auth component profile + * Must have unique namespace/name pairs. + */ +@Fluent +public final class ExternalAuthClientComponentProfile implements JsonSerializable { + /* + * The name of the external auth client + * + * This specifies the name of the platform component being configured to use + * the identity provider as an authentication mode. + * It is used in combination with namespace as a unique identifier. + */ + private String name; + + /* + * The namespace of the external Auth client + * This specifies the namespace in which the platform component being configured + * to use the identity provider as an authentication mode is running. + * + * It is used in combination with name as a unique identifier. + */ + private String authClientNamespace; + + /** + * Creates an instance of ExternalAuthClientComponentProfile class. + */ + public ExternalAuthClientComponentProfile() { + } + + /** + * Get the name property: The name of the external auth client + * + * This specifies the name of the platform component being configured to use + * the identity provider as an authentication mode. + * It is used in combination with namespace as a unique identifier. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the external auth client + * + * This specifies the name of the platform component being configured to use + * the identity provider as an authentication mode. + * It is used in combination with namespace as a unique identifier. + * + * @param name the name value to set. + * @return the ExternalAuthClientComponentProfile object itself. + */ + public ExternalAuthClientComponentProfile withName(String name) { + this.name = name; + return this; + } + + /** + * Get the authClientNamespace property: The namespace of the external Auth client + * This specifies the namespace in which the platform component being configured + * to use the identity provider as an authentication mode is running. + * + * It is used in combination with name as a unique identifier. + * + * @return the authClientNamespace value. + */ + public String authClientNamespace() { + return this.authClientNamespace; + } + + /** + * Set the authClientNamespace property: The namespace of the external Auth client + * This specifies the namespace in which the platform component being configured + * to use the identity provider as an authentication mode is running. + * + * It is used in combination with name as a unique identifier. + * + * @param authClientNamespace the authClientNamespace value to set. + * @return the ExternalAuthClientComponentProfile object itself. + */ + public ExternalAuthClientComponentProfile withAuthClientNamespace(String authClientNamespace) { + this.authClientNamespace = authClientNamespace; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("authClientNamespace", this.authClientNamespace); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExternalAuthClientComponentProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExternalAuthClientComponentProfile 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 ExternalAuthClientComponentProfile. + */ + public static ExternalAuthClientComponentProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExternalAuthClientComponentProfile deserializedExternalAuthClientComponentProfile + = new ExternalAuthClientComponentProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedExternalAuthClientComponentProfile.name = reader.getString(); + } else if ("authClientNamespace".equals(fieldName)) { + deserializedExternalAuthClientComponentProfile.authClientNamespace = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExternalAuthClientComponentProfile; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuthClientProfile.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuthClientProfile.java new file mode 100644 index 000000000000..3011f4693704 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuthClientProfile.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * External Auth client profile + * This configures how on-cluster, platform clients should request tokens from the identity provider. + */ +@Fluent +public final class ExternalAuthClientProfile implements JsonSerializable { + /* + * External Auth client component + */ + private ExternalAuthClientComponentProfile component; + + /* + * External Auth client id + * The clientId must appear in the audience field of the TokenIssuerProfile. + */ + private String clientId; + + /* + * external auth client scopes + * + * This is useful if you have configured claim mappings that requires specific + * scopes to be requested beyond the standard OIDC scopes. + * When omitted, no additional scopes are requested. + */ + private List extraScopes; + + /* + * Determines the OIDC provider client type. + */ + private ExternalAuthClientType type; + + /** + * Creates an instance of ExternalAuthClientProfile class. + */ + public ExternalAuthClientProfile() { + } + + /** + * Get the component property: External Auth client component. + * + * @return the component value. + */ + public ExternalAuthClientComponentProfile component() { + return this.component; + } + + /** + * Set the component property: External Auth client component. + * + * @param component the component value to set. + * @return the ExternalAuthClientProfile object itself. + */ + public ExternalAuthClientProfile withComponent(ExternalAuthClientComponentProfile component) { + this.component = component; + return this; + } + + /** + * Get the clientId property: External Auth client id + * The clientId must appear in the audience field of the TokenIssuerProfile. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: External Auth client id + * The clientId must appear in the audience field of the TokenIssuerProfile. + * + * @param clientId the clientId value to set. + * @return the ExternalAuthClientProfile object itself. + */ + public ExternalAuthClientProfile withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the extraScopes property: external auth client scopes + * + * This is useful if you have configured claim mappings that requires specific + * scopes to be requested beyond the standard OIDC scopes. + * When omitted, no additional scopes are requested. + * + * @return the extraScopes value. + */ + public List extraScopes() { + return this.extraScopes; + } + + /** + * Set the extraScopes property: external auth client scopes + * + * This is useful if you have configured claim mappings that requires specific + * scopes to be requested beyond the standard OIDC scopes. + * When omitted, no additional scopes are requested. + * + * @param extraScopes the extraScopes value to set. + * @return the ExternalAuthClientProfile object itself. + */ + public ExternalAuthClientProfile withExtraScopes(List extraScopes) { + this.extraScopes = extraScopes; + return this; + } + + /** + * Get the type property: Determines the OIDC provider client type. + * + * @return the type value. + */ + public ExternalAuthClientType type() { + return this.type; + } + + /** + * Set the type property: Determines the OIDC provider client type. + * + * @param type the type value to set. + * @return the ExternalAuthClientProfile object itself. + */ + public ExternalAuthClientProfile withType(ExternalAuthClientType type) { + this.type = type; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("component", this.component); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeArrayField("extraScopes", this.extraScopes, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExternalAuthClientProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExternalAuthClientProfile 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 ExternalAuthClientProfile. + */ + public static ExternalAuthClientProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExternalAuthClientProfile deserializedExternalAuthClientProfile = new ExternalAuthClientProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("component".equals(fieldName)) { + deserializedExternalAuthClientProfile.component + = ExternalAuthClientComponentProfile.fromJson(reader); + } else if ("clientId".equals(fieldName)) { + deserializedExternalAuthClientProfile.clientId = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExternalAuthClientProfile.type = ExternalAuthClientType.fromString(reader.getString()); + } else if ("extraScopes".equals(fieldName)) { + List extraScopes = reader.readArray(reader1 -> reader1.getString()); + deserializedExternalAuthClientProfile.extraScopes = extraScopes; + } else { + reader.skipChildren(); + } + } + + return deserializedExternalAuthClientProfile; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuthClientType.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuthClientType.java new file mode 100644 index 000000000000..88acfb98e861 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuthClientType.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Representation of the possible values of an external authentication client's type. + */ +public final class ExternalAuthClientType extends ExpandableStringEnum { + /** + * Indicates that the client is confidential. + * Confidential clients must provide a client secret. + * The secret should be provided within the cluster itself. + */ + public static final ExternalAuthClientType CONFIDENTIAL = fromString("Confidential"); + + /** + * Indicates that the client is public. + * Public clients must not provide a client secret. + */ + public static final ExternalAuthClientType PUBLIC = fromString("Public"); + + /** + * Creates a new instance of ExternalAuthClientType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExternalAuthClientType() { + } + + /** + * Creates or finds a ExternalAuthClientType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExternalAuthClientType. + */ + public static ExternalAuthClientType fromString(String name) { + return fromString(name, ExternalAuthClientType.class); + } + + /** + * Gets known ExternalAuthClientType values. + * + * @return known ExternalAuthClientType values. + */ + public static Collection values() { + return values(ExternalAuthClientType.class); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuthProperties.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuthProperties.java new file mode 100644 index 000000000000..064d48a48711 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuthProperties.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * External Auth profile. + */ +@Fluent +public final class ExternalAuthProperties implements JsonSerializable { + /* + * Provisioning state + */ + private ExternalAuthProvisioningState provisioningState; + + /* + * Status of the external auth resource + */ + private ResourceStatus status; + + /* + * Token Issuer profile + */ + private TokenIssuerProfile issuer; + + /* + * External Auth OIDC clients + * There must not be more than 20 entries and entries must have unique namespace/name pairs. + */ + private List clients; + + /* + * External Auth claim + * This configures how claims are validated and applied. + */ + private ExternalAuthClaimProfile claim; + + /** + * Creates an instance of ExternalAuthProperties class. + */ + public ExternalAuthProperties() { + } + + /** + * Get the provisioningState property: Provisioning state. + * + * @return the provisioningState value. + */ + public ExternalAuthProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the status property: Status of the external auth resource. + * + * @return the status value. + */ + public ResourceStatus status() { + return this.status; + } + + /** + * Get the issuer property: Token Issuer profile. + * + * @return the issuer value. + */ + public TokenIssuerProfile issuer() { + return this.issuer; + } + + /** + * Set the issuer property: Token Issuer profile. + * + * @param issuer the issuer value to set. + * @return the ExternalAuthProperties object itself. + */ + public ExternalAuthProperties withIssuer(TokenIssuerProfile issuer) { + this.issuer = issuer; + return this; + } + + /** + * Get the clients property: External Auth OIDC clients + * There must not be more than 20 entries and entries must have unique namespace/name pairs. + * + * @return the clients value. + */ + public List clients() { + return this.clients; + } + + /** + * Set the clients property: External Auth OIDC clients + * There must not be more than 20 entries and entries must have unique namespace/name pairs. + * + * @param clients the clients value to set. + * @return the ExternalAuthProperties object itself. + */ + public ExternalAuthProperties withClients(List clients) { + this.clients = clients; + return this; + } + + /** + * Get the claim property: External Auth claim + * This configures how claims are validated and applied. + * + * @return the claim value. + */ + public ExternalAuthClaimProfile claim() { + return this.claim; + } + + /** + * Set the claim property: External Auth claim + * This configures how claims are validated and applied. + * + * @param claim the claim value to set. + * @return the ExternalAuthProperties object itself. + */ + public ExternalAuthProperties withClaim(ExternalAuthClaimProfile claim) { + this.claim = claim; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("issuer", this.issuer); + jsonWriter.writeJsonField("claim", this.claim); + jsonWriter.writeArrayField("clients", this.clients, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExternalAuthProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExternalAuthProperties 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 ExternalAuthProperties. + */ + public static ExternalAuthProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExternalAuthProperties deserializedExternalAuthProperties = new ExternalAuthProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("issuer".equals(fieldName)) { + deserializedExternalAuthProperties.issuer = TokenIssuerProfile.fromJson(reader); + } else if ("claim".equals(fieldName)) { + deserializedExternalAuthProperties.claim = ExternalAuthClaimProfile.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedExternalAuthProperties.provisioningState + = ExternalAuthProvisioningState.fromString(reader.getString()); + } else if ("status".equals(fieldName)) { + deserializedExternalAuthProperties.status = ResourceStatus.fromJson(reader); + } else if ("clients".equals(fieldName)) { + List clients + = reader.readArray(reader1 -> ExternalAuthClientProfile.fromJson(reader1)); + deserializedExternalAuthProperties.clients = clients; + } else { + reader.skipChildren(); + } + } + + return deserializedExternalAuthProperties; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuthProvisioningState.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuthProvisioningState.java new file mode 100644 index 000000000000..5d1ba8a51baa --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuthProvisioningState.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The resource provisioning state. + */ +public final class ExternalAuthProvisioningState extends ExpandableStringEnum { + /** + * Resource has been created. + */ + public static final ExternalAuthProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Resource creation failed. + */ + public static final ExternalAuthProvisioningState FAILED = fromString("Failed"); + + /** + * Resource creation was canceled. + */ + public static final ExternalAuthProvisioningState CANCELED = fromString("Canceled"); + + /** + * Non-terminal state indicating the resource has been accepted. + */ + public static final ExternalAuthProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Non-terminal state indicating the resource is deleting. + */ + public static final ExternalAuthProvisioningState DELETING = fromString("Deleting"); + + /** + * Non-terminal state indicating the resource is provisioning. + */ + public static final ExternalAuthProvisioningState PROVISIONING = fromString("Provisioning"); + + /** + * Non-terminal state indicating the resource is updating. + */ + public static final ExternalAuthProvisioningState UPDATING = fromString("Updating"); + + /** + * Non-terminal state indicating the resource is awaiting secret. + */ + public static final ExternalAuthProvisioningState AWAITING_SECRET = fromString("AwaitingSecret"); + + /** + * Creates a new instance of ExternalAuthProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExternalAuthProvisioningState() { + } + + /** + * Creates or finds a ExternalAuthProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExternalAuthProvisioningState. + */ + public static ExternalAuthProvisioningState fromString(String name) { + return fromString(name, ExternalAuthProvisioningState.class); + } + + /** + * Gets known ExternalAuthProvisioningState values. + * + * @return known ExternalAuthProvisioningState values. + */ + public static Collection values() { + return values(ExternalAuthProvisioningState.class); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuths.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuths.java new file mode 100644 index 000000000000..a4f6d44ab179 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ExternalAuths.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ExternalAuths. + */ +public interface ExternalAuths { + /** + * Get a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @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 a ExternalAuth along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String hcpOpenShiftClusterName, + String externalAuthName, Context context); + + /** + * Get a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @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 a ExternalAuth. + */ + ExternalAuth get(String resourceGroupName, String hcpOpenShiftClusterName, String externalAuthName); + + /** + * Delete a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @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. + */ + void delete(String resourceGroupName, String hcpOpenShiftClusterName, String externalAuthName); + + /** + * Delete a ExternalAuth. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @param externalAuthName The name of the ExternalAuth. + * @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. + */ + void delete(String resourceGroupName, String hcpOpenShiftClusterName, String externalAuthName, Context context); + + /** + * List ExternalAuth resources by HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 response of a ExternalAuth list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String hcpOpenShiftClusterName); + + /** + * List ExternalAuth resources by HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 response of a ExternalAuth list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String hcpOpenShiftClusterName, Context context); + + /** + * Get a ExternalAuth. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ExternalAuth along with {@link Response}. + */ + ExternalAuth getById(String id); + + /** + * Get a ExternalAuth. + * + * @param id the resource ID. + * @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 a ExternalAuth along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a ExternalAuth. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a ExternalAuth. + * + * @param id the resource ID. + * @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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ExternalAuth resource. + * + * @param name resource name. + * @return the first stage of the new ExternalAuth definition. + */ + ExternalAuth.DefinitionStages.Blank define(String name); +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/GroupClaimProfile.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/GroupClaimProfile.java new file mode 100644 index 000000000000..744d6fcaebc6 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/GroupClaimProfile.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * External Auth claim profile + * This configures how the groups of a cluster identity should be constructed + * from the claims in a JWT token issued by the identity provider. When + * referencing a claim, if the claim is present in the JWT token, its value + * must be a list of groups separated by a comma (','). + * + * For example - '"example"' and '"exampleOne", "exampleTwo", "exampleThree"' are valid claim values. + */ +@Fluent +public final class GroupClaimProfile implements JsonSerializable { + /* + * Claim name of the external profile + */ + private String claim; + + /* + * + * Prefix for the claim external profile + * If this is specified prefixPolicy will be set to "Prefix" by default + */ + private String prefix; + + /** + * Creates an instance of GroupClaimProfile class. + */ + public GroupClaimProfile() { + } + + /** + * Get the claim property: Claim name of the external profile. + * + * @return the claim value. + */ + public String claim() { + return this.claim; + } + + /** + * Set the claim property: Claim name of the external profile. + * + * @param claim the claim value to set. + * @return the GroupClaimProfile object itself. + */ + public GroupClaimProfile withClaim(String claim) { + this.claim = claim; + return this; + } + + /** + * Get the prefix property: + * Prefix for the claim external profile + * If this is specified prefixPolicy will be set to "Prefix" by default. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: + * Prefix for the claim external profile + * If this is specified prefixPolicy will be set to "Prefix" by default. + * + * @param prefix the prefix value to set. + * @return the GroupClaimProfile object itself. + */ + public GroupClaimProfile withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("claim", this.claim); + jsonWriter.writeStringField("prefix", this.prefix); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GroupClaimProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GroupClaimProfile 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 GroupClaimProfile. + */ + public static GroupClaimProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GroupClaimProfile deserializedGroupClaimProfile = new GroupClaimProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("claim".equals(fieldName)) { + deserializedGroupClaimProfile.claim = reader.getString(); + } else if ("prefix".equals(fieldName)) { + deserializedGroupClaimProfile.prefix = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGroupClaimProfile; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftCluster.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftCluster.java new file mode 100644 index 000000000000..3cf389457d6b --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftCluster.java @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOpenShiftClusterInner; +import java.util.Map; + +/** + * An immutable client-side representation of HcpOpenShiftCluster. + */ +public interface HcpOpenShiftCluster { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + HcpOpenShiftClusterProperties properties(); + + /** + * Gets the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOpenShiftClusterInner object. + * + * @return the inner object. + */ + HcpOpenShiftClusterInner innerModel(); + + /** + * The entirety of the HcpOpenShiftCluster definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The HcpOpenShiftCluster definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the HcpOpenShiftCluster definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the HcpOpenShiftCluster definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the HcpOpenShiftCluster definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the HcpOpenShiftCluster definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, DefinitionStages.WithProperties, DefinitionStages.WithIdentity { + /** + * Executes the create request. + * + * @return the created resource. + */ + HcpOpenShiftCluster create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + HcpOpenShiftCluster create(Context context); + } + + /** + * The stage of the HcpOpenShiftCluster definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the HcpOpenShiftCluster definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(HcpOpenShiftClusterProperties properties); + } + + /** + * The stage of the HcpOpenShiftCluster definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + } + + /** + * Begins update for the HcpOpenShiftCluster resource. + * + * @return the stage of resource update. + */ + HcpOpenShiftCluster.Update update(); + + /** + * The template for HcpOpenShiftCluster update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithIdentity { + /** + * Executes the update request. + * + * @return the updated resource. + */ + HcpOpenShiftCluster apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + HcpOpenShiftCluster apply(Context context); + } + + /** + * The HcpOpenShiftCluster update stages. + */ + interface UpdateStages { + /** + * The stage of the HcpOpenShiftCluster update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the HcpOpenShiftCluster update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(HcpOpenShiftClusterProperties properties); + } + + /** + * The stage of the HcpOpenShiftCluster update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + HcpOpenShiftCluster refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + HcpOpenShiftCluster refresh(Context context); + + /** + * Request a temporary admin kubeconfig for the cluster. + * + * @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 hCP cluster admin credential. + */ + HcpOpenShiftClusterAdminCredential requestAdminCredential(); + + /** + * Request a temporary admin kubeconfig for the cluster. + * + * @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 hCP cluster admin credential. + */ + HcpOpenShiftClusterAdminCredential requestAdminCredential(Context context); + + /** + * Revoke all credentials issued by requestAdminCredential. + * + * @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. + */ + void revokeCredentials(); + + /** + * Revoke all credentials issued by requestAdminCredential. + * + * @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. + */ + void revokeCredentials(Context context); +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftClusterAdminCredential.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftClusterAdminCredential.java new file mode 100644 index 000000000000..1fb3002d1dcd --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftClusterAdminCredential.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOpenShiftClusterAdminCredentialInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of HcpOpenShiftClusterAdminCredential. + */ +public interface HcpOpenShiftClusterAdminCredential { + /** + * Gets the kubeconfig property: Admin kubeconfig with a temporary client certificate. + * + * @return the kubeconfig value. + */ + String kubeconfig(); + + /** + * Gets the expirationTimestamp property: Expiration timestamp for the kubeconfig's client certificate. + * + * @return the expirationTimestamp value. + */ + OffsetDateTime expirationTimestamp(); + + /** + * Gets the inner com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOpenShiftClusterAdminCredentialInner + * object. + * + * @return the inner object. + */ + HcpOpenShiftClusterAdminCredentialInner innerModel(); +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftClusterProperties.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftClusterProperties.java new file mode 100644 index 000000000000..0f8790622e62 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftClusterProperties.java @@ -0,0 +1,490 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * HCP cluster properties. + */ +@Fluent +public final class HcpOpenShiftClusterProperties implements JsonSerializable { + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /* + * Version of the control plane components + */ + private VersionProfile version; + + /* + * Cluster DNS configuration + */ + private DnsProfile dns; + + /* + * Cluster network configuration + */ + private NetworkProfile network; + + /* + * Shows the cluster web console information + */ + private ConsoleProfile console; + + /* + * Shows the cluster API server profile + */ + private ApiProfile api; + + /* + * The cluster ingress configuration + */ + private IngressProfile ingress; + + /* + * Azure platform configuration + */ + private PlatformProfile platform; + + /* + * Configure ClusterAutoscaling . + */ + private ClusterAutoscalingProfile autoscaling; + + /* + * Configure ETCD. + */ + private EtcdProfile etcd; + + /* + * imageDigestMirrors is a set of rules to allow pulling images from a + * mirrored registry by using digest specifications. + * + * WARNING: Updating this array will redeploy all node pools in the cluster. + */ + private List imageDigestMirrors; + + /* + * nodeDrainTimeoutMinutes is the grace period for how long Pod Disruption Budget-protected workloads will be + * respected during any node draining operation. After this grace period, any workloads protected by Pod Disruption + * Budgets that have not been successfully drained from a node will be forcibly evicted. This is + * especially relevant to cluster upgrades. + * + * Valid values are in minutes and from 0 to 10080 minutes (1 week). + * 0 means that the MachinePool can be drained without any time limitation. + * + * This is the value is used a default for all NodePools. It can be overridden + * by specifying nodeDrainTimeoutMinutes for a given NodePool + */ + private Integer nodeDrainTimeoutMinutes; + + /* + * OpenShift internal image registry + */ + private ClusterImageRegistryProfile clusterImageRegistry; + + /* + * Status of the cluster resource + */ + private ResourceStatus status; + + /* + * Cryptographic restrictions for kernel and userspace libraries + */ + private CryptoRestrictions cryptoRestrictions; + + /** + * Creates an instance of HcpOpenShiftClusterProperties class. + */ + public HcpOpenShiftClusterProperties() { + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the version property: Version of the control plane components. + * + * @return the version value. + */ + public VersionProfile version() { + return this.version; + } + + /** + * Set the version property: Version of the control plane components. + * + * @param version the version value to set. + * @return the HcpOpenShiftClusterProperties object itself. + */ + public HcpOpenShiftClusterProperties withVersion(VersionProfile version) { + this.version = version; + return this; + } + + /** + * Get the dns property: Cluster DNS configuration. + * + * @return the dns value. + */ + public DnsProfile dns() { + return this.dns; + } + + /** + * Set the dns property: Cluster DNS configuration. + * + * @param dns the dns value to set. + * @return the HcpOpenShiftClusterProperties object itself. + */ + public HcpOpenShiftClusterProperties withDns(DnsProfile dns) { + this.dns = dns; + return this; + } + + /** + * Get the network property: Cluster network configuration. + * + * @return the network value. + */ + public NetworkProfile network() { + return this.network; + } + + /** + * Set the network property: Cluster network configuration. + * + * @param network the network value to set. + * @return the HcpOpenShiftClusterProperties object itself. + */ + public HcpOpenShiftClusterProperties withNetwork(NetworkProfile network) { + this.network = network; + return this; + } + + /** + * Get the console property: Shows the cluster web console information. + * + * @return the console value. + */ + public ConsoleProfile console() { + return this.console; + } + + /** + * Get the api property: Shows the cluster API server profile. + * + * @return the api value. + */ + public ApiProfile api() { + return this.api; + } + + /** + * Set the api property: Shows the cluster API server profile. + * + * @param api the api value to set. + * @return the HcpOpenShiftClusterProperties object itself. + */ + public HcpOpenShiftClusterProperties withApi(ApiProfile api) { + this.api = api; + return this; + } + + /** + * Get the ingress property: The cluster ingress configuration. + * + * @return the ingress value. + */ + public IngressProfile ingress() { + return this.ingress; + } + + /** + * Set the ingress property: The cluster ingress configuration. + * + * @param ingress the ingress value to set. + * @return the HcpOpenShiftClusterProperties object itself. + */ + public HcpOpenShiftClusterProperties withIngress(IngressProfile ingress) { + this.ingress = ingress; + return this; + } + + /** + * Get the platform property: Azure platform configuration. + * + * @return the platform value. + */ + public PlatformProfile platform() { + return this.platform; + } + + /** + * Set the platform property: Azure platform configuration. + * + * @param platform the platform value to set. + * @return the HcpOpenShiftClusterProperties object itself. + */ + public HcpOpenShiftClusterProperties withPlatform(PlatformProfile platform) { + this.platform = platform; + return this; + } + + /** + * Get the autoscaling property: Configure ClusterAutoscaling . + * + * @return the autoscaling value. + */ + public ClusterAutoscalingProfile autoscaling() { + return this.autoscaling; + } + + /** + * Set the autoscaling property: Configure ClusterAutoscaling . + * + * @param autoscaling the autoscaling value to set. + * @return the HcpOpenShiftClusterProperties object itself. + */ + public HcpOpenShiftClusterProperties withAutoscaling(ClusterAutoscalingProfile autoscaling) { + this.autoscaling = autoscaling; + return this; + } + + /** + * Get the etcd property: Configure ETCD. + * + * @return the etcd value. + */ + public EtcdProfile etcd() { + return this.etcd; + } + + /** + * Set the etcd property: Configure ETCD. + * + * @param etcd the etcd value to set. + * @return the HcpOpenShiftClusterProperties object itself. + */ + public HcpOpenShiftClusterProperties withEtcd(EtcdProfile etcd) { + this.etcd = etcd; + return this; + } + + /** + * Get the imageDigestMirrors property: imageDigestMirrors is a set of rules to allow pulling images from a + * mirrored registry by using digest specifications. + * + * WARNING: Updating this array will redeploy all node pools in the cluster. + * + * @return the imageDigestMirrors value. + */ + public List imageDigestMirrors() { + return this.imageDigestMirrors; + } + + /** + * Set the imageDigestMirrors property: imageDigestMirrors is a set of rules to allow pulling images from a + * mirrored registry by using digest specifications. + * + * WARNING: Updating this array will redeploy all node pools in the cluster. + * + * @param imageDigestMirrors the imageDigestMirrors value to set. + * @return the HcpOpenShiftClusterProperties object itself. + */ + public HcpOpenShiftClusterProperties withImageDigestMirrors(List imageDigestMirrors) { + this.imageDigestMirrors = imageDigestMirrors; + return this; + } + + /** + * Get the nodeDrainTimeoutMinutes property: nodeDrainTimeoutMinutes is the grace period for how long Pod Disruption + * Budget-protected workloads will be + * respected during any node draining operation. After this grace period, any workloads protected by Pod Disruption + * Budgets that have not been successfully drained from a node will be forcibly evicted. This is + * especially relevant to cluster upgrades. + * + * Valid values are in minutes and from 0 to 10080 minutes (1 week). + * 0 means that the MachinePool can be drained without any time limitation. + * + * This is the value is used a default for all NodePools. It can be overridden + * by specifying nodeDrainTimeoutMinutes for a given NodePool. + * + * @return the nodeDrainTimeoutMinutes value. + */ + public Integer nodeDrainTimeoutMinutes() { + return this.nodeDrainTimeoutMinutes; + } + + /** + * Set the nodeDrainTimeoutMinutes property: nodeDrainTimeoutMinutes is the grace period for how long Pod Disruption + * Budget-protected workloads will be + * respected during any node draining operation. After this grace period, any workloads protected by Pod Disruption + * Budgets that have not been successfully drained from a node will be forcibly evicted. This is + * especially relevant to cluster upgrades. + * + * Valid values are in minutes and from 0 to 10080 minutes (1 week). + * 0 means that the MachinePool can be drained without any time limitation. + * + * This is the value is used a default for all NodePools. It can be overridden + * by specifying nodeDrainTimeoutMinutes for a given NodePool. + * + * @param nodeDrainTimeoutMinutes the nodeDrainTimeoutMinutes value to set. + * @return the HcpOpenShiftClusterProperties object itself. + */ + public HcpOpenShiftClusterProperties withNodeDrainTimeoutMinutes(Integer nodeDrainTimeoutMinutes) { + this.nodeDrainTimeoutMinutes = nodeDrainTimeoutMinutes; + return this; + } + + /** + * Get the clusterImageRegistry property: OpenShift internal image registry. + * + * @return the clusterImageRegistry value. + */ + public ClusterImageRegistryProfile clusterImageRegistry() { + return this.clusterImageRegistry; + } + + /** + * Set the clusterImageRegistry property: OpenShift internal image registry. + * + * @param clusterImageRegistry the clusterImageRegistry value to set. + * @return the HcpOpenShiftClusterProperties object itself. + */ + public HcpOpenShiftClusterProperties withClusterImageRegistry(ClusterImageRegistryProfile clusterImageRegistry) { + this.clusterImageRegistry = clusterImageRegistry; + return this; + } + + /** + * Get the status property: Status of the cluster resource. + * + * @return the status value. + */ + public ResourceStatus status() { + return this.status; + } + + /** + * Get the cryptoRestrictions property: Cryptographic restrictions for kernel and userspace libraries. + * + * @return the cryptoRestrictions value. + */ + public CryptoRestrictions cryptoRestrictions() { + return this.cryptoRestrictions; + } + + /** + * Set the cryptoRestrictions property: Cryptographic restrictions for kernel and userspace libraries. + * + * @param cryptoRestrictions the cryptoRestrictions value to set. + * @return the HcpOpenShiftClusterProperties object itself. + */ + public HcpOpenShiftClusterProperties withCryptoRestrictions(CryptoRestrictions cryptoRestrictions) { + this.cryptoRestrictions = cryptoRestrictions; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("version", this.version); + jsonWriter.writeJsonField("platform", this.platform); + jsonWriter.writeJsonField("dns", this.dns); + jsonWriter.writeJsonField("network", this.network); + jsonWriter.writeJsonField("api", this.api); + jsonWriter.writeJsonField("ingress", this.ingress); + jsonWriter.writeJsonField("autoscaling", this.autoscaling); + jsonWriter.writeJsonField("etcd", this.etcd); + jsonWriter.writeArrayField("imageDigestMirrors", this.imageDigestMirrors, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("nodeDrainTimeoutMinutes", this.nodeDrainTimeoutMinutes); + jsonWriter.writeJsonField("clusterImageRegistry", this.clusterImageRegistry); + jsonWriter.writeStringField("cryptoRestrictions", + this.cryptoRestrictions == null ? null : this.cryptoRestrictions.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HcpOpenShiftClusterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HcpOpenShiftClusterProperties 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 HcpOpenShiftClusterProperties. + */ + public static HcpOpenShiftClusterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HcpOpenShiftClusterProperties deserializedHcpOpenShiftClusterProperties + = new HcpOpenShiftClusterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("version".equals(fieldName)) { + deserializedHcpOpenShiftClusterProperties.version = VersionProfile.fromJson(reader); + } else if ("platform".equals(fieldName)) { + deserializedHcpOpenShiftClusterProperties.platform = PlatformProfile.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedHcpOpenShiftClusterProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("dns".equals(fieldName)) { + deserializedHcpOpenShiftClusterProperties.dns = DnsProfile.fromJson(reader); + } else if ("network".equals(fieldName)) { + deserializedHcpOpenShiftClusterProperties.network = NetworkProfile.fromJson(reader); + } else if ("console".equals(fieldName)) { + deserializedHcpOpenShiftClusterProperties.console = ConsoleProfile.fromJson(reader); + } else if ("api".equals(fieldName)) { + deserializedHcpOpenShiftClusterProperties.api = ApiProfile.fromJson(reader); + } else if ("ingress".equals(fieldName)) { + deserializedHcpOpenShiftClusterProperties.ingress = IngressProfile.fromJson(reader); + } else if ("autoscaling".equals(fieldName)) { + deserializedHcpOpenShiftClusterProperties.autoscaling = ClusterAutoscalingProfile.fromJson(reader); + } else if ("etcd".equals(fieldName)) { + deserializedHcpOpenShiftClusterProperties.etcd = EtcdProfile.fromJson(reader); + } else if ("imageDigestMirrors".equals(fieldName)) { + List imageDigestMirrors + = reader.readArray(reader1 -> ImageDigestMirror.fromJson(reader1)); + deserializedHcpOpenShiftClusterProperties.imageDigestMirrors = imageDigestMirrors; + } else if ("nodeDrainTimeoutMinutes".equals(fieldName)) { + deserializedHcpOpenShiftClusterProperties.nodeDrainTimeoutMinutes + = reader.getNullable(JsonReader::getInt); + } else if ("clusterImageRegistry".equals(fieldName)) { + deserializedHcpOpenShiftClusterProperties.clusterImageRegistry + = ClusterImageRegistryProfile.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedHcpOpenShiftClusterProperties.status = ResourceStatus.fromJson(reader); + } else if ("cryptoRestrictions".equals(fieldName)) { + deserializedHcpOpenShiftClusterProperties.cryptoRestrictions + = CryptoRestrictions.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedHcpOpenShiftClusterProperties; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftClusters.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftClusters.java new file mode 100644 index 000000000000..aa6b06e22aa0 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftClusters.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of HcpOpenShiftClusters. + */ +public interface HcpOpenShiftClusters { + /** + * Get a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 a HcpOpenShiftCluster along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, + String hcpOpenShiftClusterName, Context context); + + /** + * Get a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 a HcpOpenShiftCluster. + */ + HcpOpenShiftCluster getByResourceGroup(String resourceGroupName, String hcpOpenShiftClusterName); + + /** + * Delete a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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. + */ + void deleteByResourceGroup(String resourceGroupName, String hcpOpenShiftClusterName); + + /** + * Delete a HcpOpenShiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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. + */ + void delete(String resourceGroupName, String hcpOpenShiftClusterName, Context context); + + /** + * List HcpOpenShiftCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a HcpOpenShiftCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List HcpOpenShiftCluster resources by 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 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 response of a HcpOpenShiftCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List HcpOpenShiftCluster resources by subscription ID. + * + * @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 response of a HcpOpenShiftCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List HcpOpenShiftCluster resources by subscription ID. + * + * @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 response of a HcpOpenShiftCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Request a temporary admin kubeconfig for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 hCP cluster admin credential. + */ + HcpOpenShiftClusterAdminCredential requestAdminCredential(String resourceGroupName, String hcpOpenShiftClusterName); + + /** + * Request a temporary admin kubeconfig for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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 hCP cluster admin credential. + */ + HcpOpenShiftClusterAdminCredential requestAdminCredential(String resourceGroupName, String hcpOpenShiftClusterName, + Context context); + + /** + * Revoke all credentials issued by requestAdminCredential. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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. + */ + void revokeCredentials(String resourceGroupName, String hcpOpenShiftClusterName); + + /** + * Revoke all credentials issued by requestAdminCredential. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hcpOpenShiftClusterName The name of the HcpOpenShiftCluster. + * @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. + */ + void revokeCredentials(String resourceGroupName, String hcpOpenShiftClusterName, Context context); + + /** + * Get a HcpOpenShiftCluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a HcpOpenShiftCluster along with {@link Response}. + */ + HcpOpenShiftCluster getById(String id); + + /** + * Get a HcpOpenShiftCluster. + * + * @param id the resource ID. + * @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 a HcpOpenShiftCluster along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a HcpOpenShiftCluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a HcpOpenShiftCluster. + * + * @param id the resource ID. + * @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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new HcpOpenShiftCluster resource. + * + * @param name resource name. + * @return the first stage of the new HcpOpenShiftCluster definition. + */ + HcpOpenShiftCluster.DefinitionStages.Blank define(String name); +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftVersion.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftVersion.java new file mode 100644 index 000000000000..ce7fd643bb18 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftVersion.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOpenShiftVersionInner; + +/** + * An immutable client-side representation of HcpOpenShiftVersion. + */ +public interface HcpOpenShiftVersion { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + HcpOpenShiftVersionProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOpenShiftVersionInner object. + * + * @return the inner object. + */ + HcpOpenShiftVersionInner innerModel(); +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftVersionProperties.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftVersionProperties.java new file mode 100644 index 000000000000..a4311b3a8366 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftVersionProperties.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * HcpOpenShiftVersionProperties contains details of an available HCP Openshift version. + */ +@Immutable +public final class HcpOpenShiftVersionProperties implements JsonSerializable { + /* + * ChannelGroup is the name of the group where this version belongs. + */ + private String channelGroup; + + /* + * Enabled indicates if this version can be used to create clusters. + */ + private boolean enabled; + + /* + * EndOfLifeTimestamp is the date and time when this version will reach End of Life. + */ + private OffsetDateTime endOfLifeTimestamp; + + /** + * Creates an instance of HcpOpenShiftVersionProperties class. + */ + private HcpOpenShiftVersionProperties() { + } + + /** + * Get the channelGroup property: ChannelGroup is the name of the group where this version belongs. + * + * @return the channelGroup value. + */ + public String channelGroup() { + return this.channelGroup; + } + + /** + * Get the enabled property: Enabled indicates if this version can be used to create clusters. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Get the endOfLifeTimestamp property: EndOfLifeTimestamp is the date and time when this version will reach End of + * Life. + * + * @return the endOfLifeTimestamp value. + */ + public OffsetDateTime endOfLifeTimestamp() { + return this.endOfLifeTimestamp; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("channelGroup", this.channelGroup); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("endOfLifeTimestamp", + this.endOfLifeTimestamp == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endOfLifeTimestamp)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HcpOpenShiftVersionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HcpOpenShiftVersionProperties 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 HcpOpenShiftVersionProperties. + */ + public static HcpOpenShiftVersionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HcpOpenShiftVersionProperties deserializedHcpOpenShiftVersionProperties + = new HcpOpenShiftVersionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("channelGroup".equals(fieldName)) { + deserializedHcpOpenShiftVersionProperties.channelGroup = reader.getString(); + } else if ("enabled".equals(fieldName)) { + deserializedHcpOpenShiftVersionProperties.enabled = reader.getBoolean(); + } else if ("endOfLifeTimestamp".equals(fieldName)) { + deserializedHcpOpenShiftVersionProperties.endOfLifeTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedHcpOpenShiftVersionProperties; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftVersions.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftVersions.java new file mode 100644 index 000000000000..dc5a35a06d62 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOpenShiftVersions.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of HcpOpenShiftVersions. + */ +public interface HcpOpenShiftVersions { + /** + * Get a HcpOpenShiftVersion. + * + * @param location The name of the Azure region. + * @param hcpOpenShiftVersionName The name of the HcpOpenShiftVersion. + * @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 a HcpOpenShiftVersion along with {@link Response}. + */ + Response getWithResponse(String location, String hcpOpenShiftVersionName, Context context); + + /** + * Get a HcpOpenShiftVersion. + * + * @param location The name of the Azure region. + * @param hcpOpenShiftVersionName The name of the HcpOpenShiftVersion. + * @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 a HcpOpenShiftVersion. + */ + HcpOpenShiftVersion get(String location, String hcpOpenShiftVersionName); + + /** + * List HcpOpenShiftVersion resources by SubscriptionLocationResource. + * + * @param location The name of the Azure region. + * @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 response of a HcpOpenShiftVersion list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String location); + + /** + * List HcpOpenShiftVersion resources by SubscriptionLocationResource. + * + * @param location The name of the Azure region. + * @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 response of a HcpOpenShiftVersion list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String location, Context context); +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOperatorIdentityRoleSet.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOperatorIdentityRoleSet.java new file mode 100644 index 000000000000..0e1cff764a78 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOperatorIdentityRoleSet.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOperatorIdentityRoleSetInner; + +/** + * An immutable client-side representation of HcpOperatorIdentityRoleSet. + */ +public interface HcpOperatorIdentityRoleSet { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + HcpOperatorIdentityRoleSetProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.redhatopenshifthcp.fluent.models.HcpOperatorIdentityRoleSetInner object. + * + * @return the inner object. + */ + HcpOperatorIdentityRoleSetInner innerModel(); +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOperatorIdentityRoleSetProperties.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOperatorIdentityRoleSetProperties.java new file mode 100644 index 000000000000..a0e14e0327e7 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOperatorIdentityRoleSetProperties.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * HCP Operator Identity Roles properties. + */ +@Immutable +public final class HcpOperatorIdentityRoleSetProperties + implements JsonSerializable { + /* + * The role definitions required for the User-Assigned managed identities used + * by Control Plane operators on a cluster. + */ + private List controlPlaneOperators; + + /* + * The role definitions required for the User-Assigned managed identities used + * by Data Plane operators on a cluster. + */ + private List dataPlaneOperators; + + /** + * Creates an instance of HcpOperatorIdentityRoleSetProperties class. + */ + private HcpOperatorIdentityRoleSetProperties() { + } + + /** + * Get the controlPlaneOperators property: The role definitions required for the User-Assigned managed identities + * used + * by Control Plane operators on a cluster. + * + * @return the controlPlaneOperators value. + */ + public List controlPlaneOperators() { + return this.controlPlaneOperators; + } + + /** + * Get the dataPlaneOperators property: The role definitions required for the User-Assigned managed identities used + * by Data Plane operators on a cluster. + * + * @return the dataPlaneOperators value. + */ + public List dataPlaneOperators() { + return this.dataPlaneOperators; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("controlPlaneOperators", this.controlPlaneOperators, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("dataPlaneOperators", this.dataPlaneOperators, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HcpOperatorIdentityRoleSetProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HcpOperatorIdentityRoleSetProperties 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 HcpOperatorIdentityRoleSetProperties. + */ + public static HcpOperatorIdentityRoleSetProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HcpOperatorIdentityRoleSetProperties deserializedHcpOperatorIdentityRoleSetProperties + = new HcpOperatorIdentityRoleSetProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("controlPlaneOperators".equals(fieldName)) { + List controlPlaneOperators + = reader.readArray(reader1 -> OperatorIdentityRoles.fromJson(reader1)); + deserializedHcpOperatorIdentityRoleSetProperties.controlPlaneOperators = controlPlaneOperators; + } else if ("dataPlaneOperators".equals(fieldName)) { + List dataPlaneOperators + = reader.readArray(reader1 -> OperatorIdentityRoles.fromJson(reader1)); + deserializedHcpOperatorIdentityRoleSetProperties.dataPlaneOperators = dataPlaneOperators; + } else { + reader.skipChildren(); + } + } + + return deserializedHcpOperatorIdentityRoleSetProperties; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOperatorIdentityRoleSets.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOperatorIdentityRoleSets.java new file mode 100644 index 000000000000..9a69c659ebbf --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/HcpOperatorIdentityRoleSets.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of HcpOperatorIdentityRoleSets. + */ +public interface HcpOperatorIdentityRoleSets { + /** + * List HcpOperatorIdentityRoleSet resources by SubscriptionLocationResource. + * + * @param location The name of the Azure region. + * @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 response of a HcpOperatorIdentityRoleSet list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String location); + + /** + * List HcpOperatorIdentityRoleSet resources by SubscriptionLocationResource. + * + * @param location The name of the Azure region. + * @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 response of a HcpOperatorIdentityRoleSet list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String location, Context context); + + /** + * Get a HcpOperatorIdentityRoleSet. + * + * @param location The name of the Azure region. + * @param hcpOperatorIdentityRoleSetName The OpenShift minor version these identities are required for. + * @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 a HcpOperatorIdentityRoleSet along with {@link Response}. + */ + Response getWithResponse(String location, String hcpOperatorIdentityRoleSetName, + Context context); + + /** + * Get a HcpOperatorIdentityRoleSet. + * + * @param location The name of the Azure region. + * @param hcpOperatorIdentityRoleSetName The OpenShift minor version these identities are required for. + * @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 a HcpOperatorIdentityRoleSet. + */ + HcpOperatorIdentityRoleSet get(String location, String hcpOperatorIdentityRoleSetName); +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ImageDigestMirror.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ImageDigestMirror.java new file mode 100644 index 000000000000..38cadf790c52 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/ImageDigestMirror.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * ImageDigestMirror specifies a set of mirror registries to redirect image + * pulls targeting the specified source registries. + */ +@Fluent +public final class ImageDigestMirror implements JsonSerializable { + /* + * source matches the repository that users refer to, e.g. in image pull specifications. + * Setting source to a registry hostname, e.g. docker.io, quay.io, or registry.redhat.io, + * will match the image pull specification of the corresponding registry. + * + * source uses one of the following formats: + * * host[:port] + * * host[:port]/namespace[/namespace...] + * * host[:port]/namespace[/namespace...]/repo + * * [*.]host + * + * for more information about the format, see: + * https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md#choosing-a-registry-toml-table + */ + private String source; + + /* + * mirrors is zero or more locations that may also contain the same images. No mirror will + * be configured if not specified. Images can be pulled from these mirrors only if they are + * referenced by their digests. The mirrored location is obtained by replacing the part of + * the input reference that matches source by the mirrors entry, e.g. for + * registry.redhat.io/product/repo reference, a (source, mirror) pair *.redhat.io, + * mirror.local/redhat causes a mirror.local/redhat/product/repo repository to be used. + * + * The order of mirrors in this list is treated as the user's desired priority, while source + * is by default considered lower priority than all mirrors. + * + * If no mirror is specified or all image pulls from the mirror list fail, the image will + * continue to be pulled from the repository in the pull spec. + * + * Other cluster configuration, including (but not limited to) other imageDigestMirrors + * objects, may impact the exact order mirrors are contacted in, or some mirrors may be + * contacted in parallel, so this should be considered a preference rather than a guarantee + * of ordering. + * + * mirrors uses one of the following formats: + * * host[:port] + * * host[:port]/namespace[/namespace...] + * * host[:port]/namespace[/namespace...]/repo + * + * for more information about the format, see: + * https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md#choosing-a-registry-toml-table + */ + private List mirrors; + + /** + * Creates an instance of ImageDigestMirror class. + */ + public ImageDigestMirror() { + } + + /** + * Get the source property: source matches the repository that users refer to, e.g. in image pull specifications. + * Setting source to a registry hostname, e.g. docker.io, quay.io, or registry.redhat.io, + * will match the image pull specification of the corresponding registry. + * + * source uses one of the following formats: + * * host[:port] + * * host[:port]/namespace[/namespace...] + * * host[:port]/namespace[/namespace...]/repo + * * [*.]host + * + * for more information about the format, see: + * https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md#choosing-a-registry-toml-table. + * + * @return the source value. + */ + public String source() { + return this.source; + } + + /** + * Set the source property: source matches the repository that users refer to, e.g. in image pull specifications. + * Setting source to a registry hostname, e.g. docker.io, quay.io, or registry.redhat.io, + * will match the image pull specification of the corresponding registry. + * + * source uses one of the following formats: + * * host[:port] + * * host[:port]/namespace[/namespace...] + * * host[:port]/namespace[/namespace...]/repo + * * [*.]host + * + * for more information about the format, see: + * https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md#choosing-a-registry-toml-table. + * + * @param source the source value to set. + * @return the ImageDigestMirror object itself. + */ + public ImageDigestMirror withSource(String source) { + this.source = source; + return this; + } + + /** + * Get the mirrors property: mirrors is zero or more locations that may also contain the same images. No mirror will + * be configured if not specified. Images can be pulled from these mirrors only if they are + * referenced by their digests. The mirrored location is obtained by replacing the part of + * the input reference that matches source by the mirrors entry, e.g. for + * registry.redhat.io/product/repo reference, a (source, mirror) pair *.redhat.io, + * mirror.local/redhat causes a mirror.local/redhat/product/repo repository to be used. + * + * The order of mirrors in this list is treated as the user's desired priority, while source + * is by default considered lower priority than all mirrors. + * + * If no mirror is specified or all image pulls from the mirror list fail, the image will + * continue to be pulled from the repository in the pull spec. + * + * Other cluster configuration, including (but not limited to) other imageDigestMirrors + * objects, may impact the exact order mirrors are contacted in, or some mirrors may be + * contacted in parallel, so this should be considered a preference rather than a guarantee + * of ordering. + * + * mirrors uses one of the following formats: + * * host[:port] + * * host[:port]/namespace[/namespace...] + * * host[:port]/namespace[/namespace...]/repo + * + * for more information about the format, see: + * https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md#choosing-a-registry-toml-table. + * + * @return the mirrors value. + */ + public List mirrors() { + return this.mirrors; + } + + /** + * Set the mirrors property: mirrors is zero or more locations that may also contain the same images. No mirror will + * be configured if not specified. Images can be pulled from these mirrors only if they are + * referenced by their digests. The mirrored location is obtained by replacing the part of + * the input reference that matches source by the mirrors entry, e.g. for + * registry.redhat.io/product/repo reference, a (source, mirror) pair *.redhat.io, + * mirror.local/redhat causes a mirror.local/redhat/product/repo repository to be used. + * + * The order of mirrors in this list is treated as the user's desired priority, while source + * is by default considered lower priority than all mirrors. + * + * If no mirror is specified or all image pulls from the mirror list fail, the image will + * continue to be pulled from the repository in the pull spec. + * + * Other cluster configuration, including (but not limited to) other imageDigestMirrors + * objects, may impact the exact order mirrors are contacted in, or some mirrors may be + * contacted in parallel, so this should be considered a preference rather than a guarantee + * of ordering. + * + * mirrors uses one of the following formats: + * * host[:port] + * * host[:port]/namespace[/namespace...] + * * host[:port]/namespace[/namespace...]/repo + * + * for more information about the format, see: + * https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md#choosing-a-registry-toml-table. + * + * @param mirrors the mirrors value to set. + * @return the ImageDigestMirror object itself. + */ + public ImageDigestMirror withMirrors(List mirrors) { + this.mirrors = mirrors; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("source", this.source); + jsonWriter.writeArrayField("mirrors", this.mirrors, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageDigestMirror from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageDigestMirror 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 ImageDigestMirror. + */ + public static ImageDigestMirror fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageDigestMirror deserializedImageDigestMirror = new ImageDigestMirror(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("source".equals(fieldName)) { + deserializedImageDigestMirror.source = reader.getString(); + } else if ("mirrors".equals(fieldName)) { + List mirrors = reader.readArray(reader1 -> reader1.getString()); + deserializedImageDigestMirror.mirrors = mirrors; + } else { + reader.skipChildren(); + } + } + + return deserializedImageDigestMirror; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/IngressProfile.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/IngressProfile.java new file mode 100644 index 000000000000..19ad83a72c4d --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/IngressProfile.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Information about the Ingress of a cluster. + */ +@Fluent +public final class IngressProfile implements JsonSerializable { + /* + * The type of the default cluster ingress. + */ + private IngressType type; + + /** + * Creates an instance of IngressProfile class. + */ + public IngressProfile() { + } + + /** + * Get the type property: The type of the default cluster ingress. + * + * @return the type value. + */ + public IngressType type() { + return this.type; + } + + /** + * Set the type property: The type of the default cluster ingress. + * + * @param type the type value to set. + * @return the IngressProfile object itself. + */ + public IngressProfile withType(IngressType type) { + this.type = type; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IngressProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IngressProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IngressProfile. + */ + public static IngressProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IngressProfile deserializedIngressProfile = new IngressProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedIngressProfile.type = IngressType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIngressProfile; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/IngressType.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/IngressType.java new file mode 100644 index 000000000000..e3927274238f --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/IngressType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of the default cluster ingress. + */ +public final class IngressType extends ExpandableStringEnum { + /** + * The default ingress is visible from the internet. + */ + public static final IngressType PUBLIC = fromString("Public"); + + /** + * The default ingress is not visible from the internet. + */ + public static final IngressType PRIVATE = fromString("Private"); + + /** + * The default ingress is disabled. + */ + public static final IngressType DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of IngressType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IngressType() { + } + + /** + * Creates or finds a IngressType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IngressType. + */ + public static IngressType fromString(String name) { + return fromString(name, IngressType.class); + } + + /** + * Gets known IngressType values. + * + * @return known IngressType values. + */ + public static Collection values() { + return values(IngressType.class); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/KeyVaultVisibility.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/KeyVaultVisibility.java new file mode 100644 index 000000000000..bff917b6d009 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/KeyVaultVisibility.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The internet visibility of a keyvault resource. + */ +public final class KeyVaultVisibility extends ExpandableStringEnum { + /** + * The keyvault is visible from the internet. + */ + public static final KeyVaultVisibility PUBLIC = fromString("Public"); + + /** + * The keyvault is not visible from the internet. + */ + public static final KeyVaultVisibility PRIVATE = fromString("Private"); + + /** + * Creates a new instance of KeyVaultVisibility value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KeyVaultVisibility() { + } + + /** + * Creates or finds a KeyVaultVisibility from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeyVaultVisibility. + */ + public static KeyVaultVisibility fromString(String name) { + return fromString(name, KeyVaultVisibility.class); + } + + /** + * Gets known KeyVaultVisibility values. + * + * @return known KeyVaultVisibility values. + */ + public static Collection values() { + return values(KeyVaultVisibility.class); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/KmsEncryptionProfile.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/KmsEncryptionProfile.java new file mode 100644 index 000000000000..21e738827518 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/KmsEncryptionProfile.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configure etcd encryption Key Management Service (KMS) key. + * Your Microsoft Entra application used to create the cluster must be authorized to access this keyvault, + * e.g using the AzureCLI: `az keyvault set-policy -n $KEYVAULT_NAME --key-permissions decrypt encrypt --spn (YOUR + * APPLICATION CLIENT ID)`. + */ +@Fluent +public final class KmsEncryptionProfile implements JsonSerializable { + /* + * vaultName is the name of the keyvault that contains the secret. + */ + private String vaultName; + + /* + * visibility of the keyvault that contains the secret. + */ + private KeyVaultVisibility visibility; + + /* + * The details of the active key. + */ + private KmsKey activeKey; + + /** + * Creates an instance of KmsEncryptionProfile class. + */ + public KmsEncryptionProfile() { + } + + /** + * Get the vaultName property: vaultName is the name of the keyvault that contains the secret. + * + * @return the vaultName value. + */ + public String vaultName() { + return this.vaultName; + } + + /** + * Set the vaultName property: vaultName is the name of the keyvault that contains the secret. + * + * @param vaultName the vaultName value to set. + * @return the KmsEncryptionProfile object itself. + */ + public KmsEncryptionProfile withVaultName(String vaultName) { + this.vaultName = vaultName; + return this; + } + + /** + * Get the visibility property: visibility of the keyvault that contains the secret. + * + * @return the visibility value. + */ + public KeyVaultVisibility visibility() { + return this.visibility; + } + + /** + * Set the visibility property: visibility of the keyvault that contains the secret. + * + * @param visibility the visibility value to set. + * @return the KmsEncryptionProfile object itself. + */ + public KmsEncryptionProfile withVisibility(KeyVaultVisibility visibility) { + this.visibility = visibility; + return this; + } + + /** + * Get the activeKey property: The details of the active key. + * + * @return the activeKey value. + */ + public KmsKey activeKey() { + return this.activeKey; + } + + /** + * Set the activeKey property: The details of the active key. + * + * @param activeKey the activeKey value to set. + * @return the KmsEncryptionProfile object itself. + */ + public KmsEncryptionProfile withActiveKey(KmsKey activeKey) { + this.activeKey = activeKey; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("vaultName", this.vaultName); + jsonWriter.writeStringField("visibility", this.visibility == null ? null : this.visibility.toString()); + jsonWriter.writeJsonField("activeKey", this.activeKey); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KmsEncryptionProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KmsEncryptionProfile 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 KmsEncryptionProfile. + */ + public static KmsEncryptionProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KmsEncryptionProfile deserializedKmsEncryptionProfile = new KmsEncryptionProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vaultName".equals(fieldName)) { + deserializedKmsEncryptionProfile.vaultName = reader.getString(); + } else if ("visibility".equals(fieldName)) { + deserializedKmsEncryptionProfile.visibility = KeyVaultVisibility.fromString(reader.getString()); + } else if ("activeKey".equals(fieldName)) { + deserializedKmsEncryptionProfile.activeKey = KmsKey.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedKmsEncryptionProfile; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/KmsKey.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/KmsKey.java new file mode 100644 index 000000000000..7942d672bdba --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/KmsKey.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A representation of a KeyVault Secret. + */ +@Fluent +public final class KmsKey implements JsonSerializable { + /* + * name is the name of the keyvault key used for encryption/decryption. + */ + private String name; + + /* + * version contains the version of the key to use. + */ + private String version; + + /** + * Creates an instance of KmsKey class. + */ + public KmsKey() { + } + + /** + * Get the name property: name is the name of the keyvault key used for encryption/decryption. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: name is the name of the keyvault key used for encryption/decryption. + * + * @param name the name value to set. + * @return the KmsKey object itself. + */ + public KmsKey withName(String name) { + this.name = name; + return this; + } + + /** + * Get the version property: version contains the version of the key to use. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: version contains the version of the key to use. + * + * @param version the version value to set. + * @return the KmsKey object itself. + */ + public KmsKey withVersion(String version) { + this.version = version; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KmsKey from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KmsKey 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 KmsKey. + */ + public static KmsKey fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KmsKey deserializedKmsKey = new KmsKey(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedKmsKey.name = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedKmsKey.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKmsKey; + }); + } +} diff --git a/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/Label.java b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/Label.java new file mode 100644 index 000000000000..693a1a4ea2b4 --- /dev/null +++ b/sdk/redhatopenshifthcp/azure-resourcemanager-redhatopenshifthcp/src/main/java/com/azure/resourcemanager/redhatopenshifthcp/models/Label.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.redhatopenshifthcp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Label represents the Kubernetes label. + */ +@Fluent +public final class Label implements JsonSerializable